Contents
About this report
Report parameters
Contexts
No contexts were selected, so all contexts were included by default.
Sites
The following sites were included:
- https://www.fa.ru
(If no sites were selected, all sites were included by default.)
An included site must also be within one of the included contexts for its data to be included in the report.
Risk levels
Included: Высокий, Средний, Низкий, Информационный
Excluded: None
Confidence levels
Included: Пользователь подтвержден , Высокий, Средний, Низкий
Excluded: Пользователь подтвержден , Высокий, Средний, Низкий, Ложно-положительное
Summaries
Alert counts by risk and confidence
| Confidence | ||||||
|---|---|---|---|---|---|---|
| Пользователь подтвержден | Высокий | Средний | Низкий | Total | ||
| Risk | Высокий | 0 (0,0 %) |
1 (4,0 %) |
1 (4,0 %) |
0 (0,0 %) |
2 (8,0 %) |
| Средний | 0 (0,0 %) |
5 (20,0 %) |
2 (8,0 %) |
1 (4,0 %) |
8 (32,0 %) |
|
| Низкий | 0 (0,0 %) |
2 (8,0 %) |
6 (24,0 %) |
1 (4,0 %) |
9 (36,0 %) |
|
| Информационный | 0 (0,0 %) |
1 (4,0 %) |
3 (12,0 %) |
2 (8,0 %) |
6 (24,0 %) |
|
| Total | 0 (0,0 %) |
9 (36,0 %) |
12 (48,0 %) |
4 (16,0 %) |
25 (100%) |
|
Alert counts by site and risk
| Risk | |||||
|---|---|---|---|---|---|
|
Высокий (= Высокий) |
Средний (>= Средний) |
Низкий (>= Низкий) |
Информационный (>= Информационный) |
||
| Site | https://www.fa.ru | 2 (2) |
8 (10) |
9 (19) |
6 (25) |
Alert counts by alert type
Alerts
-
Risk=Высокий, Confidence=Высокий (1)
-
https://www.fa.ru (1)
-
Раскрытие PII (1)
GET https://www.fa.ru/for-applicants/educational-programs/dpo/byhuchet/
Alert tags Alert description Ответ содержит личную информацию, такую как номер CC, SSN и аналогичные конфиденциальные данные.
Other info Обнаружен тип кредитной карты: Maestro
Идентификационный номер банка: 676864
Торговая марка: MAESTRO
Категория:
Эмитент: VTB BANK (ARMENIA) CJSC
Request Request line and header section (367 bytes)
GET https://www.fa.ru/for-applicants/educational-programs/dpo/byhuchet/ HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/sitemap-files.xml Cookie: PHPSESSID=55GD6ogtrC3BCvIP54EbqdVa76Qs0VMIRequest body (0 bytes)
Response Status line and header section (526 bytes)
HTTP/1.1 200 OK Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:16:19 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 136685 Connection: keep-alive Keep-Alive: timeout=10 Vary: Accept-Encoding P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA" Cache-Control: max-age=60 Cache-Control: private, max-age=60 X-Frame-Options: SAMEORIGIN Content-Security-Policy: frame-ancestors 'self'; Vary: Accept-Encoding Expires: Tue, 16 Dec 2025 10:17:19 GMTResponse body (136685 bytes)
<!DOCTYPE html> <html lang="ru" id="s1"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="абитуриенты, поступление, Финансовый университет, направления подготовки, документы, приёмная комиссия, экзамены, баллы ЕГЭ, обучение, подготовительные курсы" /> <meta name="description" content=" " /> <link href="/bitrix/cache/css/s1/main/template_9e0403e4e76a8459f3aa93a1eab92994/template_9e0403e4e76a8459f3aa93a1eab92994_v1.css?1763707797327626" type="text/css" data-template-style="true" rel="stylesheet" /> <meta property="og:type" content="article"> <meta property="og:url" content="https://www.fa.ru/for-applicants/educational-programs/dpo/byhuchet/"> <meta property="og:description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»"> <meta property="og:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <meta name="robots" content="index, follow"/> <title>Бухгалтерский учет, анализ и аудит</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><!--if IEmeta(http-equiv='X-UA-Compatible' content='IE=edge')--> <meta property="og:title" content="Финансовый университет при Правительстве РФ | Бухгалтерский учет, анализ и аудит"/> <!--link(rel='shortcut icon' href='./favicon.png')--><!--link(rel='preload' href='/fonts/.woff2' as='font' crossorigin='' type='font/woff2')--> <!-- <link rel="stylesheet" href="--><!--/css/vendor.css">--> <!-- <link rel="stylesheet" href="--><!--/css/app.css">--> </head> <body hx-ext="multi-swap"> <div class="sp-panel js-sp-panel"> <div class="sp-panel__bg"></div> <div class="sp-panel__container"> <div class="container"> <div class="sp-panel__head"> <p class="sp-panel__title">Версия для слабовидящих</p><button itemprop="copy" class="ui-icon-button _secondary sp-panel__close js-sp-panel-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="sp-panel__content"> <div class="sp-panel__group _text"> <p class="sp-panel__label">Размер текста:</p> <div class="sp-panel__buttons"><button type="button" data-sp-text="normal">A</button><button type="button" data-sp-text="medium">A</button><button type="button" data-sp-text="large">A</button></div> </div> <div class="sp-panel__group _color"> <p class="sp-panel__label">Цветовая схема:</p> <div class="sp-panel__buttons"><button type="button" data-sp-theme="light" title="Обычная">A</button><button type="button" data-sp-theme="dark" title="Темная">A</button><button type="button" data-sp-theme="black" title="Белое на черном">A</button><button type="button" data-sp-theme="white" title="Черное на белом">A</button></div> </div> <div class="sp-panel__group _images"> <p class="sp-panel__label">Изображения:</p> <div><button class="ui-button _tertiary js-sp-panel-img-off" type="button">Отключить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button><button class="ui-button _tertiary js-sp-panel-img-on" type="button">Включить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> <div class="sp-panel__group _reset"><button class="ui-button _secondary js-sp-panel-img-reset">Сбросить настройки<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> </div> </div> </div> <div class="search-popup js-search-popup"> <div class="search-popup__owerlay"></div> <div class="search-popup__container"> <div class="container"> <div class="search-popup__head"> <h2 class="search-popup__title">Поиск по сайту</h2><button class="ui-icon-button _secondary js-search-popup-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="search-popup__search"> <form class="flex gap-16" action="/search/"> <div class="ui-field js-field"> <div class="ui-field__icon"><svg class="_icon-search-24"> <use href="/local/templates/main/sprite.svg#search-24"></use> </svg></div><input class="ui-field__input" type="text" placeholder="Введите ваш запрос" id="ui-field-1" name="q" inputmode="search" /><label class="ui-field__label" for="ui-field-1">Введите ваш запрос</label> </div><button class="ui-button _primary">Поиск<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button> </form> </div> <div class="search-popup__links"> <a href="/search/?q=Подразделения">Подразделения</a> <a href="/search/?q=Кафедры">Кафедры</a> <a href="/search/?q=Магистратура">Магистратура</a> <a href="/search/?q=Дополнительное образование">Дополнительное образование</a> <a href="/search/?q=Поступающим">Поступающим</a> </div> </div> </div> </div> <header class="header _contrast" id="js-header"> <div class="container"> <div class="header__row _top"> <div class="header__group"> <button class="header__link _contrast" id="js-menu-sites-button"><svg class="_icon-menu-grid-20"> <use href="/local/templates/main/sprite.svg#menu-grid-20"></use> </svg>Наши сайты</button> <a class="header__link _contrast hidden-sm" href="/university/press-center/">Пресс-центр</a> </div> <div class="flex gap-64 sm-gap-16"> <div class="header__group"> <div class="flex gap-24 sm-gap-16"> <button itemprop="copy" class="header__link hidden-sm js-sp-panel-trigger" type="button"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg><span>Версия для слабовидящих</span></button> </div> <div class="flex gap-24 sm-gap-16"> <a class="header__link _tooltip" href="https://ruz.fa.ru/"> <div class="header__tooltip">Расписание</div><svg class="_icon-calendar-20"> <use href="/local/templates/main/sprite.svg#calendar-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="http://www.library.fa.ru/"> <div class="header__tooltip">Библиотека</div><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="/university/services/"> <div class="header__tooltip">Сервисы</div><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <a class="header__link _tooltip" href="https://org.fa.ru/"> <div class="header__tooltip">Личный кабинет</div><svg class="_icon-user-20"> <use href="/local/templates/main/sprite.svg#user-20"></use> </svg></a> <button class="header__link _tooltip js-search-popup-toggle" type="button"> <div class="header__tooltip">Поиск</div><svg class="_icon-search-20"> <use href="/local/templates/main/sprite.svg#search-20"></use> </svg> </button> <a class="header__link _tooltip" href="https://biz.mail.ru/login/fa.ru"> <div class="header__tooltip">Почта</div><svg class="_icon-mail-20"> <use href="/local/templates/main/sprite.svg#mail-20"></use> </svg> </a> </div><!-- <div class="flex gap-24 sm-gap-16"><a class="header__link" href="#"><svg class="_icon-search-20">--> <!-- <use href="--><!--/sprite.svg#search-20"></use>--> <!-- </svg></a><a class="header__link hidden-sm" href="#"><svg class="_icon-eye-20">--> <!-- <use href="--><!--/sprite.svg#eye-20"></use>--> <!-- </svg></a></div>--> <div class="flex gap-16 hidden-md"> <a class="header__link" href="https://www.fa.ru">Ru</a> <a class="header__link" href="https://en.fa.ru/">En</a> </div> </div><label class="_contrast toggle-theme js-toggle-theme" for="js-toggle-theme"><span class="toggle-theme__light"><svg class="_icon-sun-20"><use href="/local/templates/main/sprite.svg#sun-20"></use></svg></span><span class="toggle-theme__switcher"><input id="js-toggle-theme" type="checkbox" hidden="hidden"/><span class="toggle-theme__flag"></span></span><span class="toggle-theme__dark"><svg class="_icon-moon-20"><use href="/local/templates/main/sprite.svg#moon-20"></use></svg></span></label> </div> </div> <div class="header__row _bottom js-menu__first-level"> <div class="header__row-inner"> <a class="header__logo" href="/"> <svg class="_icon-logo-colored"> <use href="/local/templates/main/sprite.svg#logo-colored"></use> </svg> </a> <div class="flex gap-48 items-center"> <div class="flex gap-40 hidden-md"> <a class="header__main-link js-menu__main-link" href="/university">Университет</a> <a class="header__main-link js-menu__main-link" href="/for-applicants/">Поступающим</a> <a class="header__main-link js-menu__main-link" href="/for-students/">Студентам</a> <a class="header__main-link js-menu__main-link" href="/dpo/">Допобразование</a> <a class="header__main-link js-menu__main-link" href="/graduate/">Выпускникам</a> <a class="header__main-link js-menu__main-link" href="/science/">Наука</a> </div><button class="burger-menu" id="js-burger-menu"><span class="burger-menu__icons"><span class="js-burger-open"><svg class="_icon-menu-24"><use href="/local/templates/main/sprite.svg#menu-24"></use></svg></span><span class="js-burger-close"><svg class="_icon-close-24"><use href="/local/templates/main/sprite.svg#close-24"></use></svg></span></span><span class="burger-menu__label">Меню</span></button> </div> </div> </div> </div> </header> <div class="menu" id="js-menu"> <div class="menu__backdrop js-menu__first-level"></div> <div class="menu__image"> <img src="/local/templates/main/images/example-image.jpg" alt="Фон меню" /> </div> <div class="menu-navbar hidden-from-md"> <div class="menu-navbar__icons"> <a class="menu-navbar__link" href="#"><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="menu-navbar__link" href="#"><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <button class="menu-navbar__link js-sp-panel-trigger"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg></button> <a class="menu-navbar__link" href="#">En</a> </div><a class="menu-navbar__link _media" href="#">Медиа</a> </div> <!-- Главное меню --> <div class="container menu__inner"> <div class="menu-tabs hidden-md" data-lenis-prevent="data-lenis-prevent"><button class="menu-tabs__item js-menu-tab__desktop">Университет</button><button class="menu-tabs__item js-menu-tab__desktop">Поступающим</button><button class="menu-tabs__item js-menu-tab__desktop">Студентам</button><button class="menu-tabs__item js-menu-tab__desktop">Выпускникам</button><button class="menu-tabs__item js-menu-tab__desktop">Дополнительное образование</button><button class="menu-tabs__item js-menu-tab__desktop">Наука</button><button class="menu-tabs__item js-menu-tab__desktop">Международная деятельность</button><button class="menu-tabs__item js-menu-tab__desktop">Работникам и соискателям</button></div> <div class="menu-tabs hidden-from-md js-menu__first-level" data-lenis-prevent="data-lenis-prevent"> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Университет</button> <a class="menu-tabs__icon" href="/university/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Поступающим</button> <a class="menu-tabs__icon" href="/for-applicants/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Студентам</button> <a class="menu-tabs__icon" href="/for-students/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Выпускникам</button> <a class="menu-tabs__icon" href="/graduate/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Дополнительное образование</button> <a class="menu-tabs__icon" href="/dpo/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Наука</button> <a class="menu-tabs__icon" href="/science/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Международная деятельность</button> <a class="menu-tabs__icon" href="/international-activity/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Работникам и соискателям</button> <a class="menu-tabs__icon" href="/employee/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> </div> <div class="menu__content-wrapper js-menu__content-wrapper" data-lenis-prevent="data-lenis-prevent"> <button class="ui-button _tertiary _contrast menu__mobile-back js-menu__mobile-back"><span class="ui-button__icon"><svg class="_icon-caret-left-16"><use href="/local/templates/main/sprite.svg#caret-left-16"></use></svg></span>Назад</button> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/university/"><span class="text-h3 text-contrast">Университет</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Университет</h4> <a class="menu__link" href="/university/basic-information/">Основные сведения</a> <a class="menu__link" href="/university/structure/rectorate/">Руководство</a> <a class="menu__link" href="/university/structure/">Организационная структура</a> <a class="menu__link" href="/university/rating/">Университет в рейтингах</a> <a class="menu__link" href="https://www.fa.ru/university/history/">История Финансового университета</a> <a class="menu__link" href="/university/structure/university/museum/">Музей Финансового университета</a> <a class="menu__link" href="/university/structure/university/usr/social-projects/">Социальные проекты</a> <a class="menu__link" href="/university/programm/">Программа развития</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/branches/">Филиалы</a> <a class="menu__link" href="/university/contacts/">Контакты</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/sveden/">Сведения об образовательной организации</a> <a class="menu__link" href="/university/uchenyy-sovet/">Ученый совет Финансового университета</a> <a class="menu__link" href="/university/psovet/">Попечительский совет</a> <a class="menu__link" href="/university/epb/">Единая правовая база</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/anticorruption/">Противодействие коррупции</a> <a class="menu__link" href="/university/antiterror/">Антитеррористическая и антиэкстремистская деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-applicants/"><span class="text-h3 text-contrast">Поступающим</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/bachelor/">Бакалавриат и специалитет</a> <a class="menu__link" href="/for-applicants/master/">Магистратура</a> <a class="menu__link" href="/for-applicants/postgraduate/">Аспирантура</a> <a class="menu__link" href="/science/doctoral/">Докторантура</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/second-degree/">Второе высшее образование</a> <a class="menu__link" href="/for-applicants/distance-education/">Дистанционное образование</a> <a class="menu__link" href="/for-applicants/transfers/">Переводы и восстановления</a> <a class="menu__link" href="/dpo/">Дополнительное образование</a> <a class="menu__link" href="/international-activity/">Обучение за рубежом</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-students/"><span class="text-h3 text-contrast">Студентам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Сервисы</h4> <a class="menu__link" href="https://org.fa.ru/">Личный кабинет студента</a> <a class="menu__link" href="https://online.fa.ru/">Открытая онлайн-академия</a> <a class="menu__link" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="http://www.library.fa.ru">Библиотека</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="https://en.fa.ru/for-students/">Иностранным студентам</a> <a class="menu__link" href="/for-students/oplata/">Оплата обучения и общежития</a> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="menu__link" href="/for-students/free/">Переход с платного обучения на бесплатное</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/graduate/"><span class="text-h3 text-contrast">Выпускникам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/alumni/">Ассоциация выпускников Финуниверситета</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/foundation/">Эндаумент-фонд</a> <a class="menu__link" href="/graduate/#block-28040">Сервисы для выпускников</a> <a class="menu__link" href="https://endowmentfa.ru/donate">Стать дарителем</a> <a class="menu__link" href="https://www.fa.ru/graduate/alumni-meeting-conference/">Конференция-встреча выпускников Финансового университета</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/mentoring/">Наставничество</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/PolPred/">Полномочный Представитель</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/dpo/"><span class="text-h3 text-contrast">Дополнительное образование</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Подразделения ДПО</h4> <a class="menu__link" href="/university/structure/dpo/vsgz/">Высшая школа государственных закупок</a> <a class="menu__link" href="/university/structure/dpo/vsl/">Высшая школа логистики</a> <a class="menu__link" href="/university/structure/dpo/vsmt/">Высшая школа менеджмента и технологий</a> <a class="menu__link" href="/university/structure/dpo/vsugmf/">Высшая школа управления государственными и муниципальными финансами</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/vsp/">Высшая школа предпринимательства</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Институт корпоративного обучения</a> <a class="menu__link" href="/university/structure/dpo/irpkk/">Институт развития профессиональных компетенций и квалификаций</a> <a class="menu__link" href="/university/structure/dpo/ifm/">Институт финансового менеджмента</a> <a class="menu__link" href="/university/structure/dpo/ifg/">Институт финансовой грамотности</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/ipks/">Институт повышения квалификации специалистов</a> <a class="menu__link" href="/university/structure/dpo/msb/">Международная школа бизнеса (Институт)</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/business-school/">Бизнес-школа Финуниверситета (Институт)</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/dpo/crdo/">Центр развития дополнительного образования</a> <a class="menu__link" href="/university/structure/dpo/podpo/">Центр «Проектный офис ДПО»</a> <a class="menu__link" href="/university/structure/educational-departments/dep/dapk/ciys/">Центр инновационных образовательных и языковых стратегий</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/ff/cnfo/">Центр непрерывного финансового образования Финансового факультета</a> <a class="menu__link" href="/university/structure/dpo/ce/">Центр компетенций "Цифровая экономика"</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/nna/">Кафедра налогов и налогового администрирования</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/meo/iymk/">Кафедра иностранных языков и межкультурной коммуникации</a> <a class="menu__link" href="/university/structure/dpo/rukovodstvodpo/">Руководство ДПО</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/science/"><span class="text-h3 text-contrast">Наука</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная деятельность</h4> <a class="menu__link" href="/science/basic-science/">Фундаментальная наука</a> <a class="menu__link" href="/science/applied-research/">Прикладные исследования</a> <a class="menu__link" href="/university/structure/science/rnj/#block-2642">Журналы Финуниверситета</a> <a class="menu__link" href="/university/structure/education/upo/clusters/">Научно-образовательные кластеры</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Научная инфраструктура</h4> <a class="menu__link" href="/science/research-departments/">Научно-исследовательские подразделения</a> <a class="menu__link" href="/university/structure/science/osni/">Дирекция по организационному сопровождению научных исследований</a> <a class="menu__link" href="/university/structure/science/uoonir/">Группа планирования и мониторинга научной деятельности</a> <a class="menu__link" href="for-students/student-science/nso/">Научное студенческое общество</a> <a class="menu__link" href="/for-students/student-science/council-young-scientists/">Совет молодых ученых</a> <a class="menu__link" href="/university/structure/science/rnj/">Редакция научных журналов</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная аттестация</h4> <a class="menu__link" href="/university/structure/science/uank/">Управление аттестации научных кадров</a> <a class="menu__link" href="/university/structure/science/uank/dsfu/">Диссертационные советы Финансового университета</a> <a class="menu__link" href="/university/structure/science/uank/pd/">Перечень документов для представления в диссертационный совет</a> <a class="menu__link" href="https://www.fa.ru/dissertations/autorefs/">Объявления о защите диссертаций</a> <a class="menu__link" href="https://www.fa.ru/science/nak/">Научно-аттестационная комиссия Финансового Университета</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Экспертно-аналитическая деятельность</h4> <a class="menu__link" href="https://www.fa.ru/science/expert-analytical-activities/">Экспертно-аналитическая деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/international-activity/"><span class="text-h3 text-contrast">Международная деятельность</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Студентам</h4> <a class="menu__link" href="/international-activity/included-education/">Включенное обучение</a> <a class="menu__link" href="/international-activity/two-dip/">Программы двух дипломов</a> <a class="menu__link" href="/international-activity/programs/">Краткосрочные программы</a> <a class="menu__link" href="/international-activity/grants/">Стипендии и гранты</a> <a class="menu__link" href="/international-activity/russiansummerschool/">Летняя школа русского языка и культуры в Финансовом университете</a> <a class="menu__link" href="/international-activity/exchange/">Программы обмена (для иностранных студентов)</a> <a class="menu__link" href="/international-activity/help/">Справки и транскрипт</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Выпускникам</h4> <a class="menu__link" href="/international-activity/european/">Приложение к диплому</a> <a class="menu__link" href="/international-activity/diplom/">Подтверждение диплома за рубежом</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Преподавателям</h4> <a class="menu__link" href="/international-activity/projects/">Международные проекты</a> <a class="menu__link" href="/international-activity/abroad/">Академическая мобильность работников и командирование за рубеж</a> <a class="menu__link" href="/international-activity/professor/">Программа «Приглашенный профессор»</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Партнерам</h4> <a class="menu__link" href="/international-activity/partnership/">Зарубежное партнерство</a> <a class="menu__link" href="https://www.fa.ru/international-activity/associations/">Международные ассоциации и сетевые университеты</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/employee/"><span class="text-h3 text-contrast">Работникам и соискателям</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/employee/vacancy/">Вакансии и конкурсы НПР</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Корпоративное обучение</a> <a class="menu__link" href="/employee/couching/">Наставничество</a> <a class="menu__link" href="/university/epb/82">Документы по управлению персоналом и работе с кадрами</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> <a class="menu__link" href="https://www.fa.ru/university/employee/">Наши работники</a> </div> <div class="menu__links"> </div> </div> <div class="menu__links-column"> <div class="menu__links"> </div> </div> </div> </div> </div> </div> <!-- /Главное меню --> </div> <!-- Наши сайты --> <div class="menu-sites" id="js-menu-sites"> <div class="menu-sites__backdrop js-menu-sites"></div> <div class="menu-sites__wrapper"> <div class="container"> <div class="menu-sites__inner js-menu-sites__content-wrapper"><button class="ui-icon-button _secondary menu-sites__button" id="js-menu-sites-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-20"> <use href="/local/templates/main/sprite.svg#close-20"></use> </svg></button> <div class="ui-tabs js-tabs"> <div class="ui-tabs__control js-tabs-control"> <button class="ui-tab" type="button" data-index="0"><span class="ui-tab__label">Филиалы</span></button> <button class="ui-tab" type="button" data-index="1"><span class="ui-tab__label">Колледжи Москвы</span></button> <button class="ui-tab" type="button" data-index="2"><span class="ui-tab__label">Ресурсы университета</span></button> <button class="ui-tab" type="button" data-index="3"><span class="ui-tab__label">Подразделения</span></button> <button class="ui-tab" type="button" data-index="4"><span class="ui-tab__label">Дополнительное образование</span></button> </div> <div class="ui-tabs__content js-tabs-content"> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://altai.fa.ru/" target="_blank"> <span class="ui-links__link">Алтайский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladik.fa.ru/" target="_blank"> <span class="ui-links__link">Владикавказский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladimir.fa.ru/" target="_blank"> <span class="ui-links__link">Владимирский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kaluga.fa.ru/" target="_blank"> <span class="ui-links__link">Калужский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnodar.fa.ru/" target="_blank"> <span class="ui-links__link">Краснодарский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kursk.fa.ru/" target="_blank"> <span class="ui-links__link">Курский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lipetsk.fa.ru/" target="_blank"> <span class="ui-links__link">Липецкий филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://novoross.fa.ru/" target="_blank"> <span class="ui-links__link">Новороссийский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://omsk.fa.ru/" target="_blank"> <span class="ui-links__link">Омский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://orel.fa.ru/" target="_blank"> <span class="ui-links__link">Орловский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://penza.fa.ru/" target="_blank"> <span class="ui-links__link">Пензенский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://spb.fa.ru/" target="_blank"> <span class="ui-links__link">Санкт-Петербургский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://smolensk.fa.ru/" target="_blank"> <span class="ui-links__link">Смоленский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://tula.fa.ru/" target="_blank"> <span class="ui-links__link">Тульский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://chelyabinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Уральский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://ufa.fa.ru/" target="_blank"> <span class="ui-links__link">Уфимский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://yaroslavl.fa.ru/" target="_blank"> <span class="ui-links__link">Ярославский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://blagov.fa.ru/" target="_blank"> <span class="ui-links__link">Благовещенский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://buzuluk.fa.ru/" target="_blank"> <span class="ui-links__link">Бузулукский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://zvenigorod.fa.ru/" target="_blank"> <span class="ui-links__link">Звенигородский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kanash.fa.ru/" target="_blank"> <span class="ui-links__link">Канашский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnoyarsk.fa.ru/" target="_blank"> <span class="ui-links__link">Красноярский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mahachkala.fa.ru/" target="_blank"> <span class="ui-links__link">Махачкалинский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://perm.fa.ru/" target="_blank"> <span class="ui-links__link">Пермский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://samara.fa.ru/" target="_blank"> <span class="ui-links__link">Самарский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://surgut.fa.ru/" target="_blank"> <span class="ui-links__link">Сургутский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://shadrinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Шадринский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kip.fa.ru" target="_blank"> <span class="ui-links__link">Колледж информатики и программирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mfc.fa.ru" target="_blank"> <span class="ui-links__link">Московский финансовый колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://anketa.fa.ru/" target="_blank"> <span class="ui-links__link">Личный кабинет поступающего / слушателя</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://podku.fa.ru/" target="_blank"> <span class="ui-links__link">Подготовительные курсы Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://org.fa.ru/app/kk/dpp/programs" target="_blank"> <span class="ui-links__link">Корпоративное обучение</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pay.fa.ru" target="_blank"> <span class="ui-links__link">Все ссылки на оплату, Москва и филиалы</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://forum.fa.ru/" target="_blank"> <span class="ui-links__link">Международный форум Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://edu.fa.ru/" target="_blank"> <span class="ui-links__link">Дополнительное образование</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://business.fa.ru/" target="_blank"> <span class="ui-links__link">Предпринимательский клуб Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pirsocenter.ru/foresight2025" target="_blank"> <span class="ui-links__link">Форсайт образования</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lesnoe.fa.ru/" target="_blank"> <span class="ui-links__link">Учебно-оздоровительный комплекс «Лесное озеро»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://career.fa.ru/" target="_blank"> <span class="ui-links__link">Центр карьеры</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://online.fa.ru" target="_blank"> <span class="ui-links__link">Открытая онлайн-академия</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsgz/" target="_blank"> <span class="ui-links__link">Высшая школа государственных закупок</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsl/" target="_blank"> <span class="ui-links__link">Высшая школа логистики</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsmt/" target="_blank"> <span class="ui-links__link">Высшая школа менеджмента и технологий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsugmf/" target="_blank"> <span class="ui-links__link">Высшая школа управления государственными и муниципальными финансами</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ipk/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации и профессиональной переподготовки работников</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/irpkk/" target="_blank"> <span class="ui-links__link">Институт развития профессиональных компетенций и квалификаций</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifm/" target="_blank"> <span class="ui-links__link">Институт финансового менеджмента</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifg/" target="_blank"> <span class="ui-links__link">Институт финансовой грамотности</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/msb/" target="_blank"> <span class="ui-links__link">Международная школа бизнеса (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/business-school/" target="_blank"> <span class="ui-links__link">Бизнес-школа Финуниверситета (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/vsp/" target="_blank"> <span class="ui-links__link">Высшая школа предпринимательства</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/ipks/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации специалистов</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/nna/" target="_blank"> <span class="ui-links__link">Кафедра налогов и налогового администрирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/educational-departments/dep/dapk/ciys/" target="_blank"> <span class="ui-links__link">Центр инновационных образовательных и языковых стратегий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/meo/iymk/" target="_blank"> <span class="ui-links__link">Кафедра иностранных языков и межкультурной коммуникации</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/vsu/gcp/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Государственно-частное партнерство»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/ff/izkifi/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Ипотечное жилищное кредитование и финансовые инструменты рынка недвижимости»</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /Наши сайты --> <main id="app"> <section class="app-hero _page-has-sidebar "> <div class="app-hero__image"><img src="/upload/constructor/f96/8qpvfkqmsgthl2a87twmz7udo8l66jaj.jpg" alt="Бухгалтерский учет, анализ и аудит" /></div> <div class="container app-hero__content"> <div class="breadcrumbs _contrast"><ol class="breadcrumbs__list" itemscope="itemscope" itemtype="https://schema.org/BreadcrumbList"> <li class="breadcrumbs__item" itemprop="itemListElement" itemscope="itemscope" itemtype="https://schema.org/ListItem"> <a href="/" itemprop="item">Главная</a> <meta itemprop="position" content="0" /> </li> <li class="breadcrumbs__item" itemprop="itemListElement" itemscope="itemscope" itemtype="https://schema.org/ListItem"> <a href="/for-applicants/" itemprop="item">Поступающим</a> <meta itemprop="position" content="1" /> </li> <li class="breadcrumbs__item" itemprop="itemListElement" itemscope="itemscope" itemtype="https://schema.org/ListItem"> <a href="/for-applicants/educational-programs/" itemprop="item">Каталог образовательных программ</a> <meta itemprop="position" content="2" /> </li> <li class="breadcrumbs__item" itemprop="itemListElement" itemscope="itemscope" itemtype="https://schema.org/ListItem"> <a href="/for-applicants/educational-programs/dpo/" itemprop="item">Дополнительное профессиональное образование</a> <meta itemprop="position" content="3" /> </li> <li class="breadcrumbs__item" itemprop="itemListElement" itemscope="itemscope" itemtype="https://schema.org/ListItem"> <a href="/for-applicants/educational-programs/dpo/byhuchet/" itemprop="item">Бухгалтерский учет, анализ и аудит</a> <meta itemprop="position" content="4" /> </li></ol><div class="breadcrumbs__mobile-button "><a class="ui-button _tertiary _contrast" href="/for-applicants/educational-programs/dpo/"><span class="ui-button__icon"><svg class="_icon-arrow-left-16"><use href="/local/templates/main/sprite.svg#arrow-left-16"></use></svg></span>Назад</a></div></div> <div class="app-hero__top _wide"> <h1>Бухгалтерский учет, анализ и аудит</h1> <p class="app-hero__faculty"> <a class="ui-button _tertiary _contrast _icon-arrow" href="/university/structure/dpo/ick/"> Институт цифровых компетенций <span class="ui-button__circle-wrapper"> <span class="ui-button__circle"></span> </span> <span class="ui-button__icon"> <svg class="_icon-arrow-up-right-16"> <use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use> </svg> </span> </a> </p> <div class="app-hero__code"><span>Профессиональной переподготовки</span></div> <div class="app-hero-details"> <div class="app-hero-details__item"> <span class="app-hero-details__label">Форма обучения</span> <div class="app-hero-details__text"> <span>очно-заочная с применением ДОТ</span> </div> </div> <div class="app-hero-details__item"> <span class="app-hero-details__label">Количество часов</span> <div class="app-hero-details__text"> <span>288</span> </div> </div> <div class="app-hero-details__item"> <span class="app-hero-details__label">Стоимость</span> <div class="app-hero-details__text"> <span>90 000 р.</span> </div> </div> </div> <div class="app-hero__actions"> <a class="ui-button _primary _contrast _icon-arrow" target="_blank" href="https://b24-ucyil7.bitrix24.site/crm_form_kge0f/?program=309">Подать заявку<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a> </div> </div> </div> </section> <div class="sidebar container js-sidebar"> <div class="sidebar__inner"><button class="sidebar__trigger _open js-sidebar__trigger"><span class="text-h4">Навигация по разделу</span><span class="sidebar__icon"><svg class="_icon-menu-16"><use href="/local/templates/main/sprite.svg#menu-16"></use></svg><svg class="_icon-close-16"><use href="/local/templates/main/sprite.svg#close-16"></use></svg></span></button> <div class="sidebar__content js-sidebar__content"> <div class="sidebar__content-inner"> <a class="sidebar__link" href="/university/structure/dpo/ick/slushatelyam/">Организация обучения</a> <a class="sidebar__link" href="/university/structure/dpo/ick#block-40465">Информация для поступающих</a> <a class="sidebar__link" href="/university/structure/dpo/ick#block-40476">Программы Института</a> <a class="sidebar__link" href="/university/structure/dpo/ick/raspisanie/">Расписание</a> </div> </div> </div> </div><div id="block-41904" class="container"> <section class="app-section _is-slim"> <div class="app-section__content"> <div class="text-content"> <p>Цель программы - формирование у слушателей профессиональных компетенций в сфере учетных, аналитических и контрольных процессов в целях обеспечения реализации оперативных и стратегических целей деятельности организации с получением права на ведение нового вида профессиональной деятельности в сфере бухгалтерского учета, анализа и аудита.</p> </div> </div> </section> </div><div class="container"> <section id="block-5230" class="app-section _gutter-md _is-slim"> <div class="app-section__content"> <div class="text-content"> <div class="accordions"> <div class="ui-accordion js-accordion"> <div class="ui-accordion__toggle js-accordion-toggle"> <h4 class="ui-accordion__title">Навыки и компетенции</h4> <button class="ui-accordion__button" type="button"><svg class="_icon-caret-down-16"> <use href="/local/templates/main/sprite.svg#caret-down-16"></use> </svg></button> </div> <div class="ui-accordion__content-wrapper js-accordion-content"> <div class="ui-accordion__content"> <div class="text-content"> <p></p><p></p><ul><li>Квалифицированное применение знаний и умений в области учетных, аналитических и контрольных процессов в организации</li><li>Практическое осуществление деятельности по поиску, выявлению, анализу, оценке и регистрации фактов финансово-хозяйственной деятельности</li><li>Использование на практике знаний и умений в деятельности по постоянному улучшению систем учета, управления и контроля в организации</li><li>Выявление и реализация возможностей улучшения учетных, аналитических и контрольных процессов в организации</li><li>Квалифицированное осуществление деятельности по организации корпоративной политики в области учета, анализа и аудита (контроля)</li></ul><p></p> </div> </div> </div> </div> </div> </div> </div> </section> </div><div id="block-5228" class="container"> <section class="app-section _gutter-none _is-slim"> <div class="app-section__content"> <div class="text-content"> <h3><strong>По окончании обучения вы получите:</strong><br></h3> </div> </div> </section> </div><div id="block-6386" class="container"> <section class="app-section _gutter-sm _is-slim"> <div class="app-section__content"> <div class="text-content"> <h4><br>- Диплом Финансового университета при Правительстве РФ</h4><p><img src="/upload/constructor/ad8/xid10vy0ml1lk6rc5f0f5ig446e6r93j.png" data-mce-src="/upload/constructor/ad8/xid10vy0ml1lk6rc5f0f5ig446e6r93j.png" width="498" height="236"></p> </div> </div> </section> </div><div class="container"> <section id="block-5231" class="app-section _gutter-md _is-slim"> <div class="app-section__head"> <div class="app-section__head-wrapper"> <h2 id="about">Структура программы</h2> </div> </div> <div class="app-section__content"> <div class="text-content"> <p></p><p></p> <div class="accordions"> <div class="ui-accordion js-accordion"> <div class="ui-accordion__toggle js-accordion-toggle"> <h4 class="ui-accordion__title">Модуль 1. «Основы бухгалтерского учета и отчетности»</h4> <button class="ui-accordion__button" type="button"><svg class="_icon-caret-down-16"> <use href="/local/templates/main/sprite.svg#caret-down-16"></use> </svg></button> </div> <div class="ui-accordion__content-wrapper js-accordion-content"> <div class="ui-accordion__content"> <div class="text-content"> <p>Тема 1.1. Основные принципы организации и ведения бухгалтерского учета<br>Тема 1.2. Предмет, объекты и метод БУ<br>Тема 1.3. Баланс, счета и двойная запись. Типы фактов хозяйственной жизни, влияющих на валюту баланса<br>Тема 1.4. Принципы построения схем бухгалтерских проводок<br>Тема 1.5. Учет внеоборотных активов<br>Тема 1.6. Учет запасов<br>Тема 1.7. Учет затрат на оплату труда<br>Тема 1.8. Учет затрат на производство и выпуск продукции<br>Тема 1.9. Учет денежных средств<br>Тема 1.10. Учет расчетов<br>Тема 1.11. Учет финансовых вложений<br>Тема 1.12. Учет финансовых результатов<br>Тема 1.13. Учет собственного капитала<br>Тема 1.14. Бухгалтерская (финансовая) отчетность</p> </div> </div> </div> </div> <div class="ui-accordion js-accordion"> <div class="ui-accordion__toggle js-accordion-toggle"> <h4 class="ui-accordion__title">Модуль 2. «Анализ деятельности экономических субъектов»</h4> <button class="ui-accordion__button" type="button"><svg class="_icon-caret-down-16"> <use href="/local/templates/main/sprite.svg#caret-down-16"></use> </svg></button> </div> <div class="ui-accordion__content-wrapper js-accordion-content"> <div class="ui-accordion__content"> <div class="text-content"> <p>Тема 2.1. Экономический анализ в условиях динамично изменяющейся внешней и внутренней бизнес-среды<br>Тема 2.2. Инструментарий анализа деятельности экономического субъекта<br>Тема 2.3. Анализ качества системы управления устойчиво развивающейся компании<br>Тема 2.4. Поиск, выявление и анализ проблем бизнеса<br>Тема 2.5. Анализ сбалансированности активов и источников финансирования деятельности экономического субъекта<br>Тема 2.6. Анализ финансовых результатов деятельности экономического субъекта как критерия устойчивости<br>Тема 2.7. Комплексная диагностика качества деятельности экономического субъекта</p> </div> </div> </div> </div> <div class="ui-accordion js-accordion"> <div class="ui-accordion__toggle js-accordion-toggle"> <h4 class="ui-accordion__title">Модуль 3. «Основы внутреннего и внешнего аудита (контроля)»</h4> <button class="ui-accordion__button" type="button"><svg class="_icon-caret-down-16"> <use href="/local/templates/main/sprite.svg#caret-down-16"></use> </svg></button> </div> <div class="ui-accordion__content-wrapper js-accordion-content"> <div class="ui-accordion__content"> <div class="text-content"> <p>Тема 3.1. Общие положения по внешнему и внутреннему аудиту<br>Тема 3.2. Внутренний аудит в системе управления организацией<br>Тема 3.3. Организация и направления деятельности службы внутреннего аудита</p><p><br></p><p></p><p></p> </div> </div> </div> </div> </div> </div> </div> </section> </div><div class="container"> <section id="block-5232" class="app-section _gutter-md _is-slim"> <div class="app-section__head"> <div class="app-section__head-wrapper"> <h3>Документы</h3> </div> </div> <div class="app-section__content"> <article class="document-card"> <div class="document-card__wrapper"> <a class="document-card__text" href="/upload/constructor/db3/6cmvxy3yvx99uc4a0kag1m1xn3fevbxr.pdf" target="_blank">Учебный план программы</a></div><span class="document-card__label">PDF</span> </article> </div> </section> </div> <div class="container"> <section id="block-5233" class="app-section _gutter-sm"> <div class="app-section__head"> <div class="app-section__head-wrapper"> <h2>Преподавательский состав</h2> </div> </div> <div class="app-section__content"> <div class="app-grid _cols-3" style="--cols:3;--cols-md:1;--cols-sm:1;--gap:3.2rem;--gap-md:3.2rem;--gap-sm:2rem;"> <article class="person-card"> <div class="person-card__img"><img src="/upload/constructor/eba/z4rcy8iq7afdwrxghua2imwymkhrxiwp.png" alt="Хакимова Ольга Михайловна" loading="lazy" /></div> <div class="person-card__main"> <div class="person-card__wrapper"> <h3>Хакимова Ольга Михайловна</h3> <p class="person-card__post"></p> </div> </div> </article> </div> </div> </section> </div> <div id="block-5234" class="container"> <section class="app-section _gutter-none "> <div class="app-section__content"> <div class="text-content"> <p><span contenteditable="false" data-mce-object="iframe" class="mce-preview-object mce-object-iframe" data-mce-p-allowfullscreen="allowfullscreen" data-mce-p-mozallowfullscreen="mozallowfullscreen" data-mce-p-webkitallowfullscreen="webkitallowfullscreen" data-mce-p-allow="clipboard-write; autoplay" data-mce-p-frameborder="0" data-mce-p-src="https://rutube.ru/play/embed/08a73083c405db8a6768648444562230/"><iframe width="720" height="405" src="https://rutube.ru/play/embed/08a73083c405db8a6768648444562230/" allowfullscreen="allowfullscreen" frameborder="0"></iframe><span class="mce-shim"></span></span></p> </div> </div> </section> </div> <div class="container"> <section id="block-5235" class="app-section "> <div class="app-section__content"> <article class="contacts-card app-card"> <div class="ui-tabs js-tabs"> <div class="ui-tabs__control js-tabs-control"> <button class="ui-tab" type="button" data-index="0"><span class="ui-tab__label">Контакты</span></button> </div> <div class="ui-tabs__content js-tabs-content"> <div> <div class="contacts-card__info"> <div class="contacts-card__item"> <div class="ui-links"><span class="ui-links__label">Телефоны</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 (499) 553-10-31">+7 (499) 553-10-31</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 (925) 025-94-00">+7 (925) 025-94-00</a></div> </div><span class="ui-links__subtext"></span> </div> <div class="contacts-card__item"> <div class="ui-links"> <div class="ui-links__label">Адрес</div> <address> <span class="ui-links__link">г. Москва, ул. Олеко Дундича, дом 23, корпус 1, офис А307-310</span> </address> </div> </div> <div class="contacts-card__item"> <div class="ui-links"><span class="ui-links__label">E-mail</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:dpo@fa.ru">dpo@fa.ru</a></div> </div> </div> <div class="contacts-card__item _socials"><span class="contacts-card__label">Социальные сети</span> <div class="contacts-card__socials"> <a class="ui-icon-button _social _contrast" href="https://t.me/ick_fa" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-tg-16"> <use href="/local/templates/main/sprite.svg#social-tg-16"></use> </svg></a> <a class="ui-icon-button _social _contrast" href="https://vk.com/dpofa_ru" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-vk-16"> <use href="/local/templates/main/sprite.svg#social-vk-16"></use> </svg></a> </div> </div> </div> </div> </div> </div> </article> </div> </section> </div> </main> <div class="filter-popup" id="date-filter-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-block-response.html" hx-trigger="submit delay:300ms" hx-target="#event-block"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-events-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-response.html" hx-trigger="submit delay:300ms" hx-target="#events"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use /local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-year-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать год</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter" data-year="data-year"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/project-block-response.html" hx-trigger="submit delay:300ms" hx-target="#project-block"> <div class="datepicker js-datepicker-filter _filter"><input name="year" placeholder="Выбрать год" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button _year"><input type="radio" checked="checked" name="filter" value="all" /><label>Все<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="research" /><label>Научные исследования<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="development" /><label>Разработки<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="container"> <div class="button-up"><button class="ui-button _tertiary" id="js-scroll-to-top-button">Наверх<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-16"><use href="/local/templates/main/sprite.svg#arrow-up-16"></use></svg></span></button></div> </div> <!-- Useful-links block --> <div class="useful-links js-useful-links"><button class="useful-links__trigger js-useful-links__trigger"><span class="container"><span class="useful-links__trigger-inner"><span class="useful-links__label">Полезные ссылки</span><span class="useful-links__icon"><svg class="_icon-caret-down-16"><use href="/local/templates/main/sprite.svg#caret-down-16"></use></svg></span></span></span></button> <div class="container"> <div class="useful-links__content js-useful-links__content"> <div class="useful-links__content-inner"> <a class="useful-links__link" target="_blank" href="https://edu.fa.ru/">Информационно-образовательный портал</a> <a class="useful-links__link" target="_blank" href="https://anketa.fa.ru/">Личный кабинет поступающего</a> <a class="useful-links__link" target="_blank" href="http://www.library.fa.ru/">Библиотечно-информационный комплекс</a> <a class="useful-links__link" target="_blank" href="https://pay.fa.ru/moscow/">Оплата обучения</a> <a class="useful-links__link" target="_blank" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="useful-links__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="useful-links__link" href="/university/contacts/">Официальный адрес электронной почты</a> <a class="useful-links__link" href="/university/structure/university/sitp/">ИТ-поддержка</a> <a class="useful-links__link" target="_blank" href="https://edu.gov.ru/">Министерство просвещения РФ</a> <a class="useful-links__link" target="_blank" href="https://minobrnauki.gov.ru/">Министерство науки и высшего образования РФ</a> </div> </div> </div> </div> <!-- End useful-links block --> <footer class="footer"> <div class="container"> <div class="app-grid _cols-1" style="--cols:1;--cols-md:1;--cols-sm:1;--gap:4rem;--gap-md:4rem;--gap-sm:2.4rem;"> <div class="footer__top-section flex justify-between items-center"> <div class="footer__logo"> <svg class="_icon-logo"> <use href="/local/templates/main/sprite.svg#logo"></use> </svg> </div> </div> <div class="footer__section"> <!-- footer address --> <div class="footer__address"><span class="text-body-small">Адрес университета</span><b class="text-body-bold">125167, Москва, пр-кт Ленинградский, д. 49/2</b> <p class="text-body-small">По вопросам, касающимся проведения съемок на территории Финансового университета, присылайте свой запрос в письменном виде в <a href="https://www.fa.ru/university/structure/university/uso/press-service/" style="color:#FFFFFF;">Пресс-службу</a> университета по электронной почте pressa@fa.ru</p> </div> <!-- End footer address --> <!-- footer menu block --> <div class="footer__links-grid hidden-sm"> <a class="footer__link text-button" href="/university/">Университет</a> <a class="footer__link text-button" href="/for-applicants/">Поступающим</a> <a class="footer__link text-button" href="/for-students/">Студентам</a> <a class="footer__link text-button" href="/graduate/">Выпускникам</a> <a class="footer__link text-button" href="/dpo/">Дополнительное образование</a> <a class="footer__link text-button" href="/science/">Наука</a> <a class="footer__link text-button" href="/employee">Работникам и соискателям</a> <a class="footer__link text-button" href="/international-activity/">Международная деятельность</a> <a class="footer__link text-button" href="/university/branches">Филиалы</a> <a class="footer__link text-button" href="/university/services/">Сервисы</a> <a class="footer__link text-button" href="/university/anticorruption/">Противодействие коррупции</a> <a class="footer__link text-button" href="/sveden/">Сведения об образовательной организации</a> <a class="footer__link text-button" target="_blank" href="https://org.fa.ru/">Личный кабинет</a> <a class="footer__link text-button" target="_blank" href="https://lesnoe.fa.ru">Учебно-оздоровительный комплекс «Лесное озеро»</a> <a class="footer__link text-button" href="/university/project/">Проектная деятельность</a> <a class="footer__link text-button" target="_blank" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="footer__link text-button" href="/university/campuscard/">Кампусная карта</a> <a class="footer__link text-button" href="/university/contacts/">Контакты</a> <a class="footer__link text-button" href="/university/structure/university/uso/adogokouo/">Анкета для опроса граждан о качестве оказания услуг организацией</a> <a class="footer__link text-button" target="_blank" href="https://endowmentfa.ru/donate">Стать дарителем</a> </div> <!-- End footer block --> </div> <div class="footer__section"> <!-- socials block --> <div class="footer__socials flex gap-8"> <a class="ui-icon-button _secondary _contrast" href="https://t.me/s/finuniverchan" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-tg-20"> <use href="/local/templates/main/sprite.svg#social-tg-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://vk.com/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-vk-20"> <use href="/local/templates/main/sprite.svg#social-vk-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://max.ru/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-max-20"> <use href="/local/templates/main/sprite.svg#social-max-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://www.youtube.com/channel/UChitH8STbXi2HyYTqXnHSnw" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-youtube-20"> <use href="/local/templates/main/sprite.svg#social-youtube-20"></use> </svg> </a> </div> <!-- socials block --> <!-- contacts block --> <div class="app-grid _cols-3" style="--cols:3;--cols-md:3;--cols-sm:1;--gap:3.2rem;--gap-md:3.2rem;--gap-sm:2.4rem;"> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная комиссия</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(495)249-52-49">+7(495)249-52-49</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:priemka@fa.ru">priemka@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Официальный адрес электронной почты</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:"></a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:academy@fa.ru">academy@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная ректора</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(499)943-95-80">+7(499)943-95-80</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:rector@fa.ru">rector@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Для справок по корреспонденции</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 499 943 98 55">+7 499 943 98 55</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:"></a></div> </div> </div> <!-- contacts block --> </div> </div> </div> </footer> <script src="/local/templates/main/js/app.js?1763707713" defer=""></script> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(98905690, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98905690" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(99165694, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/99165694" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(102224032, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/102224032" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103033693, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103033693" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241759, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241759" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241988, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241988" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103325236, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103325236" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript"> (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) })(window, document,'script','https://mc.yandex.ru/metrika/tag.js', 'ym'); ym(98069295, 'init', {webvisor:true, clickmap:true, accurateTrackBounce:true, trackLinks:true}); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98069295" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> </body> </html>Evidence 6768648444562230Solution Check the response for the potential presence of personally identifiable information (PII), ensure nothing sensitive is leaked by the application.
-
-
-
Risk=Высокий, Confidence=Средний (1)
-
https://www.fa.ru (1)
-
Уязвимость JS Библиотеки (Library) (1)
GET https://www.fa.ru/local/templates/main/js/app.js?1763707713
Alert tags Alert description The identified library appears to be vulnerable.
Other info The identified library axios, version 1.6.5 is vulnerable.
CVE-2024-39338
https://github.com/advisories/GHSA-8hc4-vh64-cxmj
https://github.com/axios/axios
https://github.com/axios/axios/pull/6300
https://github.com/axios/axios/issues/6463
https://github.com/axios/axios/pull/6543
https://github.com/axios/axios/releases
https://github.com/axios/axios/releases/tag/v1.7.4
https://github.com/axios/axios/pull/6539
https://jeffhacks.com/advisories/2024/06/24/CVE-2024-39338.html
https://github.com/axios/axios/commit/6b6b605eaf73852fb2dae033f1e786155959de3a
https://nvd.nist.gov/vuln/detail/CVE-2024-39338
Request Request line and header section (353 bytes)
GET https://www.fa.ru/local/templates/main/js/app.js?1763707713 HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/*/index.php Cookie: PHPSESSID=oCX2ps2NH14fMhkZK3JIqxyZZOkiKPNjRequest body (0 bytes)
Response Status line and header section (493 bytes)
HTTP/1.1 200 OK Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:12:13 GMT Content-Type: application/javascript Content-Length: 2429397 Connection: keep-alive Keep-Alive: timeout=10 Vary: Accept-Encoding X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN ETag: "69200b41-2511d5" Last-Modified: Fri, 21 Nov 2025 06:48:33 GMT Accept-Ranges: bytes Expires: Tue, 16 Dec 2025 11:12:13 GMT Vary: Accept-Encoding Cache-Control: max-age=3600 Cache-Control: public, immutableResponse body (2429397 bytes)
/*! For license information please see app.js.LICENSE.txt */ (function(){var __webpack_modules__={8021:function(t){t.exports=function(){"use strict";var t={d:function(e,i){for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};t.d(e,{default:function(){return U}});var i={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},n={classes:"",inline:!1,locale:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],daysShort:["Вос","Пон","Вто","Сре","Чет","Пят","Суб"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:i.days,minView:i.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function r(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return"string"==typeof t?e.querySelector(t):t}function s(){let{tagName:t="div",className:e="",innerHtml:i="",id:n="",attrs:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=document.createElement(t);return e&&s.classList.add(...e.split(" ")),n&&(s.id=n),i&&(s.innerHTML=i),r&&o(s,r),s}function o(t,e){for(let[i,n]of Object.entries(e))void 0!==n&&t.setAttribute(i,n);return t}function a(t){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function l(t){let e=t.getHours(),{hours:i,dayPeriod:n}=c(e);return{year:t.getFullYear(),month:t.getMonth(),fullMonth:t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,date:t.getDate(),fullDate:t.getDate()<10?"0"+t.getDate():t.getDate(),day:t.getDay(),hours:e,fullHours:h(e),hours12:i,dayPeriod:n,fullHours12:h(i),minutes:t.getMinutes(),fullMinutes:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}}function c(t){return{dayPeriod:t>11?"pm":"am",hours:t%12==0?12:t%12}}function h(t){return t<10?"0"+t:t}function u(t){let e=10*Math.floor(t.getFullYear()/10);return[e,e+9]}function d(){let t=[];for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.forEach((e=>{if("object"==typeof e)for(let i in e)e[i]&&t.push(i);else e&&t.push(e)})),t.join(" ")}function p(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.days;if(!t||!e)return!1;let r=l(t),s=l(e);return{[i.days]:r.date===s.date&&r.month===s.month&&r.year===s.year,[i.months]:r.month===s.month&&r.year===s.year,[i.years]:r.year===s.year}[n]}function f(t,e,i){let n=g(t,!1).getTime(),r=g(e,!1).getTime();return i?n>=r:n>r}function m(t,e){return!f(t,e,!0)}function g(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=new Date(t.getTime());return"boolean"!=typeof e||e||function(t){t.setHours(0,0,0,0)}(i),i}function _(t,e,i){t.length?t.forEach((t=>{t.addEventListener(e,i)})):t.addEventListener(e,i)}function y(t,e){return!(!t||t===document||t instanceof DocumentFragment)&&(t.matches(e)?t:y(t.parentNode,e))}function v(t,e,i){return t>i?i:t<e?e:t}function b(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.filter((t=>t)).forEach((e=>{for(let[i,n]of Object.entries(e))if(void 0!==n&&"[object Object]"===n.toString()){let e=void 0!==t[i]?t[i].toString():void 0,r=n.toString(),s=Array.isArray(n)?[]:{};t[i]=t[i]?e!==r?s:t[i]:s,b(t[i],n)}else t[i]=n})),t}function x(t){let e=t;return t instanceof Date||(e=new Date(t)),isNaN(e.getTime())&&(console.log(`Unable to convert value "${t}" to Date object`),e=!1),e}function w(t){let e="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+e+")("+t+")($|<|"+e+")","g")}function E(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class S{constructor(){let{type:t,date:e,dp:i,opts:n,body:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};E(this,"focus",(()=>{this.$cell.classList.add("-focus-"),this.focused=!0})),E(this,"removeFocus",(()=>{this.$cell.classList.remove("-focus-"),this.focused=!1})),E(this,"select",(()=>{this.$cell.classList.add("-selected-"),this.selected=!0})),E(this,"removeSelect",(()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1})),E(this,"onChangeSelectedDate",(()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())})),E(this,"onChangeFocusDate",(t=>{if(!t)return void(this.focused&&this.removeFocus());let e=p(t,this.date,this.type);e?this.focus():!e&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()})),E(this,"render",(()=>(this.$cell.innerHTML=this._getHtml(),this.$cell.adpCell=this,this.$cell))),this.type=t,this.singleType=this.type.slice(0,-1),this.date=e,this.dp=i,this.opts=n,this.body=r,this.customData=!1,this.init()}init(){let{range:t,onRenderCell:e}=this.opts;e&&(this.customData=e({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),t&&this._handleRangeStatus())}_bindDatepickerEvents(){this.dp.on(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(i.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(i.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var t;let{year:e,month:i,date:n}=l(this.date),r=(null===(t=this.customData)||void 0===t?void 0:t.attrs)||{};this.$cell=s({className:this._getClassName(),attrs:{"data-year":e,"data-month":i,"data-date":n,...r}})}_getClassName(){var t,e;let n=new Date,{selectOtherMonths:r,selectOtherYears:s}=this.opts,{minDate:o,maxDate:a}=this.dp,{day:c}=l(this.date),h=this._isOutOfMinMaxRange(),u=null===(t=this.customData)||void 0===t?void 0:t.disabled,f=d("air-datepicker-cell",`-${this.singleType}-`,{"-current-":p(n,this.date,this.type),"-min-date-":o&&p(o,this.date,this.type),"-max-date-":a&&p(a,this.date,this.type)}),m="";switch(this.type){case i.days:m=d({"-weekend-":this.dp.isWeekend(c),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!r||h||u});break;case i.months:m=d({"-disabled-":h||u});break;case i.years:m=d({"-other-decade-":this.isOtherDecade,"-disabled-":h||this.isOtherDecade&&!s||u})}return d(f,m,null===(e=this.customData)||void 0===e?void 0:e.classes)}_getHtml(){var t;let{year:e,month:n,date:r}=l(this.date),{showOtherMonths:s,showOtherYears:o}=this.opts;if(null!==(t=this.customData)&&void 0!==t&&t.html)return this.customData.html;switch(this.type){case i.days:return!s&&this.isOtherMonth?"":r;case i.months:return this.dp.locale[this.opts.monthsField][n];case i.years:return!o&&this.isOtherDecade?"":e}}_isOutOfMinMaxRange(){let{minDate:t,maxDate:e}=this.dp,{type:n,date:r}=this,{month:s,year:o,date:a}=l(r),c=n===i.days,h=n===i.years,u=!!t&&new Date(o,h?t.getMonth():s,c?a:t.getDate()),d=!!e&&new Date(o,h?e.getMonth():s,c?a:e.getDate());return t&&e?m(u,t)||f(d,e):t?m(u,t):e?f(d,e):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){let{rangeDateFrom:t,rangeDateTo:e}=this.dp,i=d({"-in-range-":t&&e&&(n=this.date,r=t,s=e,f(n,r)&&m(n,s)),"-range-from-":t&&p(this.date,t,this.type),"-range-to-":e&&p(this.date,e,this.type)});var n,r,s;this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),i&&this.$cell.classList.add(...i.split(" "))}_handleSelectedStatus(){let t=this.dp._checkIfDateIsSelected(this.date,this.type);t?this.select():!t&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){p(this.dp.focusDate,this.date,this.type)&&this.focus()}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function T(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let M={[i.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${i.days}-"></div>`,[i.months]:`<div class="air-datepicker-body--cells -${i.months}-"></div>`,[i.years]:`<div class="air-datepicker-body--cells -${i.years}-"></div>`};const A=".air-datepicker-cell";class C{constructor(t){let{dp:e,type:n,opts:r}=t;T(this,"handleClick",(t=>{let e=t.target.closest(A).adpCell;if(e.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let i=this.dp._checkIfDateIsSelected(e.date,e.type);i?this.dp._handleAlreadySelectedDates(i,e.date):this.dp.selectDate(e.date)})),T(this,"handleDayNameClick",(t=>{let e=t.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(e),datepicker:this.dp})})),T(this,"onChangeCurrentView",(t=>{t!==this.type?this.hide():(this.show(),this.render())})),T(this,"onMouseOverCell",(t=>{let e=y(t.target,A);this.dp.setFocusDate(!!e&&e.adpCell.date)})),T(this,"onMouseOutCell",(()=>{this.dp.setFocusDate(!1)})),T(this,"onClickBody",(t=>{let{onClickDayName:e}=this.opts,i=t.target;i.closest(A)&&this.handleClick(t),e&&i.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(t)})),T(this,"onMouseDown",(t=>{this.pressed=!0;let e=y(t.target,A),i=e&&e.adpCell;p(i.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),p(i.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)})),T(this,"onMouseMove",(t=>{if(!this.pressed||!this.dp.isMinViewReached)return;t.preventDefault();let e=y(t.target,A),i=e&&e.adpCell,{selectedDates:n,rangeDateTo:r,rangeDateFrom:s}=this.dp;if(!i||i.isDisabled)return;let{date:o}=i;if(2===n.length){if(this.rangeFromFocused&&!f(o,r)){let{hours:t,minutes:e}=l(s);o.setHours(t),o.setMinutes(e),this.dp.rangeDateFrom=o,this.dp.replaceDate(s,o)}if(this.rangeToFocused&&!m(o,s)){let{hours:t,minutes:e}=l(r);o.setHours(t),o.setMinutes(e),this.dp.rangeDateTo=o,this.dp.replaceDate(r,o)}}})),T(this,"onMouseUp",(()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1})),T(this,"onChangeViewDate",((t,e)=>{if(!this.isVisible)return;let n=u(t),r=u(e);switch(this.dp.currentView){case i.days:if(p(t,e,i.months))return;break;case i.months:if(p(t,e,i.years))return;break;case i.years:if(n[0]===r[0]&&n[1]===r[1])return}this.render()})),T(this,"render",(()=>{this.destroyCells(),this._generateCells(),this.cells.forEach((t=>{this.$cells.appendChild(t.render())}))})),this.dp=e,this.type=n,this.opts=r,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===i.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:t,dynamicRange:e}=this.opts;_(this.$el,"mouseover",this.onMouseOverCell),_(this.$el,"mouseout",this.onMouseOutCell),_(this.$el,"click",this.onClickBody),t&&e&&(_(this.$el,"mousedown",this.onMouseDown),_(this.$el,"mousemove",this.onMouseMove),_(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(i.eventChangeViewDate,this.onChangeViewDate),this.dp.on(i.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=s({className:`air-datepicker-body -${this.type}-`,innerHtml:M[this.type]}),this.$names=r(".air-datepicker-body--day-names",this.$el),this.$cells=r(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dp.locale.firstDay,e="",n=this.dp.isWeekend,{onClickDayName:r}=this.opts,s=t,o=0;for(;o<7;){let t=s%7;e+=`<div class="${d("air-datepicker-body--day-name",{[i.cssClassWeekend]:n(t),"-clickable-":!!r})}" data-day-index='${t}'>${this.dp.locale.daysMin[t]}</div>`,o++,s++}return e}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(t){let{type:e,dp:i,opts:n}=this;return new S({type:e,dp:i,opts:n,date:t,body:this})}_generateCells(){C.getDatesFunction(this.type)(this.dp,(t=>{this.cells.push(this._generateCell(t))}))}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach((t=>t.destroy())),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(i.eventChangeViewDate,this.onChangeViewDate),this.dp.off(i.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(t,e){let{viewDate:i,locale:{firstDay:n}}=t,r=a(i),{year:s,month:o}=l(i),c=new Date(s,o,1),h=new Date(s,o,r),u=c.getDay()-n,d=6-h.getDay()+n;u=u<0?u+7:u,d=d>6?d-7:d;let p=function(t,e){let{year:i,month:n,date:r}=l(t);return new Date(i,n,r-e)}(c,u),f=r+u+d,m=p.getDate(),{year:g,month:_}=l(p),y=0;const v=[];for(;y<f;){let t=new Date(g,_,m+y);e&&e(t),v.push(t),y++}return v}static getMonthsDates(t,e){let{year:i}=t.parsedViewDate,n=0,r=[];for(;n<12;){const t=new Date(i,n);r.push(t),e&&e(t),n++}return r}static getYearsDates(t,e){let i=u(t.viewDate),n=i[0]-1,r=i[1]+1,s=n,o=[];for(;s<=r;){const t=new Date(s,0);o.push(t),e&&e(t),s++}return o}static getDatesFunction(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.days;return{[i.days]:C.getDaysDates,[i.months]:C.getMonthsDates,[i.years]:C.getYearsDates}[t]}}function k(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class P{constructor(t){let{dp:e,opts:i}=t;k(this,"onClickNav",(t=>{let e=y(t.target,".air-datepicker-nav--action");if(!e)return;let i=e.dataset.action;this.dp[i]()})),k(this,"onChangeViewDate",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),k(this,"onChangeCurrentView",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),k(this,"onClickNavTitle",(()=>{this.dp.isFinalView||this.dp.up()})),k(this,"update",(()=>{let{prevHtml:t,nextHtml:e}=this.opts;this.$prev.innerHTML=t,this.$next.innerHTML=e,this._resetNavStatus(),this.render(),this.handleNavStatus()})),k(this,"renderDelay",(()=>{setTimeout(this.render)})),k(this,"render",(()=>{this.$title.innerHTML=this._getTitle(),function(t,e){for(let i in e)e[i]?t.classList.add(i):t.classList.remove(i)}(this.$title,{"-disabled-":this.dp.isFinalView})})),this.dp=e,this.opts=i,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=r(".air-datepicker-nav--title",this.$el),this.$prev=r('[data-action="prev"]',this.$el),this.$next=r('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(i.eventChangeViewDate,this.onChangeViewDate),this.dp.on(i.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(i.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(i.eventChangeTime,this.render))}destroy(){this.dp.off(i.eventChangeViewDate,this.onChangeViewDate),this.dp.off(i.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(i.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(i.eventChangeTime,this.render))}_createElement(){this.$el=s({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:t,opts:e}=this,i=e.navTitles[t.currentView];return"function"==typeof i?i(t):t.formatDate(t.viewDate,i)}handleNavStatus(){let{disableNavWhenOutOfRange:t}=this.opts,{minDate:e,maxDate:n}=this.dp;if(!e&&!n||!t)return;let{year:r,month:s}=this.dp.parsedViewDate,o=!!e&&l(e),a=!!n&&l(n);switch(this.dp.currentView){case i.days:e&&o.month>=s&&o.year>=r&&this._disableNav("prev"),n&&a.month<=s&&a.year<=r&&this._disableNav("next");break;case i.months:e&&o.year>=r&&this._disableNav("prev"),n&&a.year<=r&&this._disableNav("next");break;case i.years:{let t=u(this.dp.viewDate);e&&o.year>=t[0]&&this._disableNav("prev"),n&&a.year<=t[1]&&this._disableNav("next");break}}}_disableNav(t){r('[data-action="'+t+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){!function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];t.length?t.forEach((t=>{t.classList.remove(...i)})):t.classList.remove(...i)}(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:t,nextHtml:e}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${t}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${e}</div>`}get isNavIsFunction(){let{navTitles:t}=this.opts;return Object.keys(t).find((e=>"function"==typeof t[e]))}}var I={today:{content:t=>t.locale.today,onClick:t=>t.setViewDate(new Date)},clear:{content:t=>t.locale.clear,onClick:t=>t.clear()}};class D{constructor(t){let{dp:e,opts:i}=t;this.dp=e,this.opts=i,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=s({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:t}=this.opts;Array.isArray(t)||(t=[t]),t.forEach((t=>{let e=t;"string"==typeof t&&I[t]&&(e=I[t]);let i=this.createButton(e);e.onClick&&this.attachEventToButton(i,e.onClick),this.$el.appendChild(i)}))}attachEventToButton(t,e){t.addEventListener("click",(()=>{e(this.dp)}))}createButton(t){let{content:e,className:i,tagName:n="button",attrs:r={}}=t;return s({tagName:n,innerHtml:`<span tabindex='-1'>${"function"==typeof e?e(this.dp):e}</span>`,className:d("air-datepicker-button",i),attrs:r})}render(){this.generateButtons()}}function O(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class L{constructor(){let{opts:t,dp:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,"toggleTimepickerIsActive",(t=>{this.dp.timepickerIsActive=t})),O(this,"onChangeSelectedDate",(t=>{let{date:e,updateTime:i=!1}=t;e&&(this.setMinMaxTime(e),this.setCurrentTime(!!i&&e),this.addTimeToDate(e))})),O(this,"onChangeLastSelectedDate",(t=>{t&&(this.setTime(t),this.render())})),O(this,"onChangeInputRange",(t=>{let e=t.target;this[e.getAttribute("name")]=e.value,this.updateText(),this.dp.trigger(i.eventChangeTime,{hours:this.hours,minutes:this.minutes})})),O(this,"onMouseEnterLeave",(t=>{let e=t.target.getAttribute("name"),i=this.$minutesText;"hours"===e&&(i=this.$hoursText),i.classList.toggle("-focus-")})),O(this,"onFocus",(()=>{this.toggleTimepickerIsActive(!0)})),O(this,"onBlur",(()=>{this.toggleTimepickerIsActive(!1)})),this.opts=t,this.dp=e;let{timeFormat:n}=this.dp.locale;n&&(n.match(w("h"))||n.match(w("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(i.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let t="input";navigator.userAgent.match(/trident/gi)&&(t="change"),_(this.$ranges,t,this.onChangeInputRange),_(this.$ranges,"mouseenter",this.onMouseEnterLeave),_(this.$ranges,"mouseleave",this.onMouseEnterLeave),_(this.$ranges,"focus",this.onFocus),_(this.$ranges,"mousedown",this.onFocus),_(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=s({className:d("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(i.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:t,hours:e,displayHours:i,minutes:n,minHours:r,minMinutes:s,maxHours:o,maxMinutes:a,dayPeriod:l,opts:{hoursStep:c,minutesStep:u}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${h(i)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${h(n)}</span> `+(t?`<span class='air-datepicker-time--current-ampm'>${l}</span>`:"")+'</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row">'+` <input type="range" name="hours" value="${e}" min="${r}" max="${o}" step="${c}"/> </div> <div class="air-datepicker-time--row">`+` <input type="range" name="minutes" value="${n}" min="${s}" max="${a}" step="${u}"/> </div></div>`}defineDOM(){let t=t=>r(t,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=t('[name="hours"]'),this.$minutes=t('[name="minutes"]'),this.$hoursText=t(".air-datepicker-time--current-hours"),this.$minutesText=t(".air-datepicker-time--current-minutes"),this.$ampm=t(".air-datepicker-time--current-ampm")}setTime(t){this.setMinMaxTime(t),this.setCurrentTime(t)}addTimeToDate(t){t&&(t.setHours(this.hours),t.setMinutes(this.minutes))}setMinMaxTime(t){if(this.setMinMaxTimeFromOptions(),t){let{minDate:e,maxDate:i}=this.dp;e&&p(t,e)&&this.setMinTimeFromMinDate(e),i&&p(t,i)&&this.setMaxTimeFromMaxDate(i)}}setCurrentTime(t){let{hours:e,minutes:i}=t?l(t):this;this.hours=v(e,this.minHours,this.maxHours),this.minutes=v(i,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:t,minMinutes:e,maxHours:i,maxMinutes:n}=this.opts;this.minHours=v(t,0,23),this.minMinutes=v(e,0,59),this.maxHours=v(i,0,23),this.maxMinutes=v(n,0,59)}setMinTimeFromMinDate(t){let{lastSelectedDate:e}=this.dp;this.minHours=t.getHours(),e&&e.getHours()>t.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=t.getMinutes()}setMaxTimeFromMaxDate(t){let{lastSelectedDate:e}=this.dp;this.maxHours=t.getHours(),e&&e.getHours()<t.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=t.getMinutes()}updateSliders(){o(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,o(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=h(this.displayHours),this.$minutesText.innerHTML=h(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(t){this._hours=t;let{hours:e,dayPeriod:i}=c(t);this.displayHours=this.ampm?e:t,this.dayPeriod=i}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function z(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class R{constructor(t){let{dp:e,opts:i}=t;z(this,"pressedKeys",new Set),z(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],t=>t.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],t=>t.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],t=>t.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],t=>t.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],t=>t.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],t=>t.year-=10],[["Control","Shift","ArrowUp"],(t,e)=>e.up()]])),z(this,"handleHotKey",(t=>{let e=this.hotKeys.get(t),i=l(this.getInitialFocusDate());e(i,this.dp);let{year:n,month:r,date:s}=i,o=a(new Date(n,r));o<s&&(s=o);let c=this.dp.getClampedDate(new Date(n,r,s));this.dp.setFocusDate(c,{viewDateTransition:!0})})),z(this,"isHotKeyPressed",(()=>{let t=!1,e=this.pressedKeys.size,i=t=>this.pressedKeys.has(t);for(let[n]of this.hotKeys){if(t)break;if(Array.isArray(n[0]))n.forEach((r=>{t||e!==r.length||(t=r.every(i)&&n)}));else{if(e!==n.length)continue;t=n.every(i)&&n}}return t})),z(this,"isArrow",(t=>t>=37&&t<=40)),z(this,"onKeyDown",(t=>{let{key:e,which:i}=t,{dp:n,dp:{focusDate:r},opts:s}=this;this.registerKey(e);let o=this.isHotKeyPressed();if(o)return t.preventDefault(),void this.handleHotKey(o);if(this.isArrow(i))return t.preventDefault(),void this.focusNextCell(e);if("Enter"===e){if(n.currentView!==s.minView)return void n.down();if(r){let t=n._checkIfDateIsSelected(r);return void(t?n._handleAlreadySelectedDates(t,r):n.selectDate(r))}}"Escape"===e&&this.dp.hide()})),z(this,"onKeyUp",(t=>{this.removeKey(t.key)})),this.dp=e,this.opts=i,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:t}=this.dp;t.addEventListener("keydown",this.onKeyDown),t.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:t}=this.dp;t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:t,currentView:e,selectedDates:n,parsedViewDate:{year:r,month:s}}=this.dp,o=t||n[n.length-1];if(!o)switch(e){case i.days:o=new Date(r,s,(new Date).getDate());break;case i.months:o=new Date(r,s,1);break;case i.years:o=new Date(r,0,1)}return o}focusNextCell(t){let e=this.getInitialFocusDate(),{currentView:n}=this.dp,{days:r,months:s,years:o}=i,a=l(e),c=a.year,h=a.month,u=a.date;switch(t){case"ArrowLeft":n===r&&(u-=1),n===s&&(h-=1),n===o&&(c-=1);break;case"ArrowUp":n===r&&(u-=7),n===s&&(h-=3),n===o&&(c-=4);break;case"ArrowRight":n===r&&(u+=1),n===s&&(h+=1),n===o&&(c+=1);break;case"ArrowDown":n===r&&(u+=7),n===s&&(h+=3),n===o&&(c+=4)}let d=this.dp.getClampedDate(new Date(c,h,u));this.dp.setFocusDate(d,{viewDateTransition:!0})}registerKey(t){this.pressedKeys.add(t)}removeKey(t){this.pressedKeys.delete(t)}}let F={on(t,e){this.__events||(this.__events={}),this.__events[t]?this.__events[t].push(e):this.__events[t]=[e]},off(t,e){this.__events&&this.__events[t]&&(this.__events[t]=this.__events[t].filter((t=>t!==e)))},removeAllEvents(){this.__events={}},trigger(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];this.__events&&this.__events[t]&&this.__events[t].forEach((t=>{t(...i)}))}};function B(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let N="",j="",V=!1;class U{static buildGlobalContainer(t){V=!0,N=s({className:t,id:t}),r("body").appendChild(N)}constructor(t,e){var o=this;if(B(this,"viewIndexes",[i.days,i.months,i.years]),B(this,"next",(()=>{let{year:t,month:e}=this.parsedViewDate;switch(this.currentView){case i.days:this.setViewDate(new Date(t,e+1,1));break;case i.months:this.setViewDate(new Date(t+1,e,1));break;case i.years:this.setViewDate(new Date(t+10,0,1))}})),B(this,"prev",(()=>{let{year:t,month:e}=this.parsedViewDate;switch(this.currentView){case i.days:this.setViewDate(new Date(t,e-1,1));break;case i.months:this.setViewDate(new Date(t-1,e,1));break;case i.years:this.setViewDate(new Date(t-10,0,1))}})),B(this,"_finishHide",(()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)})),B(this,"setPosition",(function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("function"==typeof(t=t||o.opts.position))return void(o.customHide=t({$datepicker:o.$datepicker,$target:o.$el,$pointer:o.$pointer,isViewChange:e,done:o._finishHide}));let i,n,{isMobile:r}=o.opts,s=o.$el.getBoundingClientRect(),a=o.$el.getBoundingClientRect(),l=o.$datepicker.offsetParent,c=o.$el.offsetParent,h=o.$datepicker.getBoundingClientRect(),u=t.split(" "),d=window.scrollY,p=window.scrollX,f=o.opts.offset,m=u[0],g=u[1];if(r)o.$datepicker.style.cssText="left: 50%; top: 50%";else{if(l===c&&l!==document.body&&(a={top:o.$el.offsetTop,left:o.$el.offsetLeft,width:s.width,height:o.$el.offsetHeight},d=0,p=0),l!==c&&l!==document.body){let t=l.getBoundingClientRect();a={top:s.top-t.top,left:s.left-t.left,width:s.width,height:s.height},d=0,p=0}switch(m){case"top":i=a.top-h.height-f;break;case"right":n=a.left+a.width+f;break;case"bottom":i=a.top+a.height+f;break;case"left":n=a.left-h.width-f}switch(g){case"top":i=a.top;break;case"right":n=a.left+a.width-h.width;break;case"bottom":i=a.top+a.height-h.height;break;case"left":n=a.left;break;case"center":/left|right/.test(m)?i=a.top+a.height/2-h.height/2:n=a.left+a.width/2-h.width/2}o.$datepicker.style.cssText=`left: ${n+p}px; top: ${i+d}px`}})),B(this,"_setInputValue",(()=>{let{opts:t,$altField:e,locale:{dateFormat:i}}=this,{altFieldDateFormat:n,altField:r}=t;r&&e&&(e.value=this._getInputValue(n)),this.$el.value=this._getInputValue(i)})),B(this,"_getInputValue",(t=>{let{selectedDates:e,opts:i}=this,{multipleDates:n,multipleDatesSeparator:r}=i;if(!e.length)return"";let s="function"==typeof t,o=s?t(n?e:e[0]):e.map((e=>this.formatDate(e,t)));return o=s?o:o.join(r),o})),B(this,"_checkIfDateIsSelected",(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.days,n=!1;return o.selectedDates.some((i=>{let r=p(t,i,e);return n=r&&i,r})),n})),B(this,"_scheduleCallAfterTransition",(t=>{this._cancelScheduledCall(),t&&t(!1),this._onTransitionEnd=()=>{t&&t(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})})),B(this,"_cancelScheduledCall",(()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)})),B(this,"setViewDate",(t=>{if(!((t=x(t))instanceof Date))return;if(p(t,this.viewDate))return;let e=this.viewDate;this.viewDate=t;let{onChangeViewDate:n}=this.opts;if(n){let{month:t,year:e}=this.parsedViewDate;n({month:t,year:e,decade:this.curDecade})}this.trigger(i.eventChangeViewDate,t,e)})),B(this,"setFocusDate",(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!t||(t=x(t))instanceof Date)&&(o.focusDate=t,o.opts.range&&t&&o._handleRangeOnFocus(),o.trigger(i.eventChangeFocusDate,t,e))})),B(this,"setCurrentView",(t=>{if(this.viewIndexes.includes(t)){if(this.currentView=t,this.elIsInput&&this.visible&&this.setPosition(void 0,!0),this.trigger(i.eventChangeCurrentView,t),!this.views[t]){let e=this.views[t]=new C({dp:this,opts:this.opts,type:t});this.shouldUpdateDOM&&this.$content.appendChild(e.$el)}this.opts.onChangeView&&this.opts.onChangeView(t)}})),B(this,"_updateLastSelectedDate",(t=>{this.lastSelectedDate=t,this.trigger(i.eventChangeLastSelectedDate,t)})),B(this,"destroy",(()=>{let{showEvent:t,isMobile:e}=this.opts,i=this.$datepicker.parentNode;i&&i.removeChild(this.$datepicker),this.$el.removeEventListener(t,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),e&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts=null,this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=null,this.rangeDateFrom=null,this.rangeDateTo=null})),B(this,"update",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=b({},o.opts);b(o.opts,t);let{timepicker:n,buttons:r,range:s,selectedDates:a,isMobile:l}=o.opts,c=o.visible||o.treatAsInline;o._createMinMaxDates(),o._limitViewDateByMaxMinDates(),o._handleLocale(),!e.selectedDates&&a&&o.selectDate(a),t.view&&o.setCurrentView(t.view),o._setInputValue(),e.range&&!s?(o.rangeDateTo=!1,o.rangeDateFrom=!1):!e.range&&s&&o.selectedDates.length&&(o.rangeDateFrom=o.selectedDates[0],o.rangeDateTo=o.selectedDates[1]),e.timepicker&&!n?(c&&o.timepicker.destroy(),o.timepicker=!1,o.$timepicker.parentNode.removeChild(o.$timepicker)):!e.timepicker&&n&&o._addTimepicker(),!e.buttons&&r?o._addButtons():e.buttons&&!r?(o.buttons.destroy(),o.$buttons.parentNode.removeChild(o.$buttons)):c&&e.buttons&&r&&o.buttons.clearHtml().render(),!e.isMobile&&l?(o.treatAsInline||j||o._createMobileOverlay(),o._addMobileAttributes(),o.visible&&o._showMobileOverlay()):e.isMobile&&!l&&(o._removeMobileAttributes(),o.visible&&(j.classList.remove("-active-"),"function"!=typeof o.opts.position&&o.setPosition())),c&&(o.nav.update(),o.views[o.currentView].render(),o.currentView===i.days&&o.views[o.currentView].renderDayNames())})),B(this,"isOtherMonth",(t=>{let{month:e}=l(t);return e!==this.parsedViewDate.month})),B(this,"isOtherYear",(t=>{let{year:e}=l(t);return e!==this.parsedViewDate.year})),B(this,"isOtherDecade",(t=>{let{year:e}=l(t),[i,n]=u(this.viewDate);return e<i||e>n})),B(this,"_onChangeSelectedDate",(t=>{let{silent:e}=t;setTimeout((()=>{this._setInputValue(),this.opts.onSelect&&!e&&this._triggerOnSelect()}))})),B(this,"_onChangeFocusedDate",(function(t){let{viewDateTransition:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return;let i=!1;e&&(i=o.isOtherMonth(t)||o.isOtherYear(t)||o.isOtherDecade(t)),i&&o.setViewDate(t),o.opts.onFocus&&o.opts.onFocus({datepicker:o,date:t})})),B(this,"_onChangeTime",(t=>{let{hours:e,minutes:i}=t,n=new Date,{lastSelectedDate:r,opts:{onSelect:s}}=this,o=r;r||(o=n);let a=this.getCell(o,this.currentViewSingular),l=a&&a.adpCell;l&&l.isDisabled||(o.setHours(e),o.setMinutes(i),r?(this._setInputValue(),s&&this._triggerOnSelect()):this.selectDate(o))})),B(this,"_onFocus",(t=>{this.visible||this.show()})),B(this,"_onBlur",(t=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()})),B(this,"_onMouseDown",(t=>{this.inFocus=!0})),B(this,"_onMouseUp",(t=>{this.inFocus=!1,this.$el.focus()})),B(this,"_onResize",(()=>{this.visible&&"function"!=typeof this.opts.position&&this.setPosition()})),B(this,"_onClickOverlay",(()=>{this.visible&&this.hide()})),B(this,"getViewDates",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.days;return C.getDatesFunction(t)(o)})),B(this,"isWeekend",(t=>this.opts.weekends.includes(t))),B(this,"getClampedDate",(t=>{let{minDate:e,maxDate:i}=this,n=t;return i&&f(t,i)?n=i:e&&m(t,e)&&(n=e),n})),this.$el=r(t),!this.$el)return;this.$datepicker=s({className:"air-datepicker"}),this.opts=b({},n,e),this.$customContainer=!!this.opts.container&&r(this.opts.container),this.$altField=r(this.opts.altField||!1);let{view:a,startDate:c}=this.opts;c||(this.opts.startDate=new Date),"INPUT"===this.$el.nodeName&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=x(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=a,this.selectedDates=[],this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:t,treatAsInline:e,opts:{inline:i,isMobile:n,selectedDates:s,keyboardNav:o,onlyTimepicker:a}}=this,l=r("body");(!V||V&&N&&!l.contains(N))&&!i&&this.elIsInput&&!this.$customContainer&&U.buildGlobalContainer(U.defaultGlobalContainerId),!n||j||e||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(i||this._bindEvents(),o&&!a&&(this.keyboardNav=new R({dp:this,opts:t}))),s&&this.selectDate(s,{silent:!0}),this.opts.visible&&!e&&this.show(),n&&!e&&this.$el.setAttribute("readonly",!0),e&&this._createComponents()}_createMobileOverlay(){j=s({className:"air-datepicker-overlay"}),N.appendChild(j)}_createComponents(){let{opts:t,treatAsInline:e,opts:{inline:i,buttons:n,timepicker:r,position:s,classes:o,onlyTimepicker:a,isMobile:l}}=this;this._buildBaseHtml(),this.elIsInput&&(i||this._setPositionClasses(s)),!i&&this.elIsInput||this.$datepicker.classList.add("-inline-"),o&&this.$datepicker.classList.add(...o.split(" ")),a&&this.$datepicker.classList.add("-only-timepicker-"),l&&!e&&this._addMobileAttributes(),this.views[this.currentView]=new C({dp:this,type:this.currentView,opts:t}),this.nav=new P({dp:this,opts:t}),r&&this._addTimepicker(),n&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let t in this.views)this.views[t].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){j.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){j.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||""===this.initialReadonly||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:t,maxDate:e}=this.opts;this.minDate=!!t&&x(t),this.maxDate=!!e&&x(e)}_addTimepicker(){this.$timepicker=s({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new L({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=s({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new D({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(i.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(i.eventChangeFocusDate,this._onChangeFocusedDate),this.on(i.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:t}=this.opts;var e,i;this.elIsInput?t?(e=this.$datepicker,(i=this.$el).parentNode.insertBefore(e,i.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=r(".air-datepicker--content",this.$datepicker),this.$pointer=r(".air-datepicker--pointer",this.$datepicker),this.$nav=r(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:t,dateFormat:e,firstDay:i,timepicker:n,onlyTimepicker:r,timeFormat:s,dateTimeSeparator:o}=this.opts;var a;this.locale=(a=t,JSON.parse(JSON.stringify(a))),e&&(this.locale.dateFormat=e),void 0!==s&&""!==s&&(this.locale.timeFormat=s);let{timeFormat:l}=this.locale;if(""!==i&&(this.locale.firstDay=i),n&&"function"!=typeof e){let t=l?o:"";this.locale.dateFormat=[this.locale.dateFormat,l||""].join(t)}r&&"function"!=typeof e&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(t){if("function"==typeof t)return void this.$datepicker.classList.add("-custom-position-");let e=(t=t.split(" "))[0],i=`air-datepicker -${e}-${t[1]}- -from-${e}-`;this.$datepicker.classList.add(...i.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:t,minDate:e,maxDate:i}=this;i&&f(t,i)&&this.setViewDate(i),e&&m(t,e)&&this.setViewDate(e)}formatDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewDate,e=arguments.length>1?arguments[1]:void 0;if(t=x(t),!(t instanceof Date))return;let i=e,n=this.locale,r=l(t),s=r.dayPeriod,o=u(t),a=U.replacer,c={T:t.getTime(),m:r.minutes,mm:r.fullMinutes,h:r.hours12,hh:r.fullHours12,H:r.hours,HH:r.fullHours,aa:s,AA:s.toUpperCase(),E:n.daysShort[r.day],EEEE:n.days[r.day],d:r.date,dd:r.fullDate,M:r.month+1,MM:r.fullMonth,MMM:n.monthsShort[r.month],MMMM:n.months[r.month],yy:r.year.toString().slice(-2),yyyy:r.year,yyyy1:o[0],yyyy2:o[1]};for(let[t,e]of Object.entries(c))i=a(i,w(t),e);return i}down(t){this._handleUpDownActions(t,"down")}up(t){this._handleUpDownActions(t,"up")}selectDate(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{currentView:r,parsedViewDate:s,selectedDates:o}=this,{updateTime:a}=n,{moveToOtherMonthsOnSelect:l,moveToOtherYearsOnSelect:c,multipleDates:h,range:u,autoClose:d,onBeforeSelect:p}=this.opts,m=o.length;if(Array.isArray(t))return t.forEach((t=>{this.selectDate(t,n)})),new Promise((t=>{setTimeout(t)}));if((t=x(t))instanceof Date){if(p&&!p({date:t,datepicker:this}))return Promise.resolve();if(r===i.days&&t.getMonth()!==s.month&&l&&(e=new Date(t.getFullYear(),t.getMonth(),1)),r===i.years&&t.getFullYear()!==s.year&&c&&(e=new Date(t.getFullYear(),0,1)),e&&this.setViewDate(e),h&&!u){if(m===h)return;this._checkIfDateIsSelected(t)||o.push(t)}else if(u)switch(m){case 1:o.push(t),this.rangeDateTo||(this.rangeDateTo=t),f(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=t),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[t],this.rangeDateFrom=t,this.rangeDateTo="";break;default:this.selectedDates=[t],this.rangeDateFrom=t}else this.selectedDates=[t];return this.trigger(i.eventChangeSelectedDate,{action:i.actionSelectDate,silent:null==n?void 0:n.silent,date:t,updateTime:a}),this._updateLastSelectedDate(t),d&&!this.timepickerIsActive&&this.visible&&(h||u?u&&1===m&&this.hide():this.hide()),new Promise((t=>{setTimeout(t)}))}}unselectDate(t){let e=this.selectedDates,n=this;if((t=x(t))instanceof Date)return e.some(((r,s)=>{if(p(r,t))return e.splice(s,1),n.selectedDates.length?n._updateLastSelectedDate(n.selectedDates[n.selectedDates.length-1]):(n.rangeDateFrom="",n.rangeDateTo="",n._updateLastSelectedDate(!1)),this.trigger(i.eventChangeSelectedDate,{action:i.actionUnselectDate,date:t}),!0}))}replaceDate(t,e){let n=this.selectedDates.find((e=>p(e,t,this.currentView))),r=this.selectedDates.indexOf(n);r<0||p(this.selectedDates[r],e,this.currentView)||(this.selectedDates[r]=e,this.trigger(i.eventChangeSelectedDate,{action:i.actionSelectDate,date:e,updateTime:!0}),this._updateLastSelectedDate(e))}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(i.eventChangeSelectedDate,{action:i.actionUnselectDate,silent:t.silent}),new Promise((t=>{setTimeout(t)}))}show(){let{onShow:t,isMobile:e}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,t&&this._scheduleCallAfterTransition(t),e&&this._showMobileOverlay()}hide(){let{onHide:t,isMobile:e}=this.opts,i=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition((e=>{!this.customHide&&(e&&i||!e&&!i)&&this._finishHide(),t&&t(e)})),e&&j.classList.remove("-active-")}_triggerOnSelect(){let t=[],e=[],{selectedDates:i,locale:n,opts:{onSelect:r,multipleDates:s,range:o}}=this,a=s||o,l="function"==typeof n.dateFormat;i.length&&(t=i.map(g),e=l?s?n.dateFormat(t):t.map((t=>n.dateFormat(t))):t.map((t=>this.formatDate(t,n.dateFormat)))),r({date:a?t:t[0],formattedDate:a?e:e[0],datepicker:this})}_handleAlreadySelectedDates(t,e){const{range:i,toggleSelected:n}=this.opts;let r="function"==typeof n?n({datepicker:this,date:e}):n;i&&(r||2!==this.selectedDates.length&&this.selectDate(e)),r?this.unselectDate(e):this._updateLastSelectedDate(t)}_handleUpDownActions(t,e){if(!((t=x(t||this.focusDate||this.viewDate))instanceof Date))return;let i="up"===e?this.viewIndex+1:this.viewIndex-1;i>2&&(i=2),i<0&&(i=0),this.setViewDate(new Date(t.getFullYear(),t.getMonth(),1)),this.setCurrentView(this.viewIndexes[i])}_handleRangeOnFocus(){1===this.selectedDates.length&&(f(this.selectedDates[0],this.focusDate)?(this.rangeDateTo=this.selectedDates[0],this.rangeDateFrom=this.focusDate):(this.rangeDateTo=this.focusDate,this.rangeDateFrom=this.selectedDates[0]))}getCell(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.day;if(!((t=x(t))instanceof Date))return;let{year:n,month:r,date:s}=l(t),o=`[data-year="${n}"]`,a=`[data-month="${r}"]`,c={[i.day]:`${o}${a}[data-date="${s}"]`,[i.month]:`${o}${a}`,[i.year]:`${o}`};return this.views[this.currentView].$el.querySelector(c[e])}_showMobileOverlay(){j.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce(((t,e)=>parseFloat(e)+t),0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return l(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return u(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===i.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===i.days}get $container(){return this.$customContainer||N}static replacer(t,e,i){return t.replace(e,(function(t,e,n,r){return e+i+r}))}}var $;return B(U,"defaults",n),B(U,"version","3.4.0"),B(U,"defaultGlobalContainerId","air-datepicker-global-container"),$=U.prototype,Object.assign($,F),e.default}()},7860:function(t){t.exports=function(){var t=new Map;function e(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!t.has(e)){var i,n=null,r=window.getComputedStyle(e),s=(i=e.value,function(){l({testForHeightReduction:""===i||!e.value.startsWith(i),restoreTextAlign:null}),i=e.value}),o=function(i){e.removeEventListener("autosize:destroy",o),e.removeEventListener("autosize:update",c),e.removeEventListener("input",s),window.removeEventListener("resize",c),Object.keys(i).forEach((function(t){return e.style[t]=i[t]})),t.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",o),e.addEventListener("autosize:update",c),e.addEventListener("input",s),window.addEventListener("resize",c),e.style.overflowX="hidden",e.style.wordWrap="break-word",t.set(e,{destroy:o,update:c}),c()}function a(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push([t.parentNode,t.parentNode.scrollTop]),t=t.parentNode;return function(){return e.forEach((function(t){var e=t[0],i=t[1];e.style.scrollBehavior="auto",e.scrollTop=i,e.style.scrollBehavior=null}))}}function l(t){var i,s,o=t.restoreTextAlign,c=void 0===o?null:o,h=t.testForHeightReduction,u=void 0===h||h,d=r.overflowY;if(0!==e.scrollHeight&&("vertical"===r.resize?e.style.resize="none":"both"===r.resize&&(e.style.resize="horizontal"),u&&(i=a(e),e.style.height=""),s="content-box"===r.boxSizing?e.scrollHeight-(parseFloat(r.paddingTop)+parseFloat(r.paddingBottom)):e.scrollHeight+parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),"none"!==r.maxHeight&&s>parseFloat(r.maxHeight)?("hidden"===r.overflowY&&(e.style.overflow="scroll"),s=parseFloat(r.maxHeight)):"hidden"!==r.overflowY&&(e.style.overflow="hidden"),e.style.height=s+"px",c&&(e.style.textAlign=c),i&&i(),n!==s&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),n=s),d!==r.overflow&&!c)){var p=r.textAlign;"hidden"===r.overflow&&(e.style.textAlign="start"===p?"end":"start"),l({restoreTextAlign:p,testForHeightReduction:!0})}}function c(){l({testForHeightReduction:!0,restoreTextAlign:null})}}function i(e){var i=t.get(e);i&&i.destroy()}function n(e){var i=t.get(e);i&&i.update()}var r=null;return"undefined"==typeof window?((r=function(t){return t}).destroy=function(t){return t},r.update=function(t){return t}):((r=function(t,i){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return e(t)})),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],i),t},r.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],n),t}),r}()},8746:function(t,e,i){"use strict";i.r(e);var n=i(9601),r=i.n(n),s=i(2609),o=i.n(s)()(r());o.push([t.id,':root{--f-spinner-width: 36px;--f-spinner-height: 36px;--f-spinner-color-1: rgba(0, 0, 0, 0.1);--f-spinner-color-2: rgba(17, 24, 28, 0.8);--f-spinner-stroke: 2.75}.f-spinner{margin:auto;padding:0;width:var(--f-spinner-width);height:var(--f-spinner-height)}.f-spinner svg{width:100%;height:100%;vertical-align:top;animation:f-spinner-rotate 2s linear infinite}.f-spinner svg *{stroke-width:var(--f-spinner-stroke);fill:none}.f-spinner svg *:first-child{stroke:var(--f-spinner-color-1)}.f-spinner svg *:last-child{stroke:var(--f-spinner-color-2);animation:f-spinner-dash 2s ease-in-out infinite}@keyframes f-spinner-rotate{100%{transform:rotate(360deg)}}@keyframes f-spinner-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}.f-throwOutUp{animation:var(--f-throw-out-duration, 0.175s) ease-out both f-throwOutUp}.f-throwOutDown{animation:var(--f-throw-out-duration, 0.175s) ease-out both f-throwOutDown}@keyframes f-throwOutUp{to{transform:translate3d(0, calc(var(--f-throw-out-distance, 150px) * -1), 0);opacity:0}}@keyframes f-throwOutDown{to{transform:translate3d(0, var(--f-throw-out-distance, 150px), 0);opacity:0}}.f-zoomInUp{animation:var(--f-transition-duration, 0.2s) ease .1s both f-zoomInUp}.f-zoomOutDown{animation:var(--f-transition-duration, 0.2s) ease both f-zoomOutDown}@keyframes f-zoomInUp{from{transform:scale(0.975) translate3d(0, 16px, 0);opacity:0}to{transform:scale(1) translate3d(0, 0, 0);opacity:1}}@keyframes f-zoomOutDown{to{transform:scale(0.975) translate3d(0, 16px, 0);opacity:0}}.f-fadeIn{animation:var(--f-transition-duration, 0.2s) var(--f-transition-easing, ease) var(--f-transition-delay, 0s) both f-fadeIn;z-index:2}.f-fadeOut{animation:var(--f-transition-duration, 0.2s) var(--f-transition-easing, ease) var(--f-transition-delay, 0s) both f-fadeOut;z-index:1}@keyframes f-fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes f-fadeOut{100%{opacity:0}}.f-fadeFastIn{animation:var(--f-transition-duration, 0.2s) ease-out both f-fadeFastIn;z-index:2}.f-fadeFastOut{animation:var(--f-transition-duration, 0.1s) ease-out both f-fadeFastOut;z-index:2}@keyframes f-fadeFastIn{0%{opacity:.75}100%{opacity:1}}@keyframes f-fadeFastOut{100%{opacity:0}}.f-fadeSlowIn{animation:var(--f-transition-duration, 0.5s) ease both f-fadeSlowIn;z-index:2}.f-fadeSlowOut{animation:var(--f-transition-duration, 0.5s) ease both f-fadeSlowOut;z-index:1}@keyframes f-fadeSlowIn{0%{opacity:0}100%{opacity:1}}@keyframes f-fadeSlowOut{100%{opacity:0}}.f-crossfadeIn{animation:var(--f-transition-duration, 0.2s) ease-out both f-crossfadeIn;z-index:2}.f-crossfadeOut{animation:calc(var(--f-transition-duration, 0.2s)*.5) linear .1s both f-crossfadeOut;z-index:1}@keyframes f-crossfadeIn{0%{opacity:0}100%{opacity:1}}@keyframes f-crossfadeOut{100%{opacity:0}}.f-slideIn.from-next{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-slideInNext}.f-slideIn.from-prev{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-slideInPrev}.f-slideOut.to-next{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-slideOutNext}.f-slideOut.to-prev{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-slideOutPrev}@keyframes f-slideInPrev{0%{transform:translateX(100%)}100%{transform:translate3d(0, 0, 0)}}@keyframes f-slideInNext{0%{transform:translateX(-100%)}100%{transform:translate3d(0, 0, 0)}}@keyframes f-slideOutNext{100%{transform:translateX(-100%)}}@keyframes f-slideOutPrev{100%{transform:translateX(100%)}}.f-classicIn.from-next{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-classicInNext;z-index:2}.f-classicIn.from-prev{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-classicInPrev;z-index:2}.f-classicOut.to-next{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-classicOutNext;z-index:1}.f-classicOut.to-prev{animation:var(--f-transition-duration, 0.85s) cubic-bezier(0.16, 1, 0.3, 1) f-classicOutPrev;z-index:1}@keyframes f-classicInNext{0%{transform:translateX(-75px);opacity:0}100%{transform:translate3d(0, 0, 0);opacity:1}}@keyframes f-classicInPrev{0%{transform:translateX(75px);opacity:0}100%{transform:translate3d(0, 0, 0);opacity:1}}@keyframes f-classicOutNext{100%{transform:translateX(-75px);opacity:0}}@keyframes f-classicOutPrev{100%{transform:translateX(75px);opacity:0}}:root{--f-button-width: 40px;--f-button-height: 40px;--f-button-border: 0;--f-button-border-radius: 0;--f-button-color: #374151;--f-button-bg: #f8f8f8;--f-button-hover-bg: #e0e0e0;--f-button-active-bg: #d0d0d0;--f-button-shadow: none;--f-button-transition: all 0.15s ease;--f-button-transform: none;--f-button-svg-width: 20px;--f-button-svg-height: 20px;--f-button-svg-stroke-width: 1.5;--f-button-svg-fill: none;--f-button-svg-filter: none;--f-button-svg-disabled-opacity: 0.65}.f-button{display:flex;justify-content:center;align-items:center;box-sizing:content-box;position:relative;margin:0;padding:0;width:var(--f-button-width);height:var(--f-button-height);border:var(--f-button-border);border-radius:var(--f-button-border-radius);color:var(--f-button-color);background:var(--f-button-bg);box-shadow:var(--f-button-shadow);pointer-events:all;cursor:pointer;transition:var(--f-button-transition)}@media(hover: hover){.f-button:hover:not([disabled]){color:var(--f-button-hover-color);background-color:var(--f-button-hover-bg)}}.f-button:active:not([disabled]){background-color:var(--f-button-active-bg)}.f-button:focus:not(:focus-visible){outline:none}.f-button:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--f-button-outline, 2px) var(--f-button-outline-color, var(--f-button-color))}.f-button svg{width:var(--f-button-svg-width);height:var(--f-button-svg-height);fill:var(--f-button-svg-fill);stroke:currentColor;stroke-width:var(--f-button-svg-stroke-width);stroke-linecap:round;stroke-linejoin:round;transition:opacity .15s ease;transform:var(--f-button-transform);filter:var(--f-button-svg-filter);pointer-events:none}.f-button[disabled]{cursor:default}.f-button[disabled] svg{opacity:var(--f-button-svg-disabled-opacity)}.f-carousel__nav .f-button.is-prev,.f-carousel__nav .f-button.is-next,.fancybox__nav .f-button.is-prev,.fancybox__nav .f-button.is-next{position:absolute;z-index:1}.is-horizontal .f-carousel__nav .f-button.is-prev,.is-horizontal .f-carousel__nav .f-button.is-next,.is-horizontal .fancybox__nav .f-button.is-prev,.is-horizontal .fancybox__nav .f-button.is-next{top:50%;transform:translateY(-50%)}.is-horizontal .f-carousel__nav .f-button.is-prev,.is-horizontal .fancybox__nav .f-button.is-prev{left:var(--f-button-prev-pos)}.is-horizontal .f-carousel__nav .f-button.is-next,.is-horizontal .fancybox__nav .f-button.is-next{right:var(--f-button-next-pos)}.is-horizontal.is-rtl .f-carousel__nav .f-button.is-prev,.is-horizontal.is-rtl .fancybox__nav .f-button.is-prev{left:auto;right:var(--f-button-next-pos)}.is-horizontal.is-rtl .f-carousel__nav .f-button.is-next,.is-horizontal.is-rtl .fancybox__nav .f-button.is-next{right:auto;left:var(--f-button-prev-pos)}.is-vertical .f-carousel__nav .f-button.is-prev,.is-vertical .f-carousel__nav .f-button.is-next,.is-vertical .fancybox__nav .f-button.is-prev,.is-vertical .fancybox__nav .f-button.is-next{top:auto;left:50%;transform:translateX(-50%)}.is-vertical .f-carousel__nav .f-button.is-prev,.is-vertical .fancybox__nav .f-button.is-prev{top:var(--f-button-next-pos)}.is-vertical .f-carousel__nav .f-button.is-next,.is-vertical .fancybox__nav .f-button.is-next{bottom:var(--f-button-next-pos)}.is-vertical .f-carousel__nav .f-button.is-prev svg,.is-vertical .f-carousel__nav .f-button.is-next svg,.is-vertical .fancybox__nav .f-button.is-prev svg,.is-vertical .fancybox__nav .f-button.is-next svg{transform:rotate(90deg)}.f-carousel__nav .f-button:disabled,.fancybox__nav .f-button:disabled{pointer-events:none}html.with-fancybox{width:auto;overflow:visible;scroll-behavior:auto}html.with-fancybox body{touch-action:none}html.with-fancybox body.hide-scrollbar{width:auto;margin-right:calc(var(--fancybox-body-margin, 0px) + var(--fancybox-scrollbar-compensate, 0px));overflow:hidden !important;overscroll-behavior-y:none}.fancybox__container{--fancybox-color: #dbdbdb;--fancybox-hover-color: #fff;--fancybox-bg: rgba(24, 24, 27, 0.98);--fancybox-slide-gap: 10px;--f-spinner-width: 50px;--f-spinner-height: 50px;--f-spinner-color-1: rgba(255, 255, 255, 0.1);--f-spinner-color-2: #bbb;--f-spinner-stroke: 3.65;position:fixed;top:0;left:0;bottom:0;right:0;direction:ltr;display:flex;flex-direction:column;box-sizing:border-box;margin:0;padding:0;color:#f8f8f8;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:visible;z-index:var(--fancybox-zIndex, 1050);outline:none;transform-origin:top left;-webkit-text-size-adjust:100%;-moz-text-size-adjust:none;-ms-text-size-adjust:100%;text-size-adjust:100%;overscroll-behavior-y:contain}.fancybox__container *,.fancybox__container *::before,.fancybox__container *::after{box-sizing:inherit}.fancybox__container *:empty{display:block}.fancybox__container::backdrop{background-color:rgba(0,0,0,0)}.fancybox__backdrop{position:fixed;top:0;left:0;bottom:0;right:0;z-index:-1;background:var(--fancybox-bg);opacity:var(--fancybox-opacity, 1);will-change:opacity}.fancybox__carousel{position:relative;box-sizing:border-box;flex:1;min-height:0;z-index:10;overflow-y:visible;overflow-x:clip}.fancybox__viewport{width:100%;height:100%}.fancybox__viewport.is-draggable{cursor:move;cursor:grab}.fancybox__viewport.is-dragging{cursor:move;cursor:grabbing}.fancybox__track{display:flex;margin:0 auto;height:100%}.fancybox__slide{flex:0 0 auto;position:relative;display:flex;flex-direction:column;align-items:center;width:100%;height:100%;margin:0 var(--fancybox-slide-gap) 0 0;padding:4px;overflow:auto;overscroll-behavior:contain;transform:translate3d(0, 0, 0);backface-visibility:hidden}.fancybox__container:not(.is-compact) .fancybox__slide.has-close-btn{padding-top:40px}.fancybox__slide.has-iframe,.fancybox__slide.has-video,.fancybox__slide.has-html5video{overflow:hidden}.fancybox__slide.has-image{overflow:hidden}.fancybox__slide.has-image.is-animating,.fancybox__slide.has-image.is-selected{overflow:visible}.fancybox__slide::before,.fancybox__slide::after{content:"";flex:0 0 0;margin:auto}.fancybox__content{align-self:center;display:flex;flex-direction:column;position:relative;margin:0;padding:2rem;max-width:100%;color:var(--fancybox-content-color, #374151);background:var(--fancybox-content-bg, #fff);cursor:default;border-radius:0;z-index:20}.is-loading .fancybox__content{opacity:0}.is-draggable .fancybox__content{cursor:move;cursor:grab}.can-zoom_in .fancybox__content{cursor:zoom-in}.can-zoom_out .fancybox__content{cursor:zoom-out}.is-dragging .fancybox__content{cursor:move;cursor:grabbing}.fancybox__content [data-selectable],.fancybox__content [contenteditable]{cursor:auto}.fancybox__slide.has-image>.fancybox__content{padding:0;background:rgba(0,0,0,0);min-height:1px;background-repeat:no-repeat;background-size:contain;background-position:center center;transition:none;transform:translate3d(0, 0, 0);backface-visibility:hidden}.fancybox__slide.has-image>.fancybox__content>picture>img{width:100%;height:auto;max-height:100%}.is-animating .fancybox__content,.is-dragging .fancybox__content{will-change:transform,width,height}.fancybox-image{margin:auto;display:block;width:100%;height:100%;min-height:0;object-fit:contain;user-select:none;filter:blur(0px)}.fancybox__caption{align-self:center;max-width:100%;flex-shrink:0;margin:0;padding:14px 0 4px 0;overflow-wrap:anywhere;line-height:1.375;color:var(--fancybox-color, currentColor);opacity:var(--fancybox-opacity, 1);cursor:auto;visibility:visible}.is-loading .fancybox__caption,.is-closing .fancybox__caption{opacity:0;visibility:hidden}.is-compact .fancybox__caption{padding-bottom:0}.f-button.is-close-btn{--f-button-svg-stroke-width: 2;position:absolute;top:0;right:8px;z-index:40}.fancybox__content>.f-button.is-close-btn{--f-button-width: 34px;--f-button-height: 34px;--f-button-border-radius: 4px;--f-button-color: var(--fancybox-color, #fff);--f-button-hover-color: var(--fancybox-color, #fff);--f-button-bg: transparent;--f-button-hover-bg: transparent;--f-button-active-bg: transparent;--f-button-svg-width: 22px;--f-button-svg-height: 22px;position:absolute;top:-38px;right:0;opacity:.75}.is-loading .fancybox__content>.f-button.is-close-btn{visibility:hidden}.is-zooming-out .fancybox__content>.f-button.is-close-btn{visibility:hidden}.fancybox__content>.f-button.is-close-btn:hover{opacity:1}.fancybox__footer{padding:0;margin:0;position:relative}.fancybox__footer .fancybox__caption{width:100%;padding:24px;opacity:var(--fancybox-opacity, 1);transition:all .25s ease}.is-compact .fancybox__footer{position:absolute;bottom:0;left:0;right:0;z-index:20;background:rgba(24,24,27,.5)}.is-compact .fancybox__footer .fancybox__caption{padding:12px}.is-compact .fancybox__content>.f-button.is-close-btn{--f-button-border-radius: 50%;--f-button-color: #fff;--f-button-hover-color: #fff;--f-button-outline-color: #000;--f-button-bg: rgba(0, 0, 0, 0.6);--f-button-active-bg: rgba(0, 0, 0, 0.6);--f-button-hover-bg: rgba(0, 0, 0, 0.6);--f-button-svg-width: 18px;--f-button-svg-height: 18px;--f-button-svg-filter: none;top:5px;right:5px}.fancybox__nav{--f-button-width: 50px;--f-button-height: 50px;--f-button-border: 0;--f-button-border-radius: 50%;--f-button-color: var(--fancybox-color);--f-button-hover-color: var(--fancybox-hover-color);--f-button-bg: transparent;--f-button-hover-bg: rgba(24, 24, 27, 0.3);--f-button-active-bg: rgba(24, 24, 27, 0.5);--f-button-shadow: none;--f-button-transition: all 0.15s ease;--f-button-transform: none;--f-button-svg-width: 26px;--f-button-svg-height: 26px;--f-button-svg-stroke-width: 2.5;--f-button-svg-fill: none;--f-button-svg-filter: drop-shadow(1px 1px 1px rgba(24, 24, 27, 0.5));--f-button-svg-disabled-opacity: 0.65;--f-button-next-pos: 1rem;--f-button-prev-pos: 1rem;opacity:var(--fancybox-opacity, 1)}.fancybox__nav .f-button:before{position:absolute;content:"";top:-30px;right:-20px;left:-20px;bottom:-30px;z-index:1}.is-idle .fancybox__nav{animation:.15s ease-out both f-fadeOut}.is-idle.is-compact .fancybox__footer{pointer-events:none;animation:.15s ease-out both f-fadeOut}.fancybox__slide>.f-spinner{position:absolute;top:50%;left:50%;margin:var(--f-spinner-top, calc(var(--f-spinner-width) * -0.5)) 0 0 var(--f-spinner-left, calc(var(--f-spinner-height) * -0.5));z-index:30;cursor:pointer}.fancybox-protected{position:absolute;top:0;left:0;right:0;bottom:0;z-index:40;user-select:none}.fancybox-ghost{position:absolute;top:0;left:0;width:100%;height:100%;min-height:0;object-fit:contain;z-index:40;user-select:none;pointer-events:none}.fancybox-focus-guard{outline:none;opacity:0;position:fixed;pointer-events:none}.fancybox__container:not([aria-hidden]){opacity:0}.fancybox__container.is-animated[aria-hidden=false]>*:not(.fancybox__backdrop,.fancybox__carousel),.fancybox__container.is-animated[aria-hidden=false] .fancybox__carousel>*:not(.fancybox__viewport),.fancybox__container.is-animated[aria-hidden=false] .fancybox__slide>*:not(.fancybox__content){animation:var(--f-interface-enter-duration, 0.25s) ease .1s backwards f-fadeIn}.fancybox__container.is-animated[aria-hidden=false] .fancybox__backdrop{animation:var(--f-backdrop-enter-duration, 0.35s) ease backwards f-fadeIn}.fancybox__container.is-animated[aria-hidden=true]>*:not(.fancybox__backdrop,.fancybox__carousel),.fancybox__container.is-animated[aria-hidden=true] .fancybox__carousel>*:not(.fancybox__viewport),.fancybox__container.is-animated[aria-hidden=true] .fancybox__slide>*:not(.fancybox__content){animation:var(--f-interface-exit-duration, 0.15s) ease forwards f-fadeOut}.fancybox__container.is-animated[aria-hidden=true] .fancybox__backdrop{animation:var(--f-backdrop-exit-duration, 0.35s) ease forwards f-fadeOut}.has-iframe .fancybox__content,.has-map .fancybox__content,.has-pdf .fancybox__content,.has-youtube .fancybox__content,.has-vimeo .fancybox__content,.has-html5video .fancybox__content{max-width:100%;flex-shrink:1;min-height:1px;overflow:visible}.has-iframe .fancybox__content,.has-map .fancybox__content,.has-pdf .fancybox__content{width:calc(100% - 120px);height:90%}.fancybox__container.is-compact .has-iframe .fancybox__content,.fancybox__container.is-compact .has-map .fancybox__content,.fancybox__container.is-compact .has-pdf .fancybox__content{width:100%;height:100%}.has-youtube .fancybox__content,.has-vimeo .fancybox__content,.has-html5video .fancybox__content{width:960px;height:540px;max-width:100%;max-height:100%}.has-map .fancybox__content,.has-pdf .fancybox__content,.has-youtube .fancybox__content,.has-vimeo .fancybox__content,.has-html5video .fancybox__content{padding:0;background:rgba(24,24,27,.9);color:#fff}.has-map .fancybox__content{background:#e5e3df}.fancybox__html5video,.fancybox__iframe{border:0;display:block;height:100%;width:100%;background:rgba(0,0,0,0)}.fancybox-placeholder{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.f-carousel__thumbs{--f-thumb-width: 96px;--f-thumb-height: 72px;--f-thumb-outline: 0;--f-thumb-outline-color: #5eb0ef;--f-thumb-opacity: 1;--f-thumb-hover-opacity: 1;--f-thumb-selected-opacity: 1;--f-thumb-border-radius: 2px;--f-thumb-offset: 0px;--f-button-next-pos: 0;--f-button-prev-pos: 0}.f-carousel__thumbs.is-classic{--f-thumb-gap: 8px;--f-thumb-opacity: 0.5;--f-thumb-hover-opacity: 1;--f-thumb-selected-opacity: 1}.f-carousel__thumbs.is-modern{--f-thumb-gap: 4px;--f-thumb-extra-gap: 16px;--f-thumb-clip-width: 46px}.f-thumbs{position:relative;flex:0 0 auto;margin:0;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);user-select:none;perspective:1000px;transform:translateZ(0)}.f-thumbs .f-spinner{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:2px;background-image:linear-gradient(#ebeff2, #e2e8f0);z-index:-1}.f-thumbs .f-spinner svg{display:none}.f-thumbs.is-vertical{height:100%}.f-thumbs__viewport{width:100%;height:auto;overflow:hidden;transform:translate3d(0, 0, 0)}.f-thumbs__track{display:flex}.f-thumbs__slide{position:relative;flex:0 0 auto;box-sizing:content-box;display:flex;align-items:center;justify-content:center;padding:0;margin:0;width:var(--f-thumb-width);height:var(--f-thumb-height);overflow:visible;cursor:pointer}.f-thumbs__slide.is-loading img{opacity:0}.is-classic .f-thumbs__viewport{height:100%}.is-modern .f-thumbs__track{width:max-content}.is-modern .f-thumbs__track::before{content:"";position:absolute;top:0;bottom:0;left:calc((var(--f-thumb-clip-width, 0))*-0.5);width:calc(var(--width, 0)*1px + var(--f-thumb-clip-width, 0));cursor:pointer}.is-modern .f-thumbs__slide{width:var(--f-thumb-clip-width);transform:translate3d(calc(var(--shift, 0) * -1px), 0, 0);transition:none;pointer-events:none}.is-modern.is-resting .f-thumbs__slide{transition:transform .33s ease}.is-modern.is-resting .f-thumbs__slide__button{transition:clip-path .33s ease}.is-using-tab .is-modern .f-thumbs__slide:focus-within{filter:drop-shadow(-1px 0px 0px var(--f-thumb-outline-color)) drop-shadow(2px 0px 0px var(--f-thumb-outline-color)) drop-shadow(0px -1px 0px var(--f-thumb-outline-color)) drop-shadow(0px 2px 0px var(--f-thumb-outline-color))}.f-thumbs__slide__button{appearance:none;width:var(--f-thumb-width);height:100%;margin:0 -100% 0 -100%;padding:0;border:0;position:relative;border-radius:var(--f-thumb-border-radius);overflow:hidden;background:rgba(0,0,0,0);outline:none;cursor:pointer;pointer-events:auto;touch-action:manipulation;opacity:var(--f-thumb-opacity);transition:opacity .2s ease}.f-thumbs__slide__button:hover{opacity:var(--f-thumb-hover-opacity)}.f-thumbs__slide__button:focus:not(:focus-visible){outline:none}.f-thumbs__slide__button:focus-visible{outline:none;opacity:var(--f-thumb-selected-opacity)}.is-modern .f-thumbs__slide__button{--clip-path: inset( 0 calc( ((var(--f-thumb-width, 0) - var(--f-thumb-clip-width, 0))) * (1 - var(--progress, 0)) * 0.5 ) round var(--f-thumb-border-radius, 0) );clip-path:var(--clip-path)}.is-classic .is-nav-selected .f-thumbs__slide__button{opacity:var(--f-thumb-selected-opacity)}.is-classic .is-nav-selected .f-thumbs__slide__button::after{content:"";position:absolute;top:0;left:0;right:0;height:auto;bottom:0;border:var(--f-thumb-outline, 0) solid var(--f-thumb-outline-color, transparent);border-radius:var(--f-thumb-border-radius);animation:f-fadeIn .2s ease-out;z-index:10}.f-thumbs__slide__img{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;margin:0;padding:var(--f-thumb-offset);box-sizing:border-box;pointer-events:none;object-fit:cover;border-radius:var(--f-thumb-border-radius)}.f-thumbs.is-horizontal .f-thumbs__track{padding:8px 0 12px 0}.f-thumbs.is-horizontal .f-thumbs__slide{margin:0 var(--f-thumb-gap) 0 0}.f-thumbs.is-vertical .f-thumbs__track{flex-wrap:wrap;padding:0 8px}.f-thumbs.is-vertical .f-thumbs__slide{margin:0 0 var(--f-thumb-gap) 0}.fancybox__thumbs{--f-thumb-width: 96px;--f-thumb-height: 72px;--f-thumb-border-radius: 2px;--f-thumb-outline: 2px;--f-thumb-outline-color: #ededed;position:relative;opacity:var(--fancybox-opacity, 1);transition:max-height .35s cubic-bezier(0.23, 1, 0.32, 1)}.fancybox__thumbs.is-classic{--f-thumb-gap: 8px;--f-thumb-opacity: 0.5;--f-thumb-hover-opacity: 1}.fancybox__thumbs.is-classic .f-spinner{background-image:linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05))}.fancybox__thumbs.is-modern{--f-thumb-gap: 4px;--f-thumb-extra-gap: 16px;--f-thumb-clip-width: 46px;--f-thumb-opacity: 1;--f-thumb-hover-opacity: 1}.fancybox__thumbs.is-modern .f-spinner{background-image:linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05))}.fancybox__thumbs.is-horizontal{padding:0 var(--f-thumb-gap)}.fancybox__thumbs.is-vertical{padding:var(--f-thumb-gap) 0}.is-compact .fancybox__thumbs{--f-thumb-width: 64px;--f-thumb-clip-width: 32px;--f-thumb-height: 48px;--f-thumb-extra-gap: 10px}.fancybox__thumbs.is-masked{max-height:0px !important}.is-closing .fancybox__thumbs{transition:none !important}.fancybox__toolbar{--f-progress-color: var(--fancybox-color, rgba(255, 255, 255, 0.94));--f-button-width: 46px;--f-button-height: 46px;--f-button-color: var(--fancybox-color);--f-button-hover-color: var(--fancybox-hover-color);--f-button-bg: rgba(24, 24, 27, 0.65);--f-button-hover-bg: rgba(70, 70, 73, 0.65);--f-button-active-bg: rgba(90, 90, 93, 0.65);--f-button-border-radius: 0;--f-button-svg-width: 24px;--f-button-svg-height: 24px;--f-button-svg-stroke-width: 1.5;--f-button-svg-filter: drop-shadow(1px 1px 1px rgba(24, 24, 27, 0.15));--f-button-svg-fill: none;--f-button-svg-disabled-opacity: 0.65;display:flex;flex-direction:row;justify-content:space-between;margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;color:var(--fancybox-color, currentColor);opacity:var(--fancybox-opacity, 1);text-shadow:var(--fancybox-toolbar-text-shadow, 1px 1px 1px rgba(0, 0, 0, 0.5));pointer-events:none;z-index:20}.fancybox__toolbar :focus-visible{z-index:1}.fancybox__toolbar.is-absolute,.is-compact .fancybox__toolbar{position:absolute;top:0;left:0;right:0}.is-idle .fancybox__toolbar{pointer-events:none;animation:.15s ease-out both f-fadeOut}.fancybox__toolbar__column{display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start}.fancybox__toolbar__column.is-left,.fancybox__toolbar__column.is-right{flex-grow:1;flex-basis:0}.fancybox__toolbar__column.is-right{display:flex;justify-content:flex-end;flex-wrap:nowrap}.fancybox__infobar{padding:0 5px;line-height:var(--f-button-height);text-align:center;font-size:17px;font-variant-numeric:tabular-nums;-webkit-font-smoothing:subpixel-antialiased;cursor:default;user-select:none}.fancybox__infobar span{padding:0 5px}.fancybox__infobar:not(:first-child):not(:last-child){background:var(--f-button-bg)}[data-fancybox-toggle-slideshow]{position:relative}[data-fancybox-toggle-slideshow] .f-progress{height:100%;opacity:.3}[data-fancybox-toggle-slideshow] svg g:first-child{display:flex}[data-fancybox-toggle-slideshow] svg g:last-child{display:none}.has-slideshow [data-fancybox-toggle-slideshow] svg g:first-child{display:none}.has-slideshow [data-fancybox-toggle-slideshow] svg g:last-child{display:flex}[data-fancybox-toggle-fullscreen] svg g:first-child{display:flex}[data-fancybox-toggle-fullscreen] svg g:last-child{display:none}:fullscreen [data-fancybox-toggle-fullscreen] svg g:first-child{display:none}:fullscreen [data-fancybox-toggle-fullscreen] svg g:last-child{display:flex}.f-progress{position:absolute;top:0;left:0;right:0;height:3px;transform:scaleX(0);transform-origin:0;transition-property:transform;transition-timing-function:linear;background:var(--f-progress-color, var(--f-carousel-theme-color, #0091ff));z-index:30;user-select:none;pointer-events:none}',""]),e.default=o},8311:function(t,e,i){"use strict";i.r(e);var n=i(9601),r=i.n(n),s=i(2609),o=i.n(s),a=i(8991),l=i.n(a),c=new URL(i(7673),i.b),h=new URL(i(1570),i.b),u=new URL(i(6807),i.b),d=new URL(i(28),i.b),p=new URL(i(5866),i.b),f=new URL(i(5579),i.b),m=new URL(i(2931),i.b),g=new URL(i(752),i.b),_=new URL(i(323),i.b),y=new URL(i(551),i.b),v=new URL(i(4933),i.b),b=new URL(i(7378),i.b),x=new URL(i(661),i.b),w=new URL(i(1652),i.b),E=new URL(i(5363),i.b),S=new URL(i(5422),i.b),T=new URL(i(2607),i.b),M=new URL(i(1184),i.b),A=new URL(i(5968),i.b),C=new URL(i(9387),i.b),k=new URL(i(6621),i.b),P=new URL(i(4414),i.b),I=new URL(i(6437),i.b),D=new URL(i(8469),i.b),O=new URL(i(469),i.b),L=new URL(i(6081),i.b),z=new URL(i(4354),i.b),R=new URL(i(5650),i.b),F=new URL(i(4026),i.b),B=new URL(i(2179),i.b),N=o()(r()),j=l()(c),V=l()(h),U=l()(u),$=l()(d),H=l()(p),q=l()(f),W=l()(m),G=l()(g),Z=l()(_),Y=l()(y),X=l()(v),K=l()(b),Q=l()(x),J=l()(w),tt=l()(E),et=l()(S),it=l()(T),nt=l()(M),rt=l()(A),st=l()(C),ot=l()(k),at=l()(P),lt=l()(I),ct=l()(D),ht=l()(O),ut=l()(L),dt=l()(z),pt=l()(R),ft=l()(F),mt=l()(B);N.push([t.id,".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("+j+")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("+V+")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("+U+")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("+$+")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("+H+")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("+q+")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("+W+")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("+G+")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("+Z+")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("+Y+")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("+X+")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("+K+")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("+Q+")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("+J+")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("+tt+")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("+et+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("+it+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("+nt+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("+rt+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("+st+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("+ot+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("+at+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("+lt+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("+nt+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("+rt+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("+st+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("+ot+")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("+ct+")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("+ht+")}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("+ut+");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("+dt+")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("+pt+")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("+ft+");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("+mt+")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("+ft+')}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:rgba(0,0,0,.7);color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y}',""]),e.default=N},3148:function(t,e,i){"use strict";i.r(e);var n=i(9601),r=i.n(n),s=i(2609),o=i.n(s)()(r());o.push([t.id,"",""]),e.default=o},5193:function(t,e,i){"use strict";i.r(e);var n=i(9601),r=i.n(n),s=i(2609),o=i.n(s)()(r());o.push([t.id,".swiper-fade.swiper-free-mode .swiper-slide {\n transition-timing-function: ease-out;\n}\n.swiper-fade .swiper-slide {\n pointer-events: none;\n transition-property: opacity;\n}\n.swiper-fade .swiper-slide .swiper-slide {\n pointer-events: none;\n}\n.swiper-fade .swiper-slide-active {\n pointer-events: auto;\n}\n.swiper-fade .swiper-slide-active .swiper-slide-active {\n pointer-events: auto;\n}\n",""]),e.default=o},524:function(t,e,i){"use strict";i.r(e);var n=i(9601),r=i.n(n),s=i(2609),o=i.n(s)()(r());o.push([t.id,"",""]),e.default=o},9456:function(t,e,i){"use strict";i.r(e);var n=i(9601),r=i.n(n),s=i(2609),o=i.n(s),a=i(8991),l=i.n(a),c=new URL(i(9954),i.b),h=o()(r()),u=l()(c);h.push([t.id,"/**\n * Swiper 11.0.5\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2023 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: November 22, 2023\n */\n\n/* FONT_START */\n@font-face {\n font-family: 'swiper-icons';\n src: url("+u+");\n font-weight: 400;\n font-style: normal;\n}\n/* FONT_END */\n:root {\n --swiper-theme-color: #007aff;\n /*\n --swiper-preloader-color: var(--swiper-theme-color);\n --swiper-wrapper-transition-timing-function: initial;\n */\n}\n:host {\n position: relative;\n display: block;\n margin-left: auto;\n margin-right: auto;\n z-index: 1;\n}\n.swiper {\n margin-left: auto;\n margin-right: auto;\n position: relative;\n overflow: hidden;\n list-style: none;\n padding: 0;\n /* Fix of Webkit flickering */\n z-index: 1;\n display: block;\n}\n.swiper-vertical > .swiper-wrapper {\n flex-direction: column;\n}\n.swiper-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n z-index: 1;\n display: flex;\n transition-property: transform;\n transition-timing-function: var(--swiper-wrapper-transition-timing-function, initial);\n box-sizing: content-box;\n}\n.swiper-android .swiper-slide,\n.swiper-ios .swiper-slide,\n.swiper-wrapper {\n transform: translate3d(0px, 0, 0);\n}\n.swiper-horizontal {\n touch-action: pan-y;\n}\n.swiper-vertical {\n touch-action: pan-x;\n}\n.swiper-slide {\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n position: relative;\n transition-property: transform;\n display: block;\n}\n.swiper-slide-invisible-blank {\n visibility: hidden;\n}\n/* Auto Height */\n.swiper-autoheight,\n.swiper-autoheight .swiper-slide {\n height: auto;\n}\n.swiper-autoheight .swiper-wrapper {\n align-items: flex-start;\n transition-property: transform, height;\n}\n.swiper-backface-hidden .swiper-slide {\n transform: translateZ(0);\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n}\n/* 3D Effects */\n.swiper-3d.swiper-css-mode .swiper-wrapper {\n perspective: 1200px;\n}\n.swiper-3d .swiper-wrapper {\n transform-style: preserve-3d;\n}\n.swiper-3d {\n perspective: 1200px;\n}\n.swiper-3d .swiper-slide,\n.swiper-3d .swiper-cube-shadow {\n transform-style: preserve-3d;\n}\n/* CSS Mode */\n.swiper-css-mode > .swiper-wrapper {\n overflow: auto;\n scrollbar-width: none;\n /* For Firefox */\n -ms-overflow-style: none;\n /* For Internet Explorer and Edge */\n}\n.swiper-css-mode > .swiper-wrapper::-webkit-scrollbar {\n display: none;\n}\n.swiper-css-mode > .swiper-wrapper > .swiper-slide {\n scroll-snap-align: start start;\n}\n.swiper-css-mode.swiper-horizontal > .swiper-wrapper {\n scroll-snap-type: x mandatory;\n}\n.swiper-css-mode.swiper-vertical > .swiper-wrapper {\n scroll-snap-type: y mandatory;\n}\n.swiper-css-mode.swiper-free-mode > .swiper-wrapper {\n scroll-snap-type: none;\n}\n.swiper-css-mode.swiper-free-mode > .swiper-wrapper > .swiper-slide {\n scroll-snap-align: none;\n}\n.swiper-css-mode.swiper-centered > .swiper-wrapper::before {\n content: '';\n flex-shrink: 0;\n order: 9999;\n}\n.swiper-css-mode.swiper-centered > .swiper-wrapper > .swiper-slide {\n scroll-snap-align: center center;\n scroll-snap-stop: always;\n}\n.swiper-css-mode.swiper-centered.swiper-horizontal > .swiper-wrapper > .swiper-slide:first-child {\n margin-inline-start: var(--swiper-centered-offset-before);\n}\n.swiper-css-mode.swiper-centered.swiper-horizontal > .swiper-wrapper::before {\n height: 100%;\n min-height: 1px;\n width: var(--swiper-centered-offset-after);\n}\n.swiper-css-mode.swiper-centered.swiper-vertical > .swiper-wrapper > .swiper-slide:first-child {\n margin-block-start: var(--swiper-centered-offset-before);\n}\n.swiper-css-mode.swiper-centered.swiper-vertical > .swiper-wrapper::before {\n width: 100%;\n min-width: 1px;\n height: var(--swiper-centered-offset-after);\n}\n/* Slide styles start */\n/* 3D Shadows */\n.swiper-3d .swiper-slide-shadow,\n.swiper-3d .swiper-slide-shadow-left,\n.swiper-3d .swiper-slide-shadow-right,\n.swiper-3d .swiper-slide-shadow-top,\n.swiper-3d .swiper-slide-shadow-bottom,\n.swiper-3d .swiper-slide-shadow,\n.swiper-3d .swiper-slide-shadow-left,\n.swiper-3d .swiper-slide-shadow-right,\n.swiper-3d .swiper-slide-shadow-top,\n.swiper-3d .swiper-slide-shadow-bottom {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n z-index: 10;\n}\n.swiper-3d .swiper-slide-shadow {\n background: rgba(0, 0, 0, 0.15);\n}\n.swiper-3d .swiper-slide-shadow-left {\n background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.swiper-3d .swiper-slide-shadow-right {\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.swiper-3d .swiper-slide-shadow-top {\n background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.swiper-3d .swiper-slide-shadow-bottom {\n background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.swiper-lazy-preloader {\n width: 42px;\n height: 42px;\n position: absolute;\n left: 50%;\n top: 50%;\n margin-left: -21px;\n margin-top: -21px;\n z-index: 10;\n transform-origin: 50%;\n box-sizing: border-box;\n border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));\n border-radius: 50%;\n border-top-color: transparent;\n}\n.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,\n.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader {\n animation: swiper-preloader-spin 1s infinite linear;\n}\n.swiper-lazy-preloader-white {\n --swiper-preloader-color: #fff;\n}\n.swiper-lazy-preloader-black {\n --swiper-preloader-color: #000;\n}\n@keyframes swiper-preloader-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n/* Slide styles end */\n",""]),e.default=h},2609:function(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",n=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),n&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),n&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,n,r,s){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(o[l]=!0)}for(var c=0;c<t.length;c++){var h=[].concat(t[c]);n&&o[h[0]]||(void 0!==s&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=s),i&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=i):h[2]=i),r&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=r):h[4]="".concat(r)),e.push(h))}},e}},8991:function(t){"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},9601:function(t){"use strict";t.exports=function(t){return t[1]}},4902:function(t,e,i){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}i.d(e,{ZP:function(){return Zn},gsap:function(){return Zn}});var s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},x={duration:.5,overwrite:!1,delay:0},w=1e8,E=1e-8,S=2*Math.PI,T=S/4,M=0,A=Math.sqrt,C=Math.cos,k=Math.sin,P=function(t){return"string"==typeof t},I=function(t){return"function"==typeof t},D=function(t){return"number"==typeof t},O=function(t){return void 0===t},L=function(t){return"object"==typeof t},z=function(t){return!1!==t},R=function(){return"undefined"!=typeof window},F=function(t){return I(t)||P(t)},B="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},N=Array.isArray,j=/(?:-?\.?\d|\.)+/gi,V=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,U=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,H=/[+-]=-?[.\d]+/,q=/[^,'"\[\]\s]+/gi,W=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,G={},Z={},Y=function(t){return(Z=St(t,G))&&Ti},X=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},K=function(t,e){return!e&&console.warn(t)},Q=function(t,e){return t&&(G[t]=e)&&Z&&(Z[t]=e)||G},J=function(){return 0},tt={suppressEvents:!0,isStart:!0,kill:!1},et={suppressEvents:!0,kill:!1},it={suppressEvents:!0},nt={},rt=[],st={},ot={},at={},lt=30,ct=[],ht="",ut=function(t){var e,i,n=t[0];if(L(n)||I(n)||(t=[t]),!(e=(n._gsap||{}).harness)){for(i=ct.length;i--&&!ct[i].targetTest(n););e=ct[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ne(t[i],e)))||t.splice(i,1);return t},dt=function(t){return t._gsap||ut(ie(t))[0]._gsap},pt=function(t,e,i){return(i=t[e])&&I(i)?t[e]():O(i)&&t.getAttribute&&t.getAttribute(e)||i},ft=function(t,e){return(t=t.split(",")).forEach(e)||t},mt=function(t){return Math.round(1e5*t)/1e5||0},gt=function(t){return Math.round(1e7*t)/1e7||0},_t=function(t,e){var i=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),"+"===i?t+n:"-"===i?t-n:"*"===i?t*n:t/n},yt=function(t,e){for(var i=e.length,n=0;t.indexOf(e[n])<0&&++n<i;);return n<i},vt=function(){var t,e,i=rt.length,n=rt.slice(0);for(st={},rt.length=0,t=0;t<i;t++)(e=n[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},bt=function(t,e,i,n){rt.length&&!o&&vt(),t.render(e,i,n||o&&e<0&&(t._initted||t._startAt)),rt.length&&!o&&vt()},xt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(q).length<2?e:P(t)?t.trim():t},wt=function(t){return t},Et=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},St=function(t,e){for(var i in e)t[i]=e[i];return t},Tt=function t(e,i){for(var n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(e[n]=L(i[n])?t(e[n]||(e[n]={}),i[n]):i[n]);return e},Mt=function(t,e){var i,n={};for(i in t)i in e||(n[i]=t[i]);return n},At=function(t){var e,i=t.parent||l,n=t.keyframes?(e=N(t.keyframes),function(t,i){for(var n in i)n in t||"duration"===n&&e||"ease"===n||(t[n]=i[n])}):Et;if(z(t.inherit))for(;i;)n(t,i.vars.defaults),i=i.parent||i._dp;return t},Ct=function(t,e,i,n,r){void 0===i&&(i="_first"),void 0===n&&(n="_last");var s,o=t[n];if(r)for(s=e[r];o&&o[r]>s;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e},kt=function(t,e,i,n){void 0===i&&(i="_first"),void 0===n&&(n="_last");var r=e._prev,s=e._next;r?r._next=s:t[i]===e&&(t[i]=s),s?s._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null},Pt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},It=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},Dt=function(t,e,i,n){return t._startAt&&(o?t._startAt.revert(et):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},Ot=function t(e){return!e||e._ts&&t(e.parent)},Lt=function(t){return t._repeat?zt(t._tTime,t=t.duration()+t._rDelay)*t:0},zt=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},Rt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ft=function(t){return t._end=gt(t._start+(t._tDur/Math.abs(t._ts||t._rts||E)||0))},Bt=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=gt(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ft(t),i._dirty||It(i,t)),t},Nt=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=Rt(t.rawTime(),e),(!e._dur||Kt(0,e.totalDuration(),i)-e._tTime>E)&&e.render(i,!0)),It(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-1e-8}},jt=function(t,e,i,n){return e.parent&&Pt(e),e._start=gt((D(i)?i:i||t!==l?Zt(t,i,e):t._time)+e._delay),e._end=gt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ct(t,e,"_first","_last",t._sort?"_start":0),Ht(e)||(t._recent=e),n||Nt(t,e),t._ts<0&&Bt(t,t._tTime),t},Vt=function(t,e){return(G.ScrollTrigger||X("scrollTrigger",e))&&G.ScrollTrigger.create(e,t)},Ut=function(t,e,i,n,r){return Ge(t,e,r),t._initted?!i&&t._pt&&!o&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&p!==Me.frame?(rt.push(t),t._lazy=[r,n],1):void 0:1},$t=function t(e){var i=e.parent;return i&&i._ts&&i._initted&&!i._lock&&(i.rawTime()<0||t(i))},Ht=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},qt=function(t,e,i,n){var r=t._repeat,s=gt(e)||0,o=t._tTime/t._tDur;return o&&!n&&(t._time*=s/t._dur),t._dur=s,t._tDur=r?r<0?1e10:gt(s*(r+1)+t._rDelay*r):s,o>0&&!n&&Bt(t,t._tTime=t._tDur*o),t.parent&&Ft(t),i||It(t.parent,t),t},Wt=function(t){return t instanceof Ve?It(t):qt(t,t._dur)},Gt={_start:0,endTime:J,totalDuration:J},Zt=function t(e,i,n){var r,s,o,a=e.labels,l=e._recent||Gt,c=e.duration()>=w?l.endTime(!1):e._dur;return P(i)&&(isNaN(i)||i in a)?(s=i.charAt(0),o="%"===i.substr(-1),r=i.indexOf("="),"<"===s||">"===s?(r>=0&&(i=i.replace(/=/,"")),("<"===s?l._start:l.endTime(l._repeat>=0))+(parseFloat(i.substr(1))||0)*(o?(r<0?l:n).totalDuration()/100:1)):r<0?(i in a||(a[i]=c),a[i]):(s=parseFloat(i.charAt(r-1)+i.substr(r+1)),o&&n&&(s=s/100*(N(n)?n[0]:n).totalDuration()),r>1?t(e,i.substr(0,r-1),n)+s:c+s)):null==i?c:+i},Yt=function(t,e,i){var n,r,s=D(e[1]),o=(s?2:1)+(t<2?0:1),a=e[o];if(s&&(a.duration=e[1]),a.parent=i,t){for(n=a,r=i;r&&!("immediateRender"in n);)n=r.vars.defaults||{},r=z(r.vars.inherit)&&r.parent;a.immediateRender=z(n.immediateRender),t<2?a.runBackwards=1:a.startAt=e[o-1]}return new Qe(e[0],a,e[o+1])},Xt=function(t,e){return t||0===t?e(t):e},Kt=function(t,e,i){return i<t?t:i>e?e:i},Qt=function(t,e){return P(t)&&(e=W.exec(t))?e[1]:""},Jt=[].slice,te=function(t,e){return t&&L(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&L(t[0]))&&!t.nodeType&&t!==c},ee=function(t,e,i){return void 0===i&&(i=[]),t.forEach((function(t){var n;return P(t)&&!e||te(t,1)?(n=i).push.apply(n,ie(t)):i.push(t)}))||i},ie=function(t,e,i){return a&&!e&&a.selector?a.selector(t):!P(t)||i||!h&&Ae()?N(t)?ee(t,i):te(t)?Jt.call(t,0):t?[t]:[]:Jt.call((e||u).querySelectorAll(t),0)},ne=function(t){return t=ie(t)[0]||K("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return ie(e,i.querySelectorAll?i:i===t?K("Invalid scope")||u.createElement("div"):t)}},re=function(t){return t.sort((function(){return.5-Math.random()}))},se=function(t){if(I(t))return t;var e=L(t)?t:{each:t},i=Le(e.ease),n=e.from||0,r=parseFloat(e.base)||0,s={},o=n>0&&n<1,a=isNaN(n)||o,l=e.axis,c=n,h=n;return P(n)?c=h={center:.5,edges:.5,end:1}[n]||0:!o&&a&&(c=n[0],h=n[1]),function(t,o,u){var d,p,f,m,g,_,y,v,b,x=(u||e).length,E=s[x];if(!E){if(!(b="auto"===e.grid?0:(e.grid||[1,w])[1])){for(y=-w;y<(y=u[b++].getBoundingClientRect().left)&&b<x;);b<x&&b--}for(E=s[x]=[],d=a?Math.min(b,x)*c-.5:n%b,p=b===w?0:a?x*h/b-.5:n/b|0,y=0,v=w,_=0;_<x;_++)f=_%b-d,m=p-(_/b|0),E[_]=g=l?Math.abs("y"===l?m:f):A(f*f+m*m),g>y&&(y=g),g<v&&(v=g);"random"===n&&re(E),E.max=y-v,E.min=v,E.v=x=(parseFloat(e.amount)||parseFloat(e.each)*(b>x?x-1:l?"y"===l?x/b:b:Math.max(b,x/b))||0)*("edges"===n?-1:1),E.b=x<0?r-x:r,E.u=Qt(e.amount||e.each)||0,i=i&&x<0?De(i):i}return x=(E[t]-E.min)/E.max||0,gt(E.b+(i?i(x):x)*E.v)+E.u}},oe=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var n=gt(Math.round(parseFloat(i)/t)*t*e);return(n-n%1)/e+(D(i)?0:Qt(i))}},ae=function(t,e){var i,n,r=N(t);return!r&&L(t)&&(i=r=t.radius||w,t.values?(t=ie(t.values),(n=!D(t[0]))&&(i*=i)):t=oe(t.increment)),Xt(e,r?I(t)?function(e){return n=t(e),Math.abs(n-e)<=i?n:e}:function(e){for(var r,s,o=parseFloat(n?e.x:e),a=parseFloat(n?e.y:0),l=w,c=0,h=t.length;h--;)(r=n?(r=t[h].x-o)*r+(s=t[h].y-a)*s:Math.abs(t[h]-o))<l&&(l=r,c=h);return c=!i||l<=i?t[c]:e,n||c===e||D(e)?c:c+Qt(e)}:oe(t))},le=function(t,e,i,n){return Xt(N(t)?!e:!0===i?!!(i=0):!n,(function(){return N(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+.99*i))/i)*i*n)/n}))},ce=function(t,e,i){return Xt(i,(function(i){return t[~~e(i)]}))},he=function(t){for(var e,i,n,r,s=0,o="";~(e=t.indexOf("random(",s));)n=t.indexOf(")",e),r="["===t.charAt(e+7),i=t.substr(e+7,n-e-7).match(r?q:j),o+=t.substr(s,e-s)+le(r?i:+i[0],r?0:+i[1],+i[2]||1e-5),s=n+1;return o+t.substr(s,t.length-s)},ue=function(t,e,i,n,r){var s=e-t,o=n-i;return Xt(r,(function(e){return i+((e-t)/s*o||0)}))},de=function(t,e,i){var n,r,s,o=t.labels,a=w;for(n in o)(r=o[n]-e)<0==!!i&&r&&a>(r=Math.abs(r))&&(s=n,a=r);return s},pe=function(t,e,i){var n,r,s,o=t.vars,l=o[e],c=a,h=t._ctx;if(l)return n=o[e+"Params"],r=o.callbackScope||t,i&&rt.length&&vt(),h&&(a=h),s=n?l.apply(r,n):l.call(r),a=c,s},fe=function(t){return Pt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!o),t.progress()<1&&pe(t,"onInterrupt"),t},me=[],ge=function(t){if(R()&&t){var e=(t=!t.name&&t.default||t).name,i=I(t),n=e&&!i&&t.init?function(){this._props=[]}:t,r={init:J,render:ai,add:qe,kill:ci,modifier:li,rawVars:0},s={targetTest:0,get:0,getSetter:ni,aliases:{},register:0};if(Ae(),t!==n){if(ot[e])return;Et(n,Et(Mt(t,r),s)),St(n.prototype,St(r,Mt(t,s))),ot[n.prop=e]=n,t.targetTest&&(ct.push(n),nt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Q(e,n),t.register&&t.register(Ti,n,di)}else t&&me.push(t)},_e=255,ye={aqua:[0,_e,_e],lime:[0,_e,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,_e],navy:[0,0,128],white:[_e,_e,_e],olive:[128,128,0],yellow:[_e,_e,0],orange:[_e,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[_e,0,0],pink:[_e,192,203],cyan:[0,_e,_e],transparent:[_e,_e,_e,0]},ve=function(t,e,i){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(i-e)*t*6:t<.5?i:3*t<2?e+(i-e)*(2/3-t)*6:e)*_e+.5|0},be=function(t,e,i){var n,r,s,o,a,l,c,h,u,d,p=t?D(t)?[t>>16,t>>8&_e,t&_e]:0:ye.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),ye[t])p=ye[t];else if("#"===t.charAt(0)){if(t.length<6&&(n=t.charAt(1),r=t.charAt(2),s=t.charAt(3),t="#"+n+n+r+r+s+s+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&_e,p&_e,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&_e,t&_e]}else if("hsl"===t.substr(0,3))if(p=d=t.match(j),e){if(~t.indexOf("="))return p=t.match(V),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,a=+p[1]/100,n=2*(l=+p[2]/100)-(r=l<=.5?l*(a+1):l+a-l*a),p.length>3&&(p[3]*=1),p[0]=ve(o+1/3,n,r),p[1]=ve(o,n,r),p[2]=ve(o-1/3,n,r);else p=t.match(j)||ye.transparent;p=p.map(Number)}return e&&!d&&(n=p[0]/_e,r=p[1]/_e,s=p[2]/_e,l=((c=Math.max(n,r,s))+(h=Math.min(n,r,s)))/2,c===h?o=a=0:(u=c-h,a=l>.5?u/(2-c-h):u/(c+h),o=c===n?(r-s)/u+(r<s?6:0):c===r?(s-n)/u+2:(n-r)/u+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*a+.5),p[2]=~~(100*l+.5)),i&&p.length<4&&(p[3]=1),p},xe=function(t){var e=[],i=[],n=-1;return t.split(Ee).forEach((function(t){var r=t.match(U)||[];e.push.apply(e,r),i.push(n+=r.length+1)})),e.c=i,e},we=function(t,e,i){var n,r,s,o,a="",l=(t+a).match(Ee),c=e?"hsla(":"rgba(",h=0;if(!l)return t;if(l=l.map((function(t){return(t=be(t,e,1))&&c+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),i&&(s=xe(t),(n=i.c).join(a)!==s.c.join(a)))for(o=(r=t.replace(Ee,"1").split(U)).length-1;h<o;h++)a+=r[h]+(~n.indexOf(h)?l.shift()||c+"0,0,0,0)":(s.length?s:l.length?l:i).shift());if(!r)for(o=(r=t.split(Ee)).length-1;h<o;h++)a+=r[h]+l[h];return a+r[o]},Ee=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in ye)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Se=/hsl[a]?\(/,Te=function(t){var e,i=t.join(" ");if(Ee.lastIndex=0,Ee.test(i))return e=Se.test(i),t[1]=we(t[1],e),t[0]=we(t[0],e,xe(t[1])),!0},Me=function(){var t,e,i,n,r,s,o=Date.now,a=500,l=33,p=o(),f=p,g=1e3/240,_=g,y=[],v=function i(c){var h,u,d,m,v=o()-f,b=!0===c;if(v>a&&(p+=v-l),((h=(d=(f+=v)-p)-_)>0||b)&&(m=++n.frame,r=d-1e3*n.time,n.time=d/=1e3,_+=h+(h>=g?4:g-h),u=1),b||(t=e(i)),u)for(s=0;s<y.length;s++)y[s](d,r,m,c)};return n={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(t){return r/(1e3/(t||60))},wake:function(){d&&(!h&&R()&&(c=h=window,u=c.document||{},G.gsap=Ti,(c.gsapVersions||(c.gsapVersions=[])).push(Ti.version),Y(Z||c.GreenSockGlobals||!c.gsap&&c||{}),i=c.requestAnimationFrame,me.forEach(ge)),t&&n.sleep(),e=i||function(t){return setTimeout(t,_-1e3*n.time+1|0)},m=1,v(2))},sleep:function(){(i?c.cancelAnimationFrame:clearTimeout)(t),m=0,e=J},lagSmoothing:function(t,e){a=t||1/0,l=Math.min(e||33,a)},fps:function(t){g=1e3/(t||240),_=1e3*n.time+g},add:function(t,e,i){var r=e?function(e,i,s,o){t(e,i,s,o),n.remove(r)}:t;return n.remove(t),y[i?"unshift":"push"](r),Ae(),r},remove:function(t,e){~(e=y.indexOf(t))&&y.splice(e,1)&&s>=e&&s--},_listeners:y}}(),Ae=function(){return!m&&Me.wake()},Ce={},ke=/^[\d.\-M][\d.\-,\s]/,Pe=/["']/g,Ie=function(t){for(var e,i,n,r={},s=t.substr(1,t.length-3).split(":"),o=s[0],a=1,l=s.length;a<l;a++)i=s[a],e=a!==l-1?i.lastIndexOf(","):i.length,n=i.substr(0,e),r[o]=isNaN(n)?n.replace(Pe,"").trim():+n,o=i.substr(e+1).trim();return r},De=function(t){return function(e){return 1-t(1-e)}},Oe=function t(e,i){for(var n,r=e._first;r;)r instanceof Ve?t(r,i):!r.vars.yoyoEase||r._yoyo&&r._repeat||r._yoyo===i||(r.timeline?t(r.timeline,i):(n=r._ease,r._ease=r._yEase,r._yEase=n,r._yoyo=i)),r=r._next},Le=function(t,e){return t&&(I(t)?t:Ce[t]||function(t){var e,i,n,r,s=(t+"").split("("),o=Ce[s[0]];return o&&s.length>1&&o.config?o.config.apply(null,~t.indexOf("{")?[Ie(s[1])]:(e=t,i=e.indexOf("(")+1,n=e.indexOf(")"),r=e.indexOf("(",i),e.substring(i,~r&&r<n?e.indexOf(")",n+1):n)).split(",").map(xt)):Ce._CE&&ke.test(t)?Ce._CE("",t):o}(t))||e},ze=function(t,e,i,n){void 0===i&&(i=function(t){return 1-e(1-t)}),void 0===n&&(n=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var r,s={easeIn:e,easeOut:i,easeInOut:n};return ft(t,(function(t){for(var e in Ce[t]=G[t]=s,Ce[r=t.toLowerCase()]=i,s)Ce[r+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Ce[t+"."+e]=s[e]})),s},Re=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},Fe=function t(e,i,n){var r=i>=1?i:1,s=(n||(e?.3:.45))/(i<1?i:1),o=s/S*(Math.asin(1/r)||0),a=function(t){return 1===t?1:r*Math.pow(2,-10*t)*k((t-o)*s)+1},l="out"===e?a:"in"===e?function(t){return 1-a(1-t)}:Re(a);return s=S/s,l.config=function(i,n){return t(e,i,n)},l},Be=function t(e,i){void 0===i&&(i=1.70158);var n=function(t){return t?--t*t*((i+1)*t+i)+1:0},r="out"===e?n:"in"===e?function(t){return 1-n(1-t)}:Re(n);return r.config=function(i){return t(e,i)},r};ft("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var i=e<5?e+1:e;ze(t+",Power"+(i-1),e?function(t){return Math.pow(t,i)}:function(t){return t},(function(t){return 1-Math.pow(1-t,i)}),(function(t){return t<.5?Math.pow(2*t,i)/2:1-Math.pow(2*(1-t),i)/2}))})),Ce.Linear.easeNone=Ce.none=Ce.Linear.easeIn,ze("Elastic",Fe("in"),Fe("out"),Fe()),g=7.5625,y=1/(_=2.75),ze("Bounce",(function(t){return 1-v(1-t)}),v=function(t){return t<y?g*t*t:t<.7272727272727273?g*Math.pow(t-1.5/_,2)+.75:t<.9090909090909092?g*(t-=2.25/_)*t+.9375:g*Math.pow(t-2.625/_,2)+.984375}),ze("Expo",(function(t){return t?Math.pow(2,10*(t-1)):0})),ze("Circ",(function(t){return-(A(1-t*t)-1)})),ze("Sine",(function(t){return 1===t?1:1-C(t*T)})),ze("Back",Be("in"),Be("out"),Be()),Ce.SteppedEase=Ce.steps=G.SteppedEase={config:function(t,e){void 0===t&&(t=1);var i=1/t,n=t+(e?0:1),r=e?1:0;return function(t){return((n*Kt(0,.99999999,t)|0)+r)*i}}},x.ease=Ce["quad.out"],ft("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return ht+=t+","+t+"Params,"}));var Ne=function(t,e){this.id=M++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:pt,this.set=e?e.getSetter:ni},je=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,qt(this,+t.duration,1,1),this.data=t.data,a&&(this._ctx=a,a.data.push(this)),m||Me.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,qt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Ae(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Bt(this,t),!i._dp||i.parent||Nt(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&jt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===E||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),bt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Lt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Lt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,e):this._repeat?zt(this._tTime,i)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?Rt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(Kt(-Math.abs(this._delay),this._tDur,i),!1!==e),Ft(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ae(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==E&&(this._tTime-=E)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&jt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(z(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Rt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=it);var e=o;return o=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),o=e,this},e.globalTime=function(t){for(var e=this,i=arguments.length?t:e.rawTime();e;)i=e._start+i/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Wt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,Wt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(Zt(this,t),z(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,z(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,i=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=i&&t<this.endTime(!0)-E))},e.eventCallback=function(t,e,i){var n=this.vars;return arguments.length>1?(e?(n[t]=e,i&&(n[t+"Params"]=i),"onUpdate"===t&&(this._onUpdate=e)):delete n[t],this):n[t]},e.then=function(t){var e=this;return new Promise((function(i){var n=I(t)?t:wt,r=function(){var t=e.then;e.then=null,I(n)&&(n=n(e))&&(n.then||n===e)&&(e.then=t),i(n),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?r():e._prom=r}))},e.kill=function(){fe(this)},t}();Et(je.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Ve=function(t){function e(e,i){var r;return void 0===e&&(e={}),(r=t.call(this,e)||this).labels={},r.smoothChildTiming=!!e.smoothChildTiming,r.autoRemoveChildren=!!e.autoRemoveChildren,r._sort=z(e.sortChildren),l&&jt(e.parent||l,n(r),i),e.reversed&&r.reverse(),e.paused&&r.paused(!0),e.scrollTrigger&&Vt(n(r),e.scrollTrigger),r}r(e,t);var i=e.prototype;return i.to=function(t,e,i){return Yt(0,arguments,this),this},i.from=function(t,e,i){return Yt(1,arguments,this),this},i.fromTo=function(t,e,i,n){return Yt(2,arguments,this),this},i.set=function(t,e,i){return e.duration=0,e.parent=this,At(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Qe(t,e,Zt(this,i),1),this},i.call=function(t,e,i){return jt(this,Qe.delayedCall(0,t,e),i)},i.staggerTo=function(t,e,i,n,r,s,o){return i.duration=e,i.stagger=i.stagger||n,i.onComplete=s,i.onCompleteParams=o,i.parent=this,new Qe(t,i,Zt(this,r)),this},i.staggerFrom=function(t,e,i,n,r,s,o){return i.runBackwards=1,At(i).immediateRender=z(i.immediateRender),this.staggerTo(t,e,i,n,r,s,o)},i.staggerFromTo=function(t,e,i,n,r,s,o,a){return n.startAt=i,At(n).immediateRender=z(n.immediateRender),this.staggerTo(t,e,n,r,s,o,a)},i.render=function(t,e,i){var n,r,s,a,c,h,u,d,p,f,m,g,_=this._time,y=this._dirty?this.totalDuration():this._tDur,v=this._dur,b=t<=0?0:gt(t),x=this._zTime<0!=t<0&&(this._initted||!v);if(this!==l&&b>y&&t>=0&&(b=y),b!==this._tTime||i||x){if(_!==this._time&&v&&(b+=this._time-_,t+=this._time-_),n=b,p=this._start,h=!(d=this._ts),x&&(v||(_=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(m=this._yoyo,c=v+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*c+t,e,i);if(n=gt(b%c),b===y?(a=this._repeat,n=v):((a=~~(b/c))&&a===b/c&&(n=v,a--),n>v&&(n=v)),f=zt(this._tTime,c),!_&&this._tTime&&f!==a&&this._tTime-f*c-this._dur<=0&&(f=a),m&&1&a&&(n=v-n,g=1),a!==f&&!this._lock){var w=m&&1&f,S=w===(m&&1&a);if(a<f&&(w=!w),_=w?0:b%v?v:b,this._lock=1,this.render(_||(g?0:gt(a*c)),e,!v)._lock=0,this._tTime=b,!e&&this.parent&&pe(this,"onRepeat"),this.vars.repeatRefresh&&!g&&(this.invalidate()._lock=1),_&&_!==this._time||h!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(v=this._dur,y=this._tDur,S&&(this._lock=2,_=w?v:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!g&&this.invalidate()),this._lock=0,!this._ts&&!h)return this;Oe(this,g)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(u=function(t,e,i){var n;if(i>e)for(n=t._first;n&&n._start<=i;){if("isPause"===n.data&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=i;){if("isPause"===n.data&&n._start<e)return n;n=n._prev}}(this,gt(_),gt(n)),u&&(b-=n-(n=u._start))),this._tTime=b,this._time=n,this._act=!d,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,_=0),!_&&n&&!e&&!a&&(pe(this,"onStart"),this._tTime!==b))return this;if(n>=_&&t>=0)for(r=this._first;r;){if(s=r._next,(r._act||n>=r._start)&&r._ts&&u!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(r._ts>0?(n-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(n-r._start)*r._ts,e,i),n!==this._time||!this._ts&&!h){u=0,s&&(b+=this._zTime=-1e-8);break}}r=s}else{r=this._last;for(var T=t<0?t:n;r;){if(s=r._prev,(r._act||T<=r._end)&&r._ts&&u!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(r._ts>0?(T-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(T-r._start)*r._ts,e,i||o&&(r._initted||r._startAt)),n!==this._time||!this._ts&&!h){u=0,s&&(b+=this._zTime=T?-1e-8:E);break}}r=s}}if(u&&!e&&(this.pause(),u.render(n>=_?0:-1e-8)._zTime=n>=_?1:-1,this._ts))return this._start=p,Ft(this),this.render(t,e,i);this._onUpdate&&!e&&pe(this,"onUpdate",!0),(b===y&&this._tTime>=this.totalDuration()||!b&&_)&&(p!==this._start&&Math.abs(d)===Math.abs(this._ts)||this._lock||((t||!v)&&(b===y&&this._ts>0||!b&&this._ts<0)&&Pt(this,1),e||t<0&&!_||!b&&!_&&y||(pe(this,b===y&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(b<y&&this.timeScale()>0)&&this._prom())))}return this},i.add=function(t,e){var i=this;if(D(e)||(e=Zt(this,e,t)),!(t instanceof je)){if(N(t))return t.forEach((function(t){return i.add(t,e)})),this;if(P(t))return this.addLabel(t,e);if(!I(t))return this;t=Qe.delayedCall(0,t)}return this!==t?jt(this,t,e):this},i.getChildren=function(t,e,i,n){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=-w);for(var r=[],s=this._first;s;)s._start>=n&&(s instanceof Qe?e&&r.push(s):(i&&r.push(s),t&&r.push.apply(r,s.getChildren(!0,e,i)))),s=s._next;return r},i.getById=function(t){for(var e=this.getChildren(1,1,1),i=e.length;i--;)if(e[i].vars.id===t)return e[i]},i.remove=function(t){return P(t)?this.removeLabel(t):I(t)?this.killTweensOf(t):(kt(this,t),t===this._recent&&(this._recent=this._last),It(this))},i.totalTime=function(e,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=gt(Me.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,i),this._forcing=0,this):this._tTime},i.addLabel=function(t,e){return this.labels[t]=Zt(this,e),this},i.removeLabel=function(t){return delete this.labels[t],this},i.addPause=function(t,e,i){var n=Qe.delayedCall(0,e||J,i);return n.data="isPause",this._hasPause=1,jt(this,n,Zt(this,t))},i.removePause=function(t){var e=this._first;for(t=Zt(this,t);e;)e._start===t&&"isPause"===e.data&&Pt(e),e=e._next},i.killTweensOf=function(t,e,i){for(var n=this.getTweensOf(t,i),r=n.length;r--;)Ue!==n[r]&&n[r].kill(t,e);return this},i.getTweensOf=function(t,e){for(var i,n=[],r=ie(t),s=this._first,o=D(e);s;)s instanceof Qe?yt(s._targets,r)&&(o?(!Ue||s._initted&&s._ts)&&s.globalTime(0)<=e&&s.globalTime(s.totalDuration())>e:!e||s.isActive())&&n.push(s):(i=s.getTweensOf(r,e)).length&&n.push.apply(n,i),s=s._next;return n},i.tweenTo=function(t,e){e=e||{};var i,n=this,r=Zt(n,t),s=e,o=s.startAt,a=s.onStart,l=s.onStartParams,c=s.immediateRender,h=Qe.to(n,Et({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:e.duration||Math.abs((r-(o&&"time"in o?o.time:n._time))/n.timeScale())||E,onStart:function(){if(n.pause(),!i){var t=e.duration||Math.abs((r-(o&&"time"in o?o.time:n._time))/n.timeScale());h._dur!==t&&qt(h,t,0,1).render(h._time,!0,!0),i=1}a&&a.apply(h,l||[])}},e));return c?h.render(0):h},i.tweenFromTo=function(t,e,i){return this.tweenTo(e,Et({startAt:{time:Zt(this,t)}},i))},i.recent=function(){return this._recent},i.nextLabel=function(t){return void 0===t&&(t=this._time),de(this,Zt(this,t))},i.previousLabel=function(t){return void 0===t&&(t=this._time),de(this,Zt(this,t),1)},i.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+E)},i.shiftChildren=function(t,e,i){void 0===i&&(i=0);for(var n,r=this._first,s=this.labels;r;)r._start>=i&&(r._start+=t,r._end+=t),r=r._next;if(e)for(n in s)s[n]>=i&&(s[n]+=t);return It(this)},i.invalidate=function(e){var i=this._first;for(this._lock=0;i;)i.invalidate(e),i=i._next;return t.prototype.invalidate.call(this,e)},i.clear=function(t){void 0===t&&(t=!0);for(var e,i=this._first;i;)e=i._next,this.remove(i),i=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),It(this)},i.totalDuration=function(t){var e,i,n,r=0,s=this,o=s._last,a=w;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(n=s.parent;o;)e=o._prev,o._dirty&&o.totalDuration(),(i=o._start)>a&&s._sort&&o._ts&&!s._lock?(s._lock=1,jt(s,o,i-o._delay,1)._lock=0):a=i,i<0&&o._ts&&(r-=i,(!n&&!s._dp||n&&n.smoothChildTiming)&&(s._start+=i/s._ts,s._time-=i,s._tTime-=i),s.shiftChildren(-i,!1,-Infinity),a=0),o._end>r&&o._ts&&(r=o._end),o=e;qt(s,s===l&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(t){if(l._ts&&(bt(l,Rt(t,l)),p=Me.frame),Me.frame>=lt){lt+=b.autoSleep||120;var e=l._first;if((!e||!e._ts)&&b.autoSleep&&Me._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Me.sleep()}}},e}(je);Et(Ve.prototype,{_lock:0,_hasPause:0,_forcing:0});var Ue,$e,He=function(t,e,i,n,r,s,o){var a,l,c,h,u,d,p,f,m=new di(this._pt,t,e,0,1,oi,null,r),g=0,_=0;for(m.b=i,m.e=n,i+="",(p=~(n+="").indexOf("random("))&&(n=he(n)),s&&(s(f=[i,n],t,e),i=f[0],n=f[1]),l=i.match($)||[];a=$.exec(n);)h=a[0],u=n.substring(g,a.index),c?c=(c+1)%5:"rgba("===u.substr(-5)&&(c=1),h!==l[_++]&&(d=parseFloat(l[_-1])||0,m._pt={_next:m._pt,p:u||1===_?u:",",s:d,c:"="===h.charAt(1)?_t(d,h)-d:parseFloat(h)-d,m:c&&c<4?Math.round:0},g=$.lastIndex);return m.c=g<n.length?n.substring(g,n.length):"",m.fp=o,(H.test(n)||p)&&(m.e=0),this._pt=m,m},qe=function(t,e,i,n,r,s,o,a,l,c){I(n)&&(n=n(r||0,t,s));var h,u=t[e],d="get"!==i?i:I(u)?l?t[e.indexOf("set")||!I(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():u,p=I(u)?l?ei:ti:Je;if(P(n)&&(~n.indexOf("random(")&&(n=he(n)),"="===n.charAt(1)&&((h=_t(d,n)+(Qt(d)||0))||0===h)&&(n=h)),!c||d!==n||$e)return isNaN(d*n)||""===n?(!u&&!(e in t)&&X(e,n),He.call(this,t,e,d,n,p,a||b.stringFilter,l)):(h=new di(this._pt,t,e,+d||0,n-(d||0),"boolean"==typeof u?si:ri,0,p),l&&(h.fp=l),o&&h.modifier(o,this,t),this._pt=h)},We=function(t,e,i,n,r,s){var o,a,l,c;if(ot[t]&&!1!==(o=new ot[t]).init(r,o.rawVars?e[t]:function(t,e,i,n,r){if(I(t)&&(t=Ye(t,r,e,i,n)),!L(t)||t.style&&t.nodeType||N(t)||B(t))return P(t)?Ye(t,r,e,i,n):t;var s,o={};for(s in t)o[s]=Ye(t[s],r,e,i,n);return o}(e[t],n,r,s,i),i,n,s)&&(i._pt=a=new di(i._pt,r,t,0,1,o.render,o,0,o.priority),i!==f))for(l=i._ptLookup[i._targets.indexOf(r)],c=o._props.length;c--;)l[o._props[c]]=a;return o},Ge=function t(e,i,n){var r,a,c,h,u,d,p,f,m,g,_,y,v,b=e.vars,S=b.ease,T=b.startAt,M=b.immediateRender,A=b.lazy,C=b.onUpdate,k=b.runBackwards,P=b.yoyoEase,I=b.keyframes,D=b.autoRevert,O=e._dur,L=e._startAt,R=e._targets,F=e.parent,B=F&&"nested"===F.data?F.vars.targets:R,N="auto"===e._overwrite&&!s,j=e.timeline;if(j&&(!I||!S)&&(S="none"),e._ease=Le(S,x.ease),e._yEase=P?De(Le(!0===P?S:P,x.ease)):0,P&&e._yoyo&&!e._repeat&&(P=e._yEase,e._yEase=e._ease,e._ease=P),e._from=!j&&!!b.runBackwards,!j||I&&!b.stagger){if(y=(f=R[0]?dt(R[0]).harness:0)&&b[f.prop],r=Mt(b,nt),L&&(L._zTime<0&&L.progress(1),i<0&&k&&M&&!D?L.render(-1,!0):L.revert(k&&O?et:tt),L._lazy=0),T){if(Pt(e._startAt=Qe.set(R,Et({data:"isStart",overwrite:!1,parent:F,immediateRender:!0,lazy:!L&&z(A),startAt:null,delay:0,onUpdate:C&&function(){return pe(e,"onUpdate")},stagger:0},T))),e._startAt._dp=0,e._startAt._sat=e,i<0&&(o||!M&&!D)&&e._startAt.revert(et),M&&O&&i<=0&&n<=0)return void(i&&(e._zTime=i))}else if(k&&O&&!L)if(i&&(M=!1),c=Et({overwrite:!1,data:"isFromStart",lazy:M&&!L&&z(A),immediateRender:M,stagger:0,parent:F},r),y&&(c[f.prop]=y),Pt(e._startAt=Qe.set(R,c)),e._startAt._dp=0,e._startAt._sat=e,i<0&&(o?e._startAt.revert(et):e._startAt.render(-1,!0)),e._zTime=i,M){if(!i)return}else t(e._startAt,E,E);for(e._pt=e._ptCache=0,A=O&&z(A)||A&&!O,a=0;a<R.length;a++){if(p=(u=R[a])._gsap||ut(R)[a]._gsap,e._ptLookup[a]=g={},st[p.id]&&rt.length&&vt(),_=B===R?a:B.indexOf(u),f&&!1!==(m=new f).init(u,y||r,e,_,B)&&(e._pt=h=new di(e._pt,u,m.name,0,1,m.render,m,0,m.priority),m._props.forEach((function(t){g[t]=h})),m.priority&&(d=1)),!f||y)for(c in r)ot[c]&&(m=We(c,r,e,_,u,B))?m.priority&&(d=1):g[c]=h=qe.call(e,u,c,"get",r[c],_,B,0,b.stringFilter);e._op&&e._op[a]&&e.kill(u,e._op[a]),N&&e._pt&&(Ue=e,l.killTweensOf(u,g,e.globalTime(i)),v=!e.parent,Ue=0),e._pt&&A&&(st[p.id]=1)}d&&ui(e),e._onInit&&e._onInit(e)}e._onUpdate=C,e._initted=(!e._op||e._pt)&&!v,I&&i<=0&&j.render(w,!0,!0)},Ze=function(t,e,i,n){var r,s,o=e.ease||n||"power1.inOut";if(N(e))s=i[t]||(i[t]=[]),e.forEach((function(t,i){return s.push({t:i/(e.length-1)*100,v:t,e:o})}));else for(r in e)s=i[r]||(i[r]=[]),"ease"===r||s.push({t:parseFloat(t),v:e[r],e:o})},Ye=function(t,e,i,n,r){return I(t)?t.call(e,i,n,r):P(t)&&~t.indexOf("random(")?he(t):t},Xe=ht+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Ke={};ft(Xe+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return Ke[t]=1}));var Qe=function(t){function e(e,i,r,o){var a;"number"==typeof i&&(r.duration=i,i=r,r=null);var c,h,u,d,p,f,m,g,_=(a=t.call(this,o?i:At(i))||this).vars,y=_.duration,v=_.delay,x=_.immediateRender,w=_.stagger,E=_.overwrite,S=_.keyframes,T=_.defaults,M=_.scrollTrigger,A=_.yoyoEase,C=i.parent||l,k=(N(e)||B(e)?D(e[0]):"length"in i)?[e]:ie(e);if(a._targets=k.length?ut(k):K("GSAP target "+e+" not found. https://gsap.com",!b.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=E,S||w||F(y)||F(v)){if(i=a.vars,(c=a.timeline=new Ve({data:"nested",defaults:T||{},targets:C&&"nested"===C.data?C.vars.targets:k})).kill(),c.parent=c._dp=n(a),c._start=0,w||F(y)||F(v)){if(d=k.length,m=w&&se(w),L(w))for(p in w)~Xe.indexOf(p)&&(g||(g={}),g[p]=w[p]);for(h=0;h<d;h++)(u=Mt(i,Ke)).stagger=0,A&&(u.yoyoEase=A),g&&St(u,g),f=k[h],u.duration=+Ye(y,n(a),h,f,k),u.delay=(+Ye(v,n(a),h,f,k)||0)-a._delay,!w&&1===d&&u.delay&&(a._delay=v=u.delay,a._start+=v,u.delay=0),c.to(f,u,m?m(h,f,k):0),c._ease=Ce.none;c.duration()?y=v=0:a.timeline=0}else if(S){At(Et(c.vars.defaults,{ease:"none"})),c._ease=Le(S.ease||i.ease||"none");var P,I,O,R=0;if(N(S))S.forEach((function(t){return c.to(k,t,">")})),c.duration();else{for(p in u={},S)"ease"===p||"easeEach"===p||Ze(p,S[p],u,S.easeEach);for(p in u)for(P=u[p].sort((function(t,e){return t.t-e.t})),R=0,h=0;h<P.length;h++)(O={ease:(I=P[h]).e,duration:(I.t-(h?P[h-1].t:0))/100*y})[p]=I.v,c.to(k,O,R),R+=O.duration;c.duration()<y&&c.to({},{duration:y-c.duration()})}}y||a.duration(y=c.duration())}else a.timeline=0;return!0!==E||s||(Ue=n(a),l.killTweensOf(k),Ue=0),jt(C,n(a),r),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(x||!y&&!S&&a._start===gt(C._time)&&z(x)&&Ot(n(a))&&"nested"!==C.data)&&(a._tTime=-1e-8,a.render(Math.max(0,-v)||0)),M&&Vt(n(a),M),a}r(e,t);var i=e.prototype;return i.render=function(t,e,i){var n,r,s,a,l,c,h,u,d,p=this._time,f=this._tDur,m=this._dur,g=t<0,_=t>f-E&&!g?f:t<E?0:t;if(m){if(_!==this._tTime||!t||i||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==g){if(n=_,u=this.timeline,this._repeat){if(a=m+this._rDelay,this._repeat<-1&&g)return this.totalTime(100*a+t,e,i);if(n=gt(_%a),_===f?(s=this._repeat,n=m):((s=~~(_/a))&&s===gt(_/a)&&(n=m,s--),n>m&&(n=m)),(c=this._yoyo&&1&s)&&(d=this._yEase,n=m-n),l=zt(this._tTime,a),n===p&&!i&&this._initted&&s===l)return this._tTime=_,this;s!==l&&(u&&this._yEase&&Oe(u,c),this.vars.repeatRefresh&&!c&&!this._lock&&this._time!==m&&this._initted&&(this._lock=i=1,this.render(gt(a*s),!0).invalidate()._lock=0))}if(!this._initted){if(Ut(this,g?t:n,i,e,_))return this._tTime=0,this;if(!(p===this._time||i&&this.vars.repeatRefresh&&s!==l))return this;if(m!==this._dur)return this.render(t,e,i)}if(this._tTime=_,this._time=n,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(d||this._ease)(n/m),this._from&&(this.ratio=h=1-h),n&&!p&&!e&&!s&&(pe(this,"onStart"),this._tTime!==_))return this;for(r=this._pt;r;)r.r(h,r.d),r=r._next;u&&u.render(t<0?t:!n&&c?-1e-8:u._dur*u._ease(n/this._dur),e,i)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(g&&Dt(this,t,0,i),pe(this,"onUpdate")),this._repeat&&s!==l&&this.vars.onRepeat&&!e&&this.parent&&pe(this,"onRepeat"),_!==this._tDur&&_||this._tTime!==_||(g&&!this._onUpdate&&Dt(this,t,0,!0),(t||!m)&&(_===this._tDur&&this._ts>0||!_&&this._ts<0)&&Pt(this,1),e||g&&!p||!(_||p||c)||(pe(this,_===f?"onComplete":"onReverseComplete",!0),this._prom&&!(_<f&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,i,n){var r,s,a,l=t.ratio,c=e<0||!e&&(!t._start&&$t(t)&&(t._initted||!Ht(t))||(t._ts<0||t._dp._ts<0)&&!Ht(t))?0:1,h=t._rDelay,u=0;if(h&&t._repeat&&(u=Kt(0,t._tDur,e),s=zt(u,h),t._yoyo&&1&s&&(c=1-c),s!==zt(t._tTime,h)&&(l=1-c,t.vars.repeatRefresh&&t._initted&&t.invalidate())),c!==l||o||n||t._zTime===E||!e&&t._zTime){if(!t._initted&&Ut(t,e,n,i,u))return;for(a=t._zTime,t._zTime=e||(i?E:0),i||(i=e&&!a),t.ratio=c,t._from&&(c=1-c),t._time=0,t._tTime=u,r=t._pt;r;)r.r(c,r.d),r=r._next;e<0&&Dt(t,e,0,!0),t._onUpdate&&!i&&pe(t,"onUpdate"),u&&t._repeat&&!i&&t.parent&&pe(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===c&&(c&&Pt(t,1),i||o||(pe(t,c?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,i);return this},i.targets=function(){return this._targets},i.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},i.resetTo=function(t,e,i,n,r){m||Me.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Ge(this,s),function(t,e,i,n,r,s,o,a){var l,c,h,u,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],h=t._ptLookup,u=t._targets.length;u--;){if((l=h[u][e])&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==e&&l.fp!==e;)l=l._next;if(!l)return $e=1,t.vars[e]="+=0",Ge(t,o),$e=0,a?K(e+" not eligible for reset"):1;d.push(l)}for(u=d.length;u--;)(l=(c=d[u])._pt||c).s=!n&&0!==n||r?l.s+(n||0)+s*l.c:n,l.c=i-l.s,c.e&&(c.e=mt(i)+Qt(c.e)),c.b&&(c.b=l.s+Qt(c.b))}(this,t,e,i,n,this._ease(s/this._dur),s,r)?this.resetTo(t,e,i,n,1):(Bt(this,0),this.parent||Ct(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},i.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?fe(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Ue&&!0!==Ue.vars.overwrite)._first||fe(this),this.parent&&i!==this.timeline.totalDuration()&&qt(this,this._dur*this.timeline._tDur/i,0,1),this}var n,r,s,o,a,l,c,h=this._targets,u=t?ie(t):h,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0}(h,u))return"all"===e&&(this._pt=0),fe(this);for(n=this._op=this._op||[],"all"!==e&&(P(e)&&(a={},ft(e,(function(t){return a[t]=1})),e=a),e=function(t,e){var i,n,r,s,o=t[0]?dt(t[0]).harness:0,a=o&&o.aliases;if(!a)return e;for(n in i=St({},e),a)if(n in i)for(r=(s=a[n].split(",")).length;r--;)i[s[r]]=i[n];return i}(h,e)),c=h.length;c--;)if(~u.indexOf(h[c]))for(a in r=d[c],"all"===e?(n[c]=e,o=r,s={}):(s=n[c]=n[c]||{},o=e),o)(l=r&&r[a])&&("kill"in l.d&&!0!==l.d.kill(a)||kt(this,l,"_pt"),delete r[a]),"all"!==s&&(s[a]=1);return this._initted&&!this._pt&&p&&fe(this),this},e.to=function(t,i){return new e(t,i,arguments[2])},e.from=function(t,e){return Yt(1,arguments)},e.delayedCall=function(t,i,n,r){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:r})},e.fromTo=function(t,e,i){return Yt(2,arguments)},e.set=function(t,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(t,i)},e.killTweensOf=function(t,e,i){return l.killTweensOf(t,e,i)},e}(je);Et(Qe.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ft("staggerTo,staggerFrom,staggerFromTo",(function(t){Qe[t]=function(){var e=new Ve,i=Jt.call(arguments,0);return i.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,i)}}));var Je=function(t,e,i){return t[e]=i},ti=function(t,e,i){return t[e](i)},ei=function(t,e,i,n){return t[e](n.fp,i)},ii=function(t,e,i){return t.setAttribute(e,i)},ni=function(t,e){return I(t[e])?ti:O(t[e])&&t.setAttribute?ii:Je},ri=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},si=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},oi=function(t,e){var i=e._pt,n="";if(!t&&e.b)n=e.b;else if(1===t&&e.e)n=e.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*t):Math.round(1e4*(i.s+i.c*t))/1e4)+n,i=i._next;n+=e.c}e.set(e.t,e.p,n,e)},ai=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},li=function(t,e,i,n){for(var r,s=this._pt;s;)r=s._next,s.p===n&&s.modifier(t,e,i),s=r},ci=function(t){for(var e,i,n=this._pt;n;)i=n._next,n.p===t&&!n.op||n.op===t?kt(this,n,"_pt"):n.dep||(e=1),n=i;return!e},hi=function(t,e,i,n){n.mSet(t,e,n.m.call(n.tween,i,n.mt),n)},ui=function(t){for(var e,i,n,r,s=t._pt;s;){for(e=s._next,i=n;i&&i.pr>s.pr;)i=i._next;(s._prev=i?i._prev:r)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:r=s,s=e}t._pt=n},di=function(){function t(t,e,i,n,r,s,o,a,l){this.t=e,this.s=n,this.c=r,this.p=i,this.r=s||ri,this.d=o||this,this.set=a||Je,this.pr=l||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,i){this.mSet=this.mSet||this.set,this.set=hi,this.m=t,this.mt=i,this.tween=e},t}();ft(ht+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return nt[t]=1})),G.TweenMax=G.TweenLite=Qe,G.TimelineLite=G.TimelineMax=Ve,l=new Ve({sortChildren:!1,defaults:x,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),b.stringFilter=Te;var pi=[],fi={},mi=[],gi=0,_i=0,yi=function(t){return(fi[t]||mi).map((function(t){return t()}))},vi=function(){var t=Date.now(),e=[];t-gi>2&&(yi("matchMediaInit"),pi.forEach((function(t){var i,n,r,s,o=t.queries,a=t.conditions;for(n in o)(i=c.matchMedia(o[n]).matches)&&(r=1),i!==a[n]&&(a[n]=i,s=1);s&&(t.revert(),r&&e.push(t))})),yi("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),gi=t,yi("matchMedia"))},bi=function(){function t(t,e){this.selector=e&&ne(e),this.data=[],this._r=[],this.isReverted=!1,this.id=_i++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,i){I(t)&&(i=e,e=t,t=I);var n=this,r=function(){var t,r=a,s=n.selector;return r&&r!==n&&r.data.push(n),i&&(n.selector=ne(i)),a=n,t=e.apply(n,arguments),I(t)&&n._r.push(t),a=r,n.selector=s,n.isReverted=!1,t};return n.last=r,t===I?r(n,(function(t){return n.add(null,t)})):t?n[t]=r:r},e.ignore=function(t){var e=a;a=null,t(this),a=e},e.getTweens=function(){var e=[];return this.data.forEach((function(i){return i instanceof t?e.push.apply(e,i.getTweens()):i instanceof Qe&&!(i.parent&&"nested"===i.parent.data)&&e.push(i)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var i=this;if(t?function(){for(var e,n=i.getTweens(),r=i.data.length;r--;)"isFlip"===(e=i.data[r]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return n.splice(n.indexOf(t),1)})));for(n.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t:t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),r=i.data.length;r--;)(e=i.data[r])instanceof Ve?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof Qe)&&e.revert&&e.revert(t);i._r.forEach((function(e){return e(t,i)})),i.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var n=pi.length;n--;)pi[n].id===this.id&&pi.splice(n,1)},e.revert=function(t){this.kill(t||{})},t}(),xi=function(){function t(t){this.contexts=[],this.scope=t}var e=t.prototype;return e.add=function(t,e,i){L(t)||(t={matches:t});var n,r,s,o=new bi(0,i||this.scope),l=o.conditions={};for(r in a&&!o.selector&&(o.selector=a.selector),this.contexts.push(o),e=o.add("onMatch",e),o.queries=t,t)"all"===r?s=1:(n=c.matchMedia(t[r]))&&(pi.indexOf(o)<0&&pi.push(o),(l[r]=n.matches)&&(s=1),n.addListener?n.addListener(vi):n.addEventListener("change",vi));return s&&e(o,(function(t){return o.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),wi={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach((function(t){return ge(t)}))},timeline:function(t){return new Ve(t)},getTweensOf:function(t,e){return l.getTweensOf(t,e)},getProperty:function(t,e,i,n){P(t)&&(t=ie(t)[0]);var r=dt(t||{}).get,s=i?wt:xt;return"native"===i&&(i=""),t?e?s((ot[e]&&ot[e].get||r)(t,e,i,n)):function(e,i,n){return s((ot[e]&&ot[e].get||r)(t,e,i,n))}:t},quickSetter:function(t,e,i){if((t=ie(t)).length>1){var n=t.map((function(t){return Ti.quickSetter(t,e,i)})),r=n.length;return function(t){for(var e=r;e--;)n[e](t)}}t=t[0]||{};var s=ot[e],o=dt(t),a=o.harness&&(o.harness.aliases||{})[e]||e,l=s?function(e){var n=new s;f._pt=0,n.init(t,i?e+i:e,f,0,[t]),n.render(1,n),f._pt&&ai(1,f)}:o.set(t,a);return s?l:function(e){return l(t,a,i?e+i:e,o,1)}},quickTo:function(t,e,i){var n,r=Ti.to(t,St(((n={})[e]="+=0.1",n.paused=!0,n),i||{})),s=function(t,i,n){return r.resetTo(e,t,i,n)};return s.tween=r,s},isTweening:function(t){return l.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Le(t.ease,x.ease)),Tt(x,t||{})},config:function(t){return Tt(b,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,n=t.plugins,r=t.defaults,s=t.extendTimeline;(n||"").split(",").forEach((function(t){return t&&!ot[t]&&!G[t]&&K(e+" effect requires "+t+" plugin.")})),at[e]=function(t,e,n){return i(ie(t),Et(e||{},r),n)},s&&(Ve.prototype[e]=function(t,i,n){return this.add(at[e](t,L(i)?i:(n=i)&&{},this),n)})},registerEase:function(t,e){Ce[t]=Le(e)},parseEase:function(t,e){return arguments.length?Le(t,e):Ce},getById:function(t){return l.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var i,n,r=new Ve(t);for(r.smoothChildTiming=z(t.smoothChildTiming),l.remove(r),r._dp=0,r._time=r._tTime=l._time,i=l._first;i;)n=i._next,!e&&!i._dur&&i instanceof Qe&&i.vars.onComplete===i._targets[0]||jt(r,i,i._start-i._delay),i=n;return jt(l,r,0),r},context:function(t,e){return t?new bi(t,e):a},matchMedia:function(t){return new xi(t)},matchMediaRefresh:function(){return pi.forEach((function(t){var e,i,n=t.conditions;for(i in n)n[i]&&(n[i]=!1,e=1);e&&t.revert()}))||vi()},addEventListener:function(t,e){var i=fi[t]||(fi[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=fi[t],n=i&&i.indexOf(e);n>=0&&i.splice(n,1)},utils:{wrap:function t(e,i,n){var r=i-e;return N(e)?ce(e,t(0,e.length),i):Xt(n,(function(t){return(r+(t-e)%r)%r+e}))},wrapYoyo:function t(e,i,n){var r=i-e,s=2*r;return N(e)?ce(e,t(0,e.length-1),i):Xt(n,(function(t){return e+((t=(s+(t-e)%s)%s||0)>r?s-t:t)}))},distribute:se,random:le,snap:ae,normalize:function(t,e,i){return ue(t,e,0,1,i)},getUnit:Qt,clamp:function(t,e,i){return Xt(i,(function(i){return Kt(t,e,i)}))},splitColor:be,toArray:ie,selector:ne,mapRange:ue,pipe:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(i){return t(parseFloat(i))+(e||Qt(i))}},interpolate:function t(e,i,n,r){var s=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!s){var o,a,l,c,h,u=P(e),d={};if(!0===n&&(r=1)&&(n=null),u)e={p:e},i={p:i};else if(N(e)&&!N(i)){for(l=[],c=e.length,h=c-2,a=1;a<c;a++)l.push(t(e[a-1],e[a]));c--,s=function(t){t*=c;var e=Math.min(h,~~t);return l[e](t-e)},n=i}else r||(e=St(N(e)?[]:{},e));if(!l){for(o in i)qe.call(d,e,o,"get",i[o]);s=function(t){return ai(t,d)||(u?e.p:e)}}}return Xt(n,s)},shuffle:re},install:Y,effects:at,ticker:Me,updateRoot:Ve.updateRoot,plugins:ot,globalTimeline:l,core:{PropTween:di,globals:Q,Tween:Qe,Timeline:Ve,Animation:je,getCache:dt,_removeLinkedListItem:kt,reverting:function(){return o},context:function(t){return t&&a&&(a.data.push(t),t._ctx=a),a},suppressOverwrites:function(t){return s=t}}};ft("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return wi[t]=Qe[t]})),Me.add(Ve.updateRoot),f=wi.to({},{duration:0});var Ei=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},Si=function(t,e){return{name:t,rawVars:1,init:function(t,i,n){n._onInit=function(t){var n,r;if(P(i)&&(n={},ft(i,(function(t){return n[t]=1})),i=n),e){for(r in n={},i)n[r]=e(i[r]);i=n}!function(t,e){var i,n,r,s=t._targets;for(i in e)for(n=s.length;n--;)(r=t._ptLookup[n][i])&&(r=r.d)&&(r._pt&&(r=Ei(r,i)),r&&r.modifier&&r.modifier(e[i],t,s[n],i))}(t,i)}}}},Ti=wi.registerPlugin({name:"attr",init:function(t,e,i,n,r){var s,o,a;for(s in this.tween=i,e)a=t.getAttribute(s)||"",(o=this.add(t,"setAttribute",(a||0)+"",e[s],n,r,0,0,s)).op=s,o.b=a,this._props.push(s)},render:function(t,e){for(var i=e._pt;i;)o?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},Si("roundProps",oe),Si("modifiers"),Si("snap",ae))||wi;Qe.version=Ve.version=Ti.version="3.12.4",d=1,R()&&Ae();Ce.Power0,Ce.Power1,Ce.Power2,Ce.Power3,Ce.Power4,Ce.Linear,Ce.Quad,Ce.Cubic,Ce.Quart,Ce.Quint,Ce.Strong,Ce.Elastic,Ce.Back,Ce.SteppedEase,Ce.Bounce,Ce.Sine,Ce.Expo,Ce.Circ;var Mi,Ai,Ci,ki,Pi,Ii,Di,Oi,Li={},zi=180/Math.PI,Ri=Math.PI/180,Fi=Math.atan2,Bi=/([A-Z])/g,Ni=/(left|right|width|margin|padding|x)/i,ji=/[\s,\(]\S/,Vi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Ui=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},$i=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Hi=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},qi=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},Wi=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Gi=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},Zi=function(t,e,i){return t.style[e]=i},Yi=function(t,e,i){return t.style.setProperty(e,i)},Xi=function(t,e,i){return t._gsap[e]=i},Ki=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},Qi=function(t,e,i,n,r){var s=t._gsap;s.scaleX=s.scaleY=i,s.renderTransform(r,s)},Ji=function(t,e,i,n,r){var s=t._gsap;s[e]=i,s.renderTransform(r,s)},tn="transform",en=tn+"Origin",nn=function t(e,i){var n=this,r=this.target,s=r.style,o=r._gsap;if(e in Li&&s){if(this.tfm=this.tfm||{},"transform"===e)return Vi.transform.split(",").forEach((function(e){return t.call(n,e,i)}));if(~(e=Vi[e]||e).indexOf(",")?e.split(",").forEach((function(t){return n.tfm[t]=xn(r,t)})):this.tfm[e]=o.x?o[e]:xn(r,e),e===en&&(this.tfm.zOrigin=o.zOrigin),this.props.indexOf(tn)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(en,i,"")),e=tn}(s||i)&&this.props.push(e,i,s[e])},rn=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},sn=function(){var t,e,i=this.props,n=this.target,r=n.style,s=n._gsap;for(t=0;t<i.length;t+=3)i[t+1]?n[i[t]]=i[t+2]:i[t+2]?r[i[t]]=i[t+2]:r.removeProperty("--"===i[t].substr(0,2)?i[t]:i[t].replace(Bi,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(t=Di())&&t.isStart||r[tn]||(rn(r),s.zOrigin&&r[en]&&(r[en]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},on=function(t,e){var i={target:t,props:[],revert:sn,save:nn};return t._gsap||Ti.core.getCache(t),e&&e.split(",").forEach((function(t){return i.save(t)})),i},an=function(t,e){var i=Ai.createElementNS?Ai.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ai.createElement(t);return i&&i.style?i:Ai.createElement(t)},ln=function t(e,i,n){var r=getComputedStyle(e);return r[i]||r.getPropertyValue(i.replace(Bi,"-$1").toLowerCase())||r.getPropertyValue(i)||!n&&t(e,hn(i)||i,1)||""},cn="O,Moz,ms,Ms,Webkit".split(","),hn=function(t,e,i){var n=(e||Pi).style,r=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);r--&&!(cn[r]+t in n););return r<0?null:(3===r?"ms":r>=0?cn[r]:"")+t},un=function(){"undefined"!=typeof window&&window.document&&(Mi=window,Ai=Mi.document,Ci=Ai.documentElement,Pi=an("div")||{style:{}},an("div"),tn=hn(tn),en=tn+"Origin",Pi.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Oi=!!hn("perspective"),Di=Ti.core.reverting,ki=1)},dn=function t(e){var i,n=an("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,s=this.nextSibling,o=this.style.cssText;if(Ci.appendChild(n),n.appendChild(this),this.style.display="block",e)try{i=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(i=this._gsapBBox());return r&&(s?r.insertBefore(this,s):r.appendChild(this)),Ci.removeChild(n),this.style.cssText=o,i},pn=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},fn=function(t){var e;try{e=t.getBBox()}catch(i){e=dn.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===dn||(e=dn.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+pn(t,["x","cx","x1"])||0,y:+pn(t,["y","cy","y1"])||0,width:0,height:0}},mn=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!fn(t))},gn=function(t,e){if(e){var i,n=t.style;e in Li&&e!==en&&(e=tn),n.removeProperty?("ms"!==(i=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty("--"===i?e:e.replace(Bi,"-$1").toLowerCase())):n.removeAttribute(e)}},_n=function(t,e,i,n,r,s){var o=new di(t._pt,e,i,0,1,s?Gi:Wi);return t._pt=o,o.b=n,o.e=r,t._props.push(i),o},yn={deg:1,rad:1,turn:1},vn={grid:1,flex:1},bn=function t(e,i,n,r){var s,o,a,l,c=parseFloat(n)||0,h=(n+"").trim().substr((c+"").length)||"px",u=Pi.style,d=Ni.test(i),p="svg"===e.tagName.toLowerCase(),f=(p?"client":"offset")+(d?"Width":"Height"),m=100,g="px"===r,_="%"===r;if(r===h||!c||yn[r]||yn[h])return c;if("px"!==h&&!g&&(c=t(e,i,n,"px")),l=e.getCTM&&mn(e),(_||"%"===h)&&(Li[i]||~i.indexOf("adius")))return s=l?e.getBBox()[d?"width":"height"]:e[f],mt(_?c/s*m:c/100*s);if(u[d?"width":"height"]=m+(g?h:r),o=~i.indexOf("adius")||"em"===r&&e.appendChild&&!p?e:e.parentNode,l&&(o=(e.ownerSVGElement||{}).parentNode),o&&o!==Ai&&o.appendChild||(o=Ai.body),(a=o._gsap)&&_&&a.width&&d&&a.time===Me.time&&!a.uncache)return mt(c/a.width*m);if(!_||"height"!==i&&"width"!==i)(_||"%"===h)&&!vn[ln(o,"display")]&&(u.position=ln(e,"position")),o===e&&(u.position="static"),o.appendChild(Pi),s=Pi[f],o.removeChild(Pi),u.position="absolute";else{var y=e.style[i];e.style[i]=m+r,s=e[f],y?e.style[i]=y:gn(e,i)}return d&&_&&((a=dt(o)).time=Me.time,a.width=o[f]),mt(g?s*c/m:s&&c?m/s*c:0)},xn=function(t,e,i,n){var r;return ki||un(),e in Vi&&"transform"!==e&&~(e=Vi[e]).indexOf(",")&&(e=e.split(",")[0]),Li[e]&&"transform"!==e?(r=Dn(t,n),r="transformOrigin"!==e?r[e]:r.svg?r.origin:On(ln(t,en))+" "+r.zOrigin+"px"):(!(r=t.style[e])||"auto"===r||n||~(r+"").indexOf("calc("))&&(r=Tn[e]&&Tn[e](t,e,i)||ln(t,e)||pt(t,e)||("opacity"===e?1:0)),i&&!~(r+"").trim().indexOf(" ")?bn(t,e,r,i)+i:r},wn=function(t,e,i,n){if(!i||"none"===i){var r=hn(e,t,1),s=r&&ln(t,r,1);s&&s!==i?(e=r,i=s):"borderColor"===e&&(i=ln(t,"borderTopColor"))}var o,a,l,c,h,u,d,p,f,m,g,_=new di(this._pt,t.style,e,0,1,oi),y=0,v=0;if(_.b=i,_.e=n,i+="","auto"===(n+="")&&(u=t.style[e],t.style[e]=n,n=ln(t,e)||n,u?t.style[e]=u:gn(t,e)),Te(o=[i,n]),n=o[1],l=(i=o[0]).match(U)||[],(n.match(U)||[]).length){for(;a=U.exec(n);)d=a[0],f=n.substring(y,a.index),h?h=(h+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(h=1),d!==(u=l[v++]||"")&&(c=parseFloat(u)||0,g=u.substr((c+"").length),"="===d.charAt(1)&&(d=_t(c,d)+g),p=parseFloat(d),m=d.substr((p+"").length),y=U.lastIndex-m.length,m||(m=m||b.units[e]||g,y===n.length&&(n+=m,_.e+=m)),g!==m&&(c=bn(t,e,u,m)||0),_._pt={_next:_._pt,p:f||1===v?f:",",s:c,c:p-c,m:h&&h<4||"zIndex"===e?Math.round:0});_.c=y<n.length?n.substring(y,n.length):""}else _.r="display"===e&&"none"===n?Gi:Wi;return H.test(n)&&(_.e=0),this._pt=_,_},En={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Sn=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i,n,r,s=e.t,o=s.style,a=e.u,l=s._gsap;if("all"===a||!0===a)o.cssText="",n=1;else for(r=(a=a.split(",")).length;--r>-1;)i=a[r],Li[i]&&(n=1,i="transformOrigin"===i?en:tn),gn(s,i);n&&(gn(s,tn),l&&(l.svg&&s.removeAttribute("transform"),Dn(s,1),l.uncache=1,rn(o)))}},Tn={clearProps:function(t,e,i,n,r){if("isFromStart"!==r.data){var s=t._pt=new di(t._pt,e,i,0,0,Sn);return s.u=n,s.pr=-10,s.tween=r,t._props.push(i),1}}},Mn=[1,0,0,1,0,0],An={},Cn=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},kn=function(t){var e=ln(t,tn);return Cn(e)?Mn:e.substr(7).match(V).map(mt)},Pn=function(t,e){var i,n,r,s,o=t._gsap||dt(t),a=t.style,l=kn(t);return o.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(r=t.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?Mn:l:(l!==Mn||t.offsetParent||t===Ci||o.svg||(r=a.display,a.display="block",(i=t.parentNode)&&t.offsetParent||(s=1,n=t.nextElementSibling,Ci.appendChild(t)),l=kn(t),r?a.display=r:gn(t,"display"),s&&(n?i.insertBefore(t,n):i?i.appendChild(t):Ci.removeChild(t))),e&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},In=function(t,e,i,n,r,s){var o,a,l,c=t._gsap,h=r||Pn(t,!0),u=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,f=c.yOffset||0,m=h[0],g=h[1],_=h[2],y=h[3],v=h[4],b=h[5],x=e.split(" "),w=parseFloat(x[0])||0,E=parseFloat(x[1])||0;i?h!==Mn&&(a=m*y-g*_)&&(l=w*(-g/a)+E*(m/a)-(m*b-g*v)/a,w=w*(y/a)+E*(-_/a)+(_*b-y*v)/a,E=l):(w=(o=fn(t)).x+(~x[0].indexOf("%")?w/100*o.width:w),E=o.y+(~(x[1]||x[0]).indexOf("%")?E/100*o.height:E)),n||!1!==n&&c.smooth?(v=w-u,b=E-d,c.xOffset=p+(v*m+b*_)-v,c.yOffset=f+(v*g+b*y)-b):c.xOffset=c.yOffset=0,c.xOrigin=w,c.yOrigin=E,c.smooth=!!n,c.origin=e,c.originIsAbsolute=!!i,t.style[en]="0px 0px",s&&(_n(s,c,"xOrigin",u,w),_n(s,c,"yOrigin",d,E),_n(s,c,"xOffset",p,c.xOffset),_n(s,c,"yOffset",f,c.yOffset)),t.setAttribute("data-svg-origin",w+" "+E)},Dn=function(t,e){var i=t._gsap||new Ne(t);if("x"in i&&!e&&!i.uncache)return i;var n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,x,w,E,S,T,M,A,C,k,P,I,D,O,L,z,R=t.style,F=i.scaleX<0,B="px",N="deg",j=getComputedStyle(t),V=ln(t,en)||"0";return n=r=s=l=c=h=u=d=p=0,o=a=1,i.svg=!(!t.getCTM||!mn(t)),j.translate&&("none"===j.translate&&"none"===j.scale&&"none"===j.rotate||(R[tn]=("none"!==j.translate?"translate3d("+(j.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==j.rotate?"rotate("+j.rotate+") ":"")+("none"!==j.scale?"scale("+j.scale.split(" ").join(",")+") ":"")+("none"!==j[tn]?j[tn]:"")),R.scale=R.rotate=R.translate="none"),g=Pn(t,i.svg),i.svg&&(i.uncache?(C=t.getBBox(),V=i.xOrigin-C.x+"px "+(i.yOrigin-C.y)+"px",A=""):A=!e&&t.getAttribute("data-svg-origin"),In(t,A||V,!!A||i.originIsAbsolute,!1!==i.smooth,g)),f=i.xOrigin||0,m=i.yOrigin||0,g!==Mn&&(x=g[0],w=g[1],E=g[2],S=g[3],n=T=g[4],r=M=g[5],6===g.length?(o=Math.sqrt(x*x+w*w),a=Math.sqrt(S*S+E*E),l=x||w?Fi(w,x)*zi:0,(u=E||S?Fi(E,S)*zi+l:0)&&(a*=Math.abs(Math.cos(u*Ri))),i.svg&&(n-=f-(f*x+m*E),r-=m-(f*w+m*S))):(z=g[6],O=g[7],P=g[8],I=g[9],D=g[10],L=g[11],n=g[12],r=g[13],s=g[14],c=(_=Fi(z,D))*zi,_&&(A=T*(y=Math.cos(-_))+P*(v=Math.sin(-_)),C=M*y+I*v,k=z*y+D*v,P=T*-v+P*y,I=M*-v+I*y,D=z*-v+D*y,L=O*-v+L*y,T=A,M=C,z=k),h=(_=Fi(-E,D))*zi,_&&(y=Math.cos(-_),L=S*(v=Math.sin(-_))+L*y,x=A=x*y-P*v,w=C=w*y-I*v,E=k=E*y-D*v),l=(_=Fi(w,x))*zi,_&&(A=x*(y=Math.cos(_))+w*(v=Math.sin(_)),C=T*y+M*v,w=w*y-x*v,M=M*y-T*v,x=A,T=C),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,h=180-h),o=mt(Math.sqrt(x*x+w*w+E*E)),a=mt(Math.sqrt(M*M+z*z)),_=Fi(T,M),u=Math.abs(_)>2e-4?_*zi:0,p=L?1/(L<0?-L:L):0),i.svg&&(A=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Cn(ln(t,tn)),A&&t.setAttribute("transform",A))),Math.abs(u)>90&&Math.abs(u)<270&&(F?(o*=-1,u+=l<=0?180:-180,l+=l<=0?180:-180):(a*=-1,u+=u<=0?180:-180)),e=e||i.uncache,i.x=n-((i.xPercent=n&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+B,i.y=r-((i.yPercent=r&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-r)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+B,i.z=s+B,i.scaleX=mt(o),i.scaleY=mt(a),i.rotation=mt(l)+N,i.rotationX=mt(c)+N,i.rotationY=mt(h)+N,i.skewX=u+N,i.skewY=d+N,i.transformPerspective=p+B,(i.zOrigin=parseFloat(V.split(" ")[2])||!e&&i.zOrigin||0)&&(R[en]=On(V)),i.xOffset=i.yOffset=0,i.force3D=b.force3D,i.renderTransform=i.svg?jn:Oi?Nn:zn,i.uncache=0,i},On=function(t){return(t=t.split(" "))[0]+" "+t[1]},Ln=function(t,e,i){var n=Qt(e);return mt(parseFloat(e)+parseFloat(bn(t,"x",i+"px",n)))+n},zn=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Nn(t,e)},Rn="0deg",Fn="0px",Bn=") ",Nn=function(t,e){var i=e||this,n=i.xPercent,r=i.yPercent,s=i.x,o=i.y,a=i.z,l=i.rotation,c=i.rotationY,h=i.rotationX,u=i.skewX,d=i.skewY,p=i.scaleX,f=i.scaleY,m=i.transformPerspective,g=i.force3D,_=i.target,y=i.zOrigin,v="",b="auto"===g&&t&&1!==t||!0===g;if(y&&(h!==Rn||c!==Rn)){var x,w=parseFloat(c)*Ri,E=Math.sin(w),S=Math.cos(w);w=parseFloat(h)*Ri,x=Math.cos(w),s=Ln(_,s,E*x*-y),o=Ln(_,o,-Math.sin(w)*-y),a=Ln(_,a,S*x*-y+y)}m!==Fn&&(v+="perspective("+m+Bn),(n||r)&&(v+="translate("+n+"%, "+r+"%) "),(b||s!==Fn||o!==Fn||a!==Fn)&&(v+=a!==Fn||b?"translate3d("+s+", "+o+", "+a+") ":"translate("+s+", "+o+Bn),l!==Rn&&(v+="rotate("+l+Bn),c!==Rn&&(v+="rotateY("+c+Bn),h!==Rn&&(v+="rotateX("+h+Bn),u===Rn&&d===Rn||(v+="skew("+u+", "+d+Bn),1===p&&1===f||(v+="scale("+p+", "+f+Bn),_.style[tn]=v||"translate(0, 0)"},jn=function(t,e){var i,n,r,s,o,a=e||this,l=a.xPercent,c=a.yPercent,h=a.x,u=a.y,d=a.rotation,p=a.skewX,f=a.skewY,m=a.scaleX,g=a.scaleY,_=a.target,y=a.xOrigin,v=a.yOrigin,b=a.xOffset,x=a.yOffset,w=a.forceCSS,E=parseFloat(h),S=parseFloat(u);d=parseFloat(d),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),d+=f),d||p?(d*=Ri,p*=Ri,i=Math.cos(d)*m,n=Math.sin(d)*m,r=Math.sin(d-p)*-g,s=Math.cos(d-p)*g,p&&(f*=Ri,o=Math.tan(p-f),r*=o=Math.sqrt(1+o*o),s*=o,f&&(o=Math.tan(f),i*=o=Math.sqrt(1+o*o),n*=o)),i=mt(i),n=mt(n),r=mt(r),s=mt(s)):(i=m,s=g,n=r=0),(E&&!~(h+"").indexOf("px")||S&&!~(u+"").indexOf("px"))&&(E=bn(_,"x",h,"px"),S=bn(_,"y",u,"px")),(y||v||b||x)&&(E=mt(E+y-(y*i+v*r)+b),S=mt(S+v-(y*n+v*s)+x)),(l||c)&&(o=_.getBBox(),E=mt(E+l/100*o.width),S=mt(S+c/100*o.height)),o="matrix("+i+","+n+","+r+","+s+","+E+","+S+")",_.setAttribute("transform",o),w&&(_.style[tn]=o)},Vn=function(t,e,i,n,r){var s,o,a=360,l=P(r),c=parseFloat(r)*(l&&~r.indexOf("rad")?zi:1)-n,h=n+c+"deg";return l&&("short"===(s=r.split("_")[1])&&(c%=a)!==c%180&&(c+=c<0?a:-360),"cw"===s&&c<0?c=(c+36e9)%a-~~(c/a)*a:"ccw"===s&&c>0&&(c=(c-36e9)%a-~~(c/a)*a)),t._pt=o=new di(t._pt,e,i,n,c,$i),o.e=h,o.u="deg",t._props.push(i),o},Un=function(t,e){for(var i in e)t[i]=e[i];return t},$n=function(t,e,i){var n,r,s,o,a,l,c,h=Un({},i._gsap),u=i.style;for(r in h.svg?(s=i.getAttribute("transform"),i.setAttribute("transform",""),u[tn]=e,n=Dn(i,1),gn(i,tn),i.setAttribute("transform",s)):(s=getComputedStyle(i)[tn],u[tn]=e,n=Dn(i,1),u[tn]=s),Li)(s=h[r])!==(o=n[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(a=Qt(s)!==(c=Qt(o))?bn(i,r,s,c):parseFloat(s),l=parseFloat(o),t._pt=new di(t._pt,n,r,a,l-a,Ui),t._pt.u=c||0,t._props.push(r));Un(n,h)};ft("padding,margin,Width,Radius",(function(t,e){var i="Top",n="Right",r="Bottom",s="Left",o=(e<3?[i,n,r,s]:[i+s,i+n,r+n,r+s]).map((function(i){return e<2?t+i:"border"+i+t}));Tn[e>1?"border"+t:t]=function(t,e,i,n,r){var s,a;if(arguments.length<4)return s=o.map((function(e){return xn(t,e,i)})),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(n+"").split(" "),a={},o.forEach((function(t,e){return a[t]=s[e]=s[e]||s[(e-1)/2|0]})),t.init(e,a,r)}}));var Hn,qn,Wn,Gn={name:"css",register:un,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,n,r){var s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,x,w,E,S,T,M=this._props,A=t.style,C=i.vars.startAt;for(u in ki||un(),this.styles=this.styles||on(t),x=this.styles.props,this.tween=i,e)if("autoRound"!==u&&(o=e[u],!ot[u]||!We(u,e,i,n,t,r)))if(c=typeof o,h=Tn[u],"function"===c&&(c=typeof(o=o.call(i,n,t,r))),"string"===c&&~o.indexOf("random(")&&(o=he(o)),h)h(this,t,u,o,i)&&(v=1);else if("--"===u.substr(0,2))s=(getComputedStyle(t).getPropertyValue(u)+"").trim(),o+="",Ee.lastIndex=0,Ee.test(s)||(d=Qt(s),p=Qt(o)),p?d!==p&&(s=bn(t,u,s,p)+p):d&&(o+=d),this.add(A,"setProperty",s,o,n,r,0,0,u),M.push(u),x.push(u,0,A[u]);else if("undefined"!==c){if(C&&u in C?(s="function"==typeof C[u]?C[u].call(i,n,t,r):C[u],P(s)&&~s.indexOf("random(")&&(s=he(s)),Qt(s+"")||"auto"===s||(s+=b.units[u]||Qt(xn(t,u))||""),"="===(s+"").charAt(1)&&(s=xn(t,u))):s=xn(t,u),l=parseFloat(s),(f="string"===c&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),a=parseFloat(o),u in Vi&&("autoAlpha"===u&&(1===l&&"hidden"===xn(t,"visibility")&&a&&(l=0),x.push("visibility",0,A.visibility),_n(this,A,"visibility",l?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==u&&"transform"!==u&&~(u=Vi[u]).indexOf(",")&&(u=u.split(",")[0])),m=u in Li)if(this.styles.save(u),g||((_=t._gsap).renderTransform&&!e.parseTransform||Dn(t,e.parseTransform),y=!1!==e.smoothOrigin&&_.smooth,(g=this._pt=new di(this._pt,A,tn,0,1,_.renderTransform,_,0,-1)).dep=1),"scale"===u)this._pt=new di(this._pt,_,"scaleY",_.scaleY,(f?_t(_.scaleY,f+a):a)-_.scaleY||0,Ui),this._pt.u=0,M.push("scaleY",u),u+="X";else{if("transformOrigin"===u){x.push(en,0,A[en]),E=void 0,S=void 0,T=void 0,E=(w=o).split(" "),S=E[0],T=E[1]||"50%","top"!==S&&"bottom"!==S&&"left"!==T&&"right"!==T||(w=S,S=T,T=w),E[0]=En[S]||S,E[1]=En[T]||T,o=E.join(" "),_.svg?In(t,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==_.zOrigin&&_n(this,_,"zOrigin",_.zOrigin,p),_n(this,A,u,On(s),On(o)));continue}if("svgOrigin"===u){In(t,o,1,y,0,this);continue}if(u in An){Vn(this,_,u,l,f?_t(l,f+o):o);continue}if("smoothOrigin"===u){_n(this,_,"smooth",_.smooth,o);continue}if("force3D"===u){_[u]=o;continue}if("transform"===u){$n(this,o,t);continue}}else u in A||(u=hn(u)||u);if(m||(a||0===a)&&(l||0===l)&&!ji.test(o)&&u in A)a||(a=0),(d=(s+"").substr((l+"").length))!==(p=Qt(o)||(u in b.units?b.units[u]:d))&&(l=bn(t,u,s,p)),this._pt=new di(this._pt,m?_:A,u,l,(f?_t(l,f+a):a)-l,m||"px"!==p&&"zIndex"!==u||!1===e.autoRound?Ui:qi),this._pt.u=p||0,d!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=Hi);else if(u in A)wn.call(this,t,u,s,f?f+o:o);else if(u in t)this.add(t,u,s||t[u],f?f+o:o,n,r);else if("parseTransform"!==u){X(u,o);continue}m||(u in A?x.push(u,0,A[u]):x.push(u,1,s||t[u])),M.push(u)}v&&ui(this)},render:function(t,e){if(e.tween._time||!Di())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:xn,aliases:Vi,getSetter:function(t,e,i){var n=Vi[e];return n&&n.indexOf(",")<0&&(e=n),e in Li&&e!==en&&(t._gsap.x||xn(t,"x"))?i&&Ii===i?"scale"===e?Ki:Xi:(Ii=i||{})&&("scale"===e?Qi:Ji):t.style&&!O(t.style[e])?Zi:~e.indexOf("-")?Yi:ni(t,e)},core:{_removeProperty:gn,_getMatrix:Pn}};Ti.utils.checkPrefix=hn,Ti.core.getStyleSaver=on,Wn=ft((Hn="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(qn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Li[t]=1})),ft(qn,(function(t){b.units[t]="deg",An[t]=1})),Vi[Wn[13]]=Hn+","+qn,ft("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");Vi[e[1]]=Wn[e[0]]})),ft("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){b.units[t]="px"})),Ti.registerPlugin(Gn);var Zn=Ti.registerPlugin(Gn)||Ti;Zn.core.Tween},5881:function(module,exports){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,t;"undefined"!=typeof self&&self,t=function(){return function(){"use strict";var Q={onLoad:F,process:zt,on:de,off:ge,trigger:ce,ajax:Nr,find:C,findAll:f,closest:v,values:function(t,e){return dr(t,e||"post").values},remove:_,addClass:z,removeClass:n,toggleClass:$,takeClass:W,defineExtension:Ur,removeExtension:Br,logAll:V,logNone:j,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:!1,scrollBehavior:"smooth",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get"],selfRequestsOnly:!1,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null},parseInterval:d,_:t,createEventSource:function(t){return new EventSource(t,{withCredentials:!0})},createWebSocket:function(t){var e=new WebSocket(t,[]);return e.binaryType=Q.config.wsBinaryType,e},version:"1.9.10"},r={addTriggerHandler:Lt,bodyContains:se,canAccessLocalStorage:U,findThisElement:xe,filterValues:yr,hasAttribute:o,getAttributeValue:te,getClosestAttributeValue:ne,getClosestMatch:c,getExpressionVars:Hr,getHeaders:xr,getInputValues:dr,getInternalData:ae,getSwapSpecification:wr,getTriggerSpecs:it,getTarget:ye,makeFragment:l,mergeObjects:le,makeSettleInfo:T,oobSwap:Ee,querySelectorExt:ue,selectAndSwap:je,settleImmediately:nr,shouldCancel:ut,triggerEvent:ce,triggerErrorEvent:fe,withExtensions:R},w=["get","post","put","delete","patch"],i=w.map((function(t){return"[hx-"+t+"], [data-hx-"+t+"]"})).join(", "),S=e("head"),q=e("title"),H=e("svg",!0);function e(t,e=!1){return new RegExp(`<${t}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${t}>`,e?"gim":"im")}function d(t){if(null==t)return;let e=NaN;return e="ms"==t.slice(-2)?parseFloat(t.slice(0,-2)):"s"==t.slice(-1)?1e3*parseFloat(t.slice(0,-1)):"m"==t.slice(-1)?1e3*parseFloat(t.slice(0,-1))*60:parseFloat(t),isNaN(e)?void 0:e}function ee(t,e){return t.getAttribute&&t.getAttribute(e)}function o(t,e){return t.hasAttribute&&(t.hasAttribute(e)||t.hasAttribute("data-"+e))}function te(t,e){return ee(t,e)||ee(t,"data-"+e)}function u(t){return t.parentElement}function re(){return document}function c(t,e){for(;t&&!e(t);)t=u(t);return t||null}function L(t,e,i){var n=te(e,i),r=te(e,"hx-disinherit");return t!==e&&r&&("*"===r||r.split(" ").indexOf(i)>=0)?"unset":n}function ne(t,e){var i=null;if(c(t,(function(n){return i=L(t,n,e)})),"unset"!==i)return i}function h(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;return i&&i.call(t,e)}function A(t){var e=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(t);return e?e[1].toLowerCase():""}function a(t,e){for(var i=(new DOMParser).parseFromString(t,"text/html").body;e>0;)e--,i=i.firstChild;return null==i&&(i=re().createDocumentFragment()),i}function N(t){return/<body/.test(t)}function l(t){var e=!N(t),i=A(t),n=t;if("head"===i&&(n=n.replace(S,"")),Q.config.useTemplateFragments&&e)return a("<body><template>"+n+"</template></body>",0).querySelector("template").content;switch(i){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return a("<table>"+n+"</table>",1);case"col":return a("<table><colgroup>"+n+"</colgroup></table>",2);case"tr":return a("<table><tbody>"+n+"</tbody></table>",2);case"td":case"th":return a("<table><tbody><tr>"+n+"</tr></tbody></table>",3);case"script":case"style":return a("<div>"+n+"</div>",1);default:return a(n,0)}}function ie(t){t&&t()}function I(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function k(t){return I(t,"Function")}function P(t){return I(t,"Object")}function ae(t){var e="htmx-internal-data",i=t[e];return i||(i=t[e]={}),i}function M(t){var e=[];if(t)for(var i=0;i<t.length;i++)e.push(t[i]);return e}function oe(t,e){if(t)for(var i=0;i<t.length;i++)e(t[i])}function X(t){var e=t.getBoundingClientRect(),i=e.top,n=e.bottom;return i<window.innerHeight&&n>=0}function se(t){return t.getRootNode&&t.getRootNode()instanceof window.ShadowRoot?re().body.contains(t.getRootNode().host):re().body.contains(t)}function D(t){return t.trim().split(/\s+/)}function le(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function E(t){try{return JSON.parse(t)}catch(t){return b(t),null}}function U(){var t="htmx:localStorageTest";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return!1}}function B(t){try{var e=new URL(t);return e&&(t=e.pathname+e.search),/^\/$/.test(t)||(t=t.replace(/\/+$/,"")),t}catch(e){return t}}function t(e){return Tr(re().body,(function(){return eval(e)}))}function F(t){return Q.on("htmx:load",(function(e){t(e.detail.elt)}))}function V(){Q.logger=function(t,e,i){console&&console.log(e,t,i)}}function j(){Q.logger=null}function C(t,e){return e?t.querySelector(e):C(re(),t)}function f(t,e){return e?t.querySelectorAll(e):f(re(),t)}function _(t,e){t=g(t),e?setTimeout((function(){_(t),t=null}),e):t.parentElement.removeChild(t)}function z(t,e,i){t=g(t),i?setTimeout((function(){z(t,e),t=null}),i):t.classList&&t.classList.add(e)}function n(t,e,i){t=g(t),i?setTimeout((function(){n(t,e),t=null}),i):t.classList&&(t.classList.remove(e),0===t.classList.length&&t.removeAttribute("class"))}function $(t,e){(t=g(t)).classList.toggle(e)}function W(t,e){oe((t=g(t)).parentElement.children,(function(t){n(t,e)})),z(t,e)}function v(t,e){if((t=g(t)).closest)return t.closest(e);do{if(null==t||h(t,e))return t}while(t=t&&u(t));return null}function s(t,e){return t.substring(0,e.length)===e}function G(t,e){return t.substring(t.length-e.length)===e}function J(t){var e=t.trim();return s(e,"<")&&G(e,"/>")?e.substring(1,e.length-2):e}function Z(t,e){return 0===e.indexOf("closest ")?[v(t,J(e.substr(8)))]:0===e.indexOf("find ")?[C(t,J(e.substr(5)))]:"next"===e?[t.nextElementSibling]:0===e.indexOf("next ")?[K(t,J(e.substr(5)))]:"previous"===e?[t.previousElementSibling]:0===e.indexOf("previous ")?[Y(t,J(e.substr(9)))]:"document"===e?[document]:"window"===e?[window]:"body"===e?[document.body]:re().querySelectorAll(J(e))}var K=function(t,e){for(var i=re().querySelectorAll(e),n=0;n<i.length;n++){var r=i[n];if(r.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING)return r}},Y=function(t,e){for(var i=re().querySelectorAll(e),n=i.length-1;n>=0;n--){var r=i[n];if(r.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING)return r}};function ue(t,e){return e?Z(t,e)[0]:Z(re().body,t)[0]}function g(t){return I(t,"String")?C(t):t}function ve(t,e,i){return k(e)?{target:re().body,event:t,listener:e}:{target:g(t),event:e,listener:i}}function de(t,e,i){return jr((function(){var n=ve(t,e,i);n.target.addEventListener(n.event,n.listener)})),k(e)?e:i}function ge(t,e,i){return jr((function(){var n=ve(t,e,i);n.target.removeEventListener(n.event,n.listener)})),k(e)?e:i}var me=re().createElement("output");function pe(t,e){var i=ne(t,e);if(i){if("this"===i)return[xe(t,e)];var n=Z(t,i);return 0===n.length?(b('The selector "'+i+'" on '+e+" returned no matches!"),[me]):n}}function xe(t,e){return c(t,(function(t){return null!=te(t,e)}))}function ye(t){var e=ne(t,"hx-target");return e?"this"===e?xe(t,"hx-target"):ue(t,e):ae(t).boosted?re().body:t}function be(t){for(var e=Q.config.attributesToSettle,i=0;i<e.length;i++)if(t===e[i])return!0;return!1}function we(t,e){oe(t.attributes,(function(i){!e.hasAttribute(i.name)&&be(i.name)&&t.removeAttribute(i.name)})),oe(e.attributes,(function(e){be(e.name)&&t.setAttribute(e.name,e.value)}))}function Se(t,e){for(var i=Fr(e),n=0;n<i.length;n++){var r=i[n];try{if(r.isInlineSwap(t))return!0}catch(t){b(t)}}return"outerHTML"===t}function Ee(t,e,i){var n="#"+ee(e,"id"),r="outerHTML";"true"===t||(t.indexOf(":")>0?(r=t.substr(0,t.indexOf(":")),n=t.substr(t.indexOf(":")+1,t.length)):r=t);var s=re().querySelectorAll(n);return s?(oe(s,(function(t){var n,s=e.cloneNode(!0);(n=re().createDocumentFragment()).appendChild(s),Se(r,t)||(n=s);var o={shouldSwap:!0,target:t,fragment:n};ce(t,"htmx:oobBeforeSwap",o)&&(t=o.target,o.shouldSwap&&Fe(r,t,t,n,i),oe(i.elts,(function(t){ce(t,"htmx:oobAfterSwap",o)})))})),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),fe(re().body,"htmx:oobErrorNoTarget",{content:e})),t}function Ce(t,e,i){var n=ne(t,"hx-select-oob");if(n)for(var r=n.split(","),s=0;s<r.length;s++){var o=r[s].split(":",2),a=o[0].trim();0===a.indexOf("#")&&(a=a.substring(1));var l=o[1]||"true",c=e.querySelector("#"+a);c&&Ee(l,c,i)}oe(f(e,"[hx-swap-oob], [data-hx-swap-oob]"),(function(t){var e=te(t,"hx-swap-oob");null!=e&&Ee(e,t,i)}))}function Re(t){oe(f(t,"[hx-preserve], [data-hx-preserve]"),(function(t){var e=te(t,"id"),i=re().getElementById(e);null!=i&&t.parentNode.replaceChild(i,t)}))}function Te(t,e,i){oe(e.querySelectorAll("[id]"),(function(e){var n=ee(e,"id");if(n&&n.length>0){var r=n.replace("'","\\'"),s=e.tagName.replace(":","\\:"),o=t.querySelector(s+"[id='"+r+"']");if(o&&o!==t){var a=e.cloneNode();we(e,o),i.tasks.push((function(){we(e,a)}))}}}))}function Oe(t){return function(){n(t,Q.config.addedClass),zt(t),Nt(t),qe(t),ce(t,"htmx:load")}}function qe(t){var e="[autofocus]",i=h(t,e)?t:t.querySelector(e);null!=i&&i.focus()}function m(t,e,i,n){for(Te(t,i,n);i.childNodes.length>0;){var r=i.firstChild;z(r,Q.config.addedClass),t.insertBefore(r,e),r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE&&n.tasks.push(Oe(r))}}function He(t,e){for(var i=0;i<t.length;)e=(e<<5)-e+t.charCodeAt(i++)|0;return e}function Le(t){var e=0;if(t.attributes)for(var i=0;i<t.attributes.length;i++){var n=t.attributes[i];n.value&&(e=He(n.name,e),e=He(n.value,e))}return e}function Ae(t){var e=ae(t);if(e.onHandlers){for(var i=0;i<e.onHandlers.length;i++){const n=e.onHandlers[i];t.removeEventListener(n.event,n.listener)}delete e.onHandlers}}function Ne(t){var e=ae(t);e.timeout&&clearTimeout(e.timeout),e.webSocket&&e.webSocket.close(),e.sseEventSource&&e.sseEventSource.close(),e.listenerInfos&&oe(e.listenerInfos,(function(t){t.on&&t.on.removeEventListener(t.trigger,t.listener)})),Ae(t),oe(Object.keys(e),(function(t){delete e[t]}))}function p(t){ce(t,"htmx:beforeCleanupElement"),Ne(t),t.children&&oe(t.children,(function(t){p(t)}))}function Ie(t,e,i){if("BODY"===t.tagName)return Ue(t,e,i);var n,r=t.previousSibling;for(m(u(t),t,e,i),n=null==r?u(t).firstChild:r.nextSibling,i.elts=i.elts.filter((function(e){return e!=t}));n&&n!==t;)n.nodeType===Node.ELEMENT_NODE&&i.elts.push(n),n=n.nextElementSibling;p(t),u(t).removeChild(t)}function ke(t,e,i){return m(t,t.firstChild,e,i)}function Pe(t,e,i){return m(u(t),t,e,i)}function Me(t,e,i){return m(t,null,e,i)}function Xe(t,e,i){return m(u(t),t.nextSibling,e,i)}function De(t,e,i){return p(t),u(t).removeChild(t)}function Ue(t,e,i){var n=t.firstChild;if(m(t,n,e,i),n){for(;n.nextSibling;)p(n.nextSibling),t.removeChild(n.nextSibling);p(n),t.removeChild(n)}}function Be(t,e,i){var n=i||ne(t,"hx-select");if(n){var r=re().createDocumentFragment();oe(e.querySelectorAll(n),(function(t){r.appendChild(t)})),e=r}return e}function Fe(t,e,i,n,r){switch(t){case"none":return;case"outerHTML":return void Ie(i,n,r);case"afterbegin":return void ke(i,n,r);case"beforebegin":return void Pe(i,n,r);case"beforeend":return void Me(i,n,r);case"afterend":return void Xe(i,n,r);case"delete":return void De(i,n,r);default:for(var s=Fr(e),o=0;o<s.length;o++){var a=s[o];try{var l=a.handleSwap(t,i,n,r);if(l){if(void 0!==l.length)for(var c=0;c<l.length;c++){var h=l[c];h.nodeType!==Node.TEXT_NODE&&h.nodeType!==Node.COMMENT_NODE&&r.tasks.push(Oe(h))}return}}catch(t){b(t)}}"innerHTML"===t?Ue(i,n,r):Fe(Q.config.defaultSwapStyle,e,i,n,r)}}function Ve(t){if(t.indexOf("<title")>-1){var e=t.replace(H,"").match(q);if(e)return e[2]}}function je(t,e,i,n,r,s){r.title=Ve(n);var o=l(n);if(o)return Ce(i,o,r),Re(o=Be(i,o,s)),Fe(t,i,e,o,r)}function _e(t,e,i){var n=t.getResponseHeader(e);if(0===n.indexOf("{")){var r=E(n);for(var s in r)if(r.hasOwnProperty(s)){var o=r[s];P(o)||(o={value:o}),ce(i,s,o)}}else for(var a=n.split(","),l=0;l<a.length;l++)ce(i,a[l].trim(),[])}var ze=/\s/,x=/[\s,]/,$e=/[_$a-zA-Z]/,We=/[_$a-zA-Z0-9]/,Ge=['"',"'","/"],Je=/[^\s]/,Ze=/[{(]/,Ke=/[})]/;function Ye(t){for(var e=[],i=0;i<t.length;){if($e.exec(t.charAt(i))){for(var n=i;We.exec(t.charAt(i+1));)i++;e.push(t.substr(n,i-n+1))}else if(-1!==Ge.indexOf(t.charAt(i))){var r=t.charAt(i);for(n=i,i++;i<t.length&&t.charAt(i)!==r;)"\\"===t.charAt(i)&&i++,i++;e.push(t.substr(n,i-n+1))}else{var s=t.charAt(i);e.push(s)}i++}return e}function Qe(t,e,i){return $e.exec(t.charAt(0))&&"true"!==t&&"false"!==t&&"this"!==t&&t!==i&&"."!==e}function et(t,e,i){if("["===e[0]){e.shift();for(var n=1,r=" return (function("+i+"){ return (",s=null;e.length>0;){var o=e[0];if("]"===o){if(0==--n){null===s&&(r+="true"),e.shift(),r+=")})";try{var a=Tr(t,(function(){return Function(r)()}),(function(){return!0}));return a.source=r,a}catch(t){return fe(re().body,"htmx:syntax:error",{error:t,source:r}),null}}}else"["===o&&n++;Qe(o,s,i)?r+="(("+i+"."+o+") ? ("+i+"."+o+") : (window."+o+"))":r+=o,s=e.shift()}}}function y(t,e){for(var i="";t.length>0&&!e.test(t[0]);)i+=t.shift();return i}function tt(t){var e;return t.length>0&&Ze.test(t[0])?(t.shift(),e=y(t,Ke).trim(),t.shift()):e=y(t,x),e}var rt="input, textarea, select";function nt(t,e,i){var n=[],r=Ye(e);do{y(r,Je);var s=r.length,o=y(r,/[,\[\s]/);if(""!==o)if("every"===o){var a={trigger:"every"};y(r,Je),a.pollInterval=d(y(r,/[,\[\s]/)),y(r,Je),(l=et(t,r,"event"))&&(a.eventFilter=l),n.push(a)}else if(0===o.indexOf("sse:"))n.push({trigger:"sse",sseEvent:o.substr(4)});else{var l,c={trigger:o};for((l=et(t,r,"event"))&&(c.eventFilter=l);r.length>0&&","!==r[0];){y(r,Je);var h=r.shift();if("changed"===h)c.changed=!0;else if("once"===h)c.once=!0;else if("consume"===h)c.consume=!0;else if("delay"===h&&":"===r[0])r.shift(),c.delay=d(y(r,x));else if("from"===h&&":"===r[0]){if(r.shift(),Ze.test(r[0]))var u=tt(r);else if("closest"===(u=y(r,x))||"find"===u||"next"===u||"previous"===u){r.shift();var p=tt(r);p.length>0&&(u+=" "+p)}c.from=u}else"target"===h&&":"===r[0]?(r.shift(),c.target=tt(r)):"throttle"===h&&":"===r[0]?(r.shift(),c.throttle=d(y(r,x))):"queue"===h&&":"===r[0]?(r.shift(),c.queue=y(r,x)):"root"===h&&":"===r[0]?(r.shift(),c[h]=tt(r)):"threshold"===h&&":"===r[0]?(r.shift(),c[h]=y(r,x)):fe(t,"htmx:syntax:error",{token:r.shift()})}n.push(c)}r.length===s&&fe(t,"htmx:syntax:error",{token:r.shift()}),y(r,Je)}while(","===r[0]&&r.shift());return i&&(i[e]=n),n}function it(t){var e=te(t,"hx-trigger"),i=[];if(e){var n=Q.config.triggerSpecsCache;i=n&&n[e]||nt(t,e,n)}return i.length>0?i:h(t,"form")?[{trigger:"submit"}]:h(t,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:h(t,rt)?[{trigger:"change"}]:[{trigger:"click"}]}function at(t){ae(t).cancelled=!0}function ot(t,e,i){var n=ae(t);n.timeout=setTimeout((function(){se(t)&&!0!==n.cancelled&&(ct(i,t,Wt("hx:poll:trigger",{triggerSpec:i,target:t}))||e(t),ot(t,e,i))}),i.pollInterval)}function st(t){return location.hostname===t.hostname&&ee(t,"href")&&0!==ee(t,"href").indexOf("#")}function lt(t,e,i){if("A"===t.tagName&&st(t)&&(""===t.target||"_self"===t.target)||"FORM"===t.tagName){var n,r;if(e.boosted=!0,"A"===t.tagName)n="get",r=ee(t,"href");else{var s=ee(t,"method");n=s?s.toLowerCase():"get",r=ee(t,"action")}i.forEach((function(i){ht(t,(function(t,e){v(t,Q.config.disableSelector)?p(t):he(n,r,t,e)}),e,i,!0)}))}}function ut(t,e){if("submit"===t.type||"click"===t.type){if("FORM"===e.tagName)return!0;if(h(e,'input[type="submit"], button')&&null!==v(e,"form"))return!0;if("A"===e.tagName&&e.href&&("#"===e.getAttribute("href")||0!==e.getAttribute("href").indexOf("#")))return!0}return!1}function ft(t,e){return ae(t).boosted&&"A"===t.tagName&&"click"===e.type&&(e.ctrlKey||e.metaKey)}function ct(t,e,i){var n=t.eventFilter;if(n)try{return!0!==n.call(e,i)}catch(t){return fe(re().body,"htmx:eventFilter:error",{error:t,source:n.source}),!0}return!1}function ht(t,e,i,n,r){var s,o=ae(t);s=n.from?Z(t,n.from):[t],n.changed&&s.forEach((function(t){ae(t).lastValue=t.value})),oe(s,(function(s){var a=function(i){if(se(t)){if(!ft(t,i)&&((r||ut(i,t))&&i.preventDefault(),!ct(n,t,i))){var l=ae(i);if(l.triggerSpec=n,null==l.handledFor&&(l.handledFor=[]),l.handledFor.indexOf(t)<0){if(l.handledFor.push(t),n.consume&&i.stopPropagation(),n.target&&i.target&&!h(i.target,n.target))return;if(n.once){if(o.triggeredOnce)return;o.triggeredOnce=!0}if(n.changed){var c=ae(s);if(c.lastValue===s.value)return;c.lastValue=s.value}if(o.delayed&&clearTimeout(o.delayed),o.throttle)return;n.throttle>0?o.throttle||(e(t,i),o.throttle=setTimeout((function(){o.throttle=null}),n.throttle)):n.delay>0?o.delayed=setTimeout((function(){e(t,i)}),n.delay):(ce(t,"htmx:trigger"),e(t,i))}}}else s.removeEventListener(n.trigger,a)};null==i.listenerInfos&&(i.listenerInfos=[]),i.listenerInfos.push({trigger:n.trigger,listener:a,on:s}),s.addEventListener(n.trigger,a)}))}var vt=!1,dt=null;function gt(){dt||(dt=function(){vt=!0},window.addEventListener("scroll",dt),setInterval((function(){vt&&(vt=!1,oe(re().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),(function(t){mt(t)})))}),200))}function mt(t){!o(t,"data-hx-revealed")&&X(t)&&(t.setAttribute("data-hx-revealed","true"),ae(t).initHash?ce(t,"revealed"):t.addEventListener("htmx:afterProcessNode",(function(e){ce(t,"revealed")}),{once:!0}))}function pt(t,e,i){for(var n=D(i),r=0;r<n.length;r++){var s=n[r].split(/:(.+)/);"connect"===s[0]&&xt(t,s[1],0),"send"===s[0]&&bt(t)}}function xt(t,e,i){if(se(t)){if(0==e.indexOf("/")){var n=location.hostname+(location.port?":"+location.port:"");"https:"==location.protocol?e="wss://"+n+e:"http:"==location.protocol&&(e="ws://"+n+e)}var r=Q.createWebSocket(e);r.onerror=function(e){fe(t,"htmx:wsError",{error:e,socket:r}),yt(t)},r.onclose=function(n){if([1006,1012,1013].indexOf(n.code)>=0){var r=wt(i);setTimeout((function(){xt(t,e,i+1)}),r)}},r.onopen=function(t){i=0},ae(t).webSocket=r,r.addEventListener("message",(function(e){if(!yt(t)){var i=e.data;R(t,(function(e){i=e.transformResponse(i,null,t)}));for(var n=T(t),r=M(l(i).children),s=0;s<r.length;s++){var o=r[s];Ee(te(o,"hx-swap-oob")||"true",o,n)}nr(n.tasks)}}))}}function yt(t){if(!se(t))return ae(t).webSocket.close(),!0}function bt(t){var e=c(t,(function(t){return null!=ae(t).webSocket}));e?t.addEventListener(it(t)[0].trigger,(function(i){var n=ae(e).webSocket,r=xr(t,e),s=dr(t,"post"),o=s.errors,a=yr(le(s.values,Hr(t)),t);a.HEADERS=r,o&&o.length>0?ce(t,"htmx:validation:halted",o):(n.send(JSON.stringify(a)),ut(i,t)&&i.preventDefault())})):fe(t,"htmx:noWebSocketSourceError")}function wt(t){var e=Q.config.wsReconnectDelay;if("function"==typeof e)return e(t);if("full-jitter"===e){var i=Math.min(t,6);return 1e3*Math.pow(2,i)*Math.random()}b('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function St(t,e,i){for(var n=D(i),r=0;r<n.length;r++){var s=n[r].split(/:(.+)/);"connect"===s[0]&&Et(t,s[1]),"swap"===s[0]&&Ct(t,s[1])}}function Et(t,e){var i=Q.createEventSource(e);i.onerror=function(e){fe(t,"htmx:sseError",{error:e,source:i}),Tt(t)},ae(t).sseEventSource=i}function Ct(t,e){var i=c(t,Ot);if(i){var n=ae(i).sseEventSource,r=function(s){if(!Tt(i))if(se(t)){var o=s.data;R(t,(function(e){o=e.transformResponse(o,null,t)}));var a=wr(t),l=ye(t),c=T(t);je(a.swapStyle,l,t,o,c),nr(c.tasks),ce(t,"htmx:sseMessage",s)}else n.removeEventListener(e,r)};ae(t).sseListener=r,n.addEventListener(e,r)}else fe(t,"htmx:noSSESourceError")}function Rt(t,e,i){var n=c(t,Ot);if(n){var r=ae(n).sseEventSource,s=function(){Tt(n)||(se(t)?e(t):r.removeEventListener(i,s))};ae(t).sseListener=s,r.addEventListener(i,s)}else fe(t,"htmx:noSSESourceError")}function Tt(t){if(!se(t))return ae(t).sseEventSource.close(),!0}function Ot(t){return null!=ae(t).sseEventSource}function qt(t,e,i,n){var r=function(){i.loaded||(i.loaded=!0,e(t))};n>0?setTimeout(r,n):r()}function Ht(t,e,i){var n=!1;return oe(w,(function(r){if(o(t,"hx-"+r)){var s=te(t,"hx-"+r);n=!0,e.path=s,e.verb=r,i.forEach((function(i){Lt(t,i,e,(function(t,e){v(t,Q.config.disableSelector)?p(t):he(r,s,t,e)}))}))}})),n}function Lt(t,e,i,n){if(e.sseEvent)Rt(t,n,e.sseEvent);else if("revealed"===e.trigger)gt(),ht(t,n,i,e),mt(t);else if("intersect"===e.trigger){var r={};e.root&&(r.root=ue(t,e.root)),e.threshold&&(r.threshold=parseFloat(e.threshold));var s=new IntersectionObserver((function(e){for(var i=0;i<e.length;i++)if(e[i].isIntersecting){ce(t,"intersect");break}}),r);s.observe(t),ht(t,n,i,e)}else"load"===e.trigger?ct(e,t,Wt("load",{elt:t}))||qt(t,n,i,e.delay):e.pollInterval>0?(i.polling=!0,ot(t,n,e)):ht(t,n,i,e)}function At(t){if(Q.config.allowScriptTags&&("text/javascript"===t.type||"module"===t.type||""===t.type)){var e=re().createElement("script");oe(t.attributes,(function(t){e.setAttribute(t.name,t.value)})),e.textContent=t.textContent,e.async=!1,Q.config.inlineScriptNonce&&(e.nonce=Q.config.inlineScriptNonce);var i=t.parentElement;try{i.insertBefore(e,t)}catch(t){b(t)}finally{t.parentElement&&t.parentElement.removeChild(t)}}}function Nt(t){h(t,"script")&&At(t),oe(f(t,"script"),(function(t){At(t)}))}function It(t){for(var e=t.attributes,i=0;i<e.length;i++){var n=e[i].name;if(s(n,"hx-on:")||s(n,"data-hx-on:")||s(n,"hx-on-")||s(n,"data-hx-on-"))return!0}return!1}function kt(t){var e=null,i=[];if(It(t)&&i.push(t),document.evaluate)for(var n=document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]',t);e=n.iterateNext();)i.push(e);else for(var r=t.getElementsByTagName("*"),s=0;s<r.length;s++)It(r[s])&&i.push(r[s]);return i}function Pt(t){return t.querySelectorAll?t.querySelectorAll(i+", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost], form, [type='submit'], [hx-sse], [data-hx-sse], [hx-ws], [data-hx-ws], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger], [hx-on], [data-hx-on]"):[]}function Mt(t){var e=v(t.target,"button, input[type='submit']"),i=Dt(t);i&&(i.lastButtonClicked=e)}function Xt(t){var e=Dt(t);e&&(e.lastButtonClicked=null)}function Dt(t){var e=v(t.target,"button, input[type='submit']");if(e){var i=g("#"+ee(e,"form"))||v(e,"form");if(i)return ae(i)}}function Ut(t){t.addEventListener("click",Mt),t.addEventListener("focusin",Mt),t.addEventListener("focusout",Xt)}function Bt(t){for(var e=Ye(t),i=0,n=0;n<e.length;n++){const t=e[n];"{"===t?i++:"}"===t&&i--}return i}function Ft(t,e,i){var n,r=ae(t);Array.isArray(r.onHandlers)||(r.onHandlers=[]);var s=function(e){return Tr(t,(function(){n||(n=new Function("event",i)),n.call(t,e)}))};t.addEventListener(e,s),r.onHandlers.push({event:e,listener:s})}function Vt(t){var e=te(t,"hx-on");if(e){for(var i={},n=e.split("\n"),r=null,s=0;n.length>0;){var o=n.shift(),a=o.match(/^\s*([a-zA-Z:\-\.]+:)(.*)/);0===s&&a?(o.split(":"),i[r=a[1].slice(0,-1)]=a[2]):i[r]+=o,s+=Bt(o)}for(var l in i)Ft(t,l,i[l])}}function jt(t){Ae(t);for(var e=0;e<t.attributes.length;e++){var i=t.attributes[e].name,n=t.attributes[e].value;if(s(i,"hx-on")||s(i,"data-hx-on")){var r=i.indexOf("-on")+3,o=i.slice(r,r+1);if("-"===o||":"===o){var a=i.slice(r+1);s(a,":")?a="htmx"+a:s(a,"-")?a="htmx:"+a.slice(1):s(a,"htmx-")&&(a="htmx:"+a.slice(5)),Ft(t,a,n)}}}}function _t(t){if(v(t,Q.config.disableSelector))p(t);else{var e=ae(t);if(e.initHash!==Le(t)){Ne(t),e.initHash=Le(t),Vt(t),ce(t,"htmx:beforeProcessNode"),t.value&&(e.lastValue=t.value);var i=it(t);Ht(t,e,i)||("true"===ne(t,"hx-boost")?lt(t,e,i):o(t,"hx-trigger")&&i.forEach((function(i){Lt(t,i,e,(function(){}))}))),("FORM"===t.tagName||"submit"===ee(t,"type")&&o(t,"form"))&&Ut(t);var n=te(t,"hx-sse");n&&St(t,e,n);var r=te(t,"hx-ws");r&&pt(t,e,r),ce(t,"htmx:afterProcessNode")}}}function zt(t){v(t=g(t),Q.config.disableSelector)?p(t):(_t(t),oe(Pt(t),(function(t){_t(t)})),oe(kt(t),jt))}function $t(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Wt(t,e){var i;return window.CustomEvent&&"function"==typeof window.CustomEvent?i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e}):(i=re().createEvent("CustomEvent")).initCustomEvent(t,!0,!0,e),i}function fe(t,e,i){ce(t,e,le({error:e},i))}function Gt(t){return"htmx:afterProcessNode"===t}function R(t,e){oe(Fr(t),(function(t){try{e(t)}catch(t){b(t)}}))}function b(t){console.error?console.error(t):console.log&&console.log("ERROR: ",t)}function ce(t,e,i){t=g(t),null==i&&(i={}),i.elt=t;var n=Wt(e,i);Q.logger&&!Gt(e)&&Q.logger(t,e,i),i.error&&(b(i.error),ce(t,"htmx:error",{errorInfo:i}));var r=t.dispatchEvent(n),s=$t(e);if(r&&s!==e){var o=Wt(s,n.detail);r=r&&t.dispatchEvent(o)}return R(t,(function(t){r=r&&!1!==t.onEvent(e,n)&&!n.defaultPrevented})),r}var Jt=location.pathname+location.search;function Zt(){return re().querySelector("[hx-history-elt],[data-hx-history-elt]")||re().body}function Kt(t,e,i,n){if(U())if(Q.config.historyCacheSize<=0)localStorage.removeItem("htmx-history-cache");else{t=B(t);for(var r=E(localStorage.getItem("htmx-history-cache"))||[],s=0;s<r.length;s++)if(r[s].url===t){r.splice(s,1);break}var o={url:t,content:e,title:i,scroll:n};for(ce(re().body,"htmx:historyItemCreated",{item:o,cache:r}),r.push(o);r.length>Q.config.historyCacheSize;)r.shift();for(;r.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(r));break}catch(t){fe(re().body,"htmx:historyCacheError",{cause:t,cache:r}),r.shift()}}}function Yt(t){if(!U())return null;t=B(t);for(var e=E(localStorage.getItem("htmx-history-cache"))||[],i=0;i<e.length;i++)if(e[i].url===t)return e[i];return null}function Qt(t){var e=Q.config.requestClass,i=t.cloneNode(!0);return oe(f(i,"."+e),(function(t){n(t,e)})),i.innerHTML}function er(){var t,e=Zt(),i=Jt||location.pathname+location.search;try{t=re().querySelector('[hx-history="false" i],[data-hx-history="false" i]')}catch(e){t=re().querySelector('[hx-history="false"],[data-hx-history="false"]')}t||(ce(re().body,"htmx:beforeHistorySave",{path:i,historyElt:e}),Kt(i,Qt(e),re().title,window.scrollY)),Q.config.historyEnabled&&history.replaceState({htmx:!0},re().title,window.location.href)}function tr(t){Q.config.getCacheBusterParam&&(G(t=t.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),"&")||G(t,"?"))&&(t=t.slice(0,-1)),Q.config.historyEnabled&&history.pushState({htmx:!0},"",t),Jt=t}function rr(t){Q.config.historyEnabled&&history.replaceState({htmx:!0},"",t),Jt=t}function nr(t){oe(t,(function(t){t.call()}))}function ir(t){var e=new XMLHttpRequest,i={path:t,xhr:e};ce(re().body,"htmx:historyCacheMiss",i),e.open("GET",t,!0),e.setRequestHeader("HX-Request","true"),e.setRequestHeader("HX-History-Restore-Request","true"),e.setRequestHeader("HX-Current-URL",re().location.href),e.onload=function(){if(this.status>=200&&this.status<400){ce(re().body,"htmx:historyCacheMissLoad",i);var e=l(this.response);e=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;var n=Zt(),r=T(n),s=Ve(this.response);if(s){var o=C("title");o?o.innerHTML=s:window.document.title=s}Ue(n,e,r),nr(r.tasks),Jt=t,ce(re().body,"htmx:historyRestore",{path:t,cacheMiss:!0,serverResponse:this.response})}else fe(re().body,"htmx:historyCacheMissLoadError",i)},e.send()}function ar(t){er();var e=Yt(t=t||location.pathname+location.search);if(e){var i=l(e.content),n=Zt(),r=T(n);Ue(n,i,r),nr(r.tasks),document.title=e.title,setTimeout((function(){window.scrollTo(0,e.scroll)}),0),Jt=t,ce(re().body,"htmx:historyRestore",{path:t,item:e})}else Q.config.refreshOnHistoryMiss?window.location.reload(!0):ir(t)}function or(t){var e=pe(t,"hx-indicator");return null==e&&(e=[t]),oe(e,(function(t){var e=ae(t);e.requestCount=(e.requestCount||0)+1,t.classList.add.call(t.classList,Q.config.requestClass)})),e}function sr(t){var e=pe(t,"hx-disabled-elt");return null==e&&(e=[]),oe(e,(function(t){var e=ae(t);e.requestCount=(e.requestCount||0)+1,t.setAttribute("disabled","")})),e}function lr(t,e){oe(t,(function(t){var e=ae(t);e.requestCount=(e.requestCount||0)-1,0===e.requestCount&&t.classList.remove.call(t.classList,Q.config.requestClass)})),oe(e,(function(t){var e=ae(t);e.requestCount=(e.requestCount||0)-1,0===e.requestCount&&t.removeAttribute("disabled")}))}function ur(t,e){for(var i=0;i<t.length;i++)if(t[i].isSameNode(e))return!0;return!1}function fr(t){return""!==t.name&&null!=t.name&&!t.disabled&&!v(t,"fieldset[disabled]")&&"button"!==t.type&&"submit"!==t.type&&"image"!==t.tagName&&"reset"!==t.tagName&&"file"!==t.tagName&&("checkbox"!==t.type&&"radio"!==t.type||t.checked)}function cr(t,e,i){if(null!=t&&null!=e){var n=i[t];void 0===n?i[t]=e:Array.isArray(n)?Array.isArray(e)?i[t]=n.concat(e):n.push(e):Array.isArray(e)?i[t]=[n].concat(e):i[t]=[n,e]}}function hr(t,e,i,n,r){if(null!=n&&!ur(t,n)){if(t.push(n),fr(n)){var s=ee(n,"name"),o=n.value;n.multiple&&"SELECT"===n.tagName&&(o=M(n.querySelectorAll("option:checked")).map((function(t){return t.value}))),n.files&&(o=M(n.files)),cr(s,o,e),r&&vr(n,i)}h(n,"form")&&oe(n.elements,(function(n){hr(t,e,i,n,r)}))}}function vr(t,e){t.willValidate&&(ce(t,"htmx:validation:validate"),t.checkValidity()||(e.push({elt:t,message:t.validationMessage,validity:t.validity}),ce(t,"htmx:validation:failed",{message:t.validationMessage,validity:t.validity})))}function dr(t,e){var i=[],n={},r={},s=[],o=ae(t);o.lastButtonClicked&&!se(o.lastButtonClicked)&&(o.lastButtonClicked=null);var a=h(t,"form")&&!0!==t.noValidate||"true"===te(t,"hx-validate");if(o.lastButtonClicked&&(a=a&&!0!==o.lastButtonClicked.formNoValidate),"get"!==e&&hr(i,r,s,v(t,"form"),a),hr(i,n,s,t,a),o.lastButtonClicked||"BUTTON"===t.tagName||"INPUT"===t.tagName&&"submit"===ee(t,"type")){var l=o.lastButtonClicked||t;cr(ee(l,"name"),l.value,r)}return oe(pe(t,"hx-include"),(function(t){hr(i,n,s,t,a),h(t,"form")||oe(t.querySelectorAll(rt),(function(t){hr(i,n,s,t,a)}))})),n=le(n,r),{errors:s,values:n}}function gr(t,e,i){""!==t&&(t+="&"),"[object Object]"===String(i)&&(i=JSON.stringify(i));var n=encodeURIComponent(i);return t+=encodeURIComponent(e)+"="+n}function mr(t){var e="";for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];Array.isArray(n)?oe(n,(function(t){e=gr(e,i,t)})):e=gr(e,i,n)}return e}function pr(t){var e=new FormData;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];Array.isArray(n)?oe(n,(function(t){e.append(i,t)})):e.append(i,n)}return e}function xr(t,e,i){var n={"HX-Request":"true","HX-Trigger":ee(t,"id"),"HX-Trigger-Name":ee(t,"name"),"HX-Target":te(e,"id"),"HX-Current-URL":re().location.href};return Rr(t,"hx-headers",!1,n),void 0!==i&&(n["HX-Prompt"]=i),ae(t).boosted&&(n["HX-Boosted"]="true"),n}function yr(t,e){var i=ne(e,"hx-params");if(i){if("none"===i)return{};if("*"===i)return t;if(0===i.indexOf("not "))return oe(i.substr(4).split(","),(function(e){e=e.trim(),delete t[e]})),t;var n={};return oe(i.split(","),(function(e){e=e.trim(),n[e]=t[e]})),n}return t}function br(t){return ee(t,"href")&&ee(t,"href").indexOf("#")>=0}function wr(t,e){var i=e||ne(t,"hx-swap"),n={swapStyle:ae(t).boosted?"innerHTML":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&ae(t).boosted&&!br(t)&&(n.show="top"),i){var r=D(i);if(r.length>0)for(var s=0;s<r.length;s++){var o=r[s];if(0===o.indexOf("swap:"))n.swapDelay=d(o.substr(5));else if(0===o.indexOf("settle:"))n.settleDelay=d(o.substr(7));else if(0===o.indexOf("transition:"))n.transition="true"===o.substr(11);else if(0===o.indexOf("ignoreTitle:"))n.ignoreTitle="true"===o.substr(12);else if(0===o.indexOf("scroll:")){var a=(c=o.substr(7).split(":")).pop(),l=c.length>0?c.join(":"):null;n.scroll=a,n.scrollTarget=l}else if(0===o.indexOf("show:")){var c,h=(c=o.substr(5).split(":")).pop();l=c.length>0?c.join(":"):null,n.show=h,n.showTarget=l}else if(0===o.indexOf("focus-scroll:")){var u=o.substr(13);n.focusScroll="true"==u}else 0==s?n.swapStyle=o:b("Unknown modifier in hx-swap: "+o)}}return n}function Sr(t){return"multipart/form-data"===ne(t,"hx-encoding")||h(t,"form")&&"multipart/form-data"===ee(t,"enctype")}function Er(t,e,i){var n=null;return R(e,(function(r){null==n&&(n=r.encodeParameters(t,i,e))})),null!=n?n:Sr(e)?pr(i):mr(i)}function T(t){return{tasks:[],elts:[t]}}function Cr(t,e){var i=t[0],n=t[t.length-1];if(e.scroll){var r=null;e.scrollTarget&&(r=ue(i,e.scrollTarget)),"top"===e.scroll&&(i||r)&&((r=r||i).scrollTop=0),"bottom"===e.scroll&&(n||r)&&((r=r||n).scrollTop=r.scrollHeight)}if(e.show){if(r=null,e.showTarget){var s=e.showTarget;"window"===e.showTarget&&(s="body"),r=ue(i,s)}"top"===e.show&&(i||r)&&(r=r||i).scrollIntoView({block:"start",behavior:Q.config.scrollBehavior}),"bottom"===e.show&&(n||r)&&(r=r||n).scrollIntoView({block:"end",behavior:Q.config.scrollBehavior})}}function Rr(t,e,i,n){if(null==n&&(n={}),null==t)return n;var r=te(t,e);if(r){var s,o=r.trim(),a=i;if("unset"===o)return null;for(var l in 0===o.indexOf("javascript:")?(o=o.substr(11),a=!0):0===o.indexOf("js:")&&(o=o.substr(3),a=!0),0!==o.indexOf("{")&&(o="{"+o+"}"),s=a?Tr(t,(function(){return Function("return ("+o+")")()}),{}):E(o))s.hasOwnProperty(l)&&null==n[l]&&(n[l]=s[l])}return Rr(u(t),e,i,n)}function Tr(t,e,i){return Q.config.allowEval?e():(fe(t,"htmx:evalDisallowedError"),i)}function Or(t,e){return Rr(t,"hx-vars",!0,e)}function qr(t,e){return Rr(t,"hx-vals",!1,e)}function Hr(t){return le(Or(t),qr(t))}function Lr(t,e,i){if(null!==i)try{t.setRequestHeader(e,i)}catch(n){t.setRequestHeader(e,encodeURIComponent(i)),t.setRequestHeader(e+"-URI-AutoEncoded","true")}}function Ar(t){if(t.responseURL&&"undefined"!=typeof URL)try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){fe(re().body,"htmx:badResponseUrl",{url:t.responseURL})}}function O(t,e){return e.test(t.getAllResponseHeaders())}function Nr(t,e,i){return t=t.toLowerCase(),i?i instanceof Element||I(i,"String")?he(t,e,null,null,{targetOverride:g(i),returnPromise:!0}):he(t,e,g(i.source),i.event,{handler:i.handler,headers:i.headers,values:i.values,targetOverride:g(i.target),swapOverride:i.swap,select:i.select,returnPromise:!0}):he(t,e,null,null,{returnPromise:!0})}function Ir(t){for(var e=[];t;)e.push(t),t=t.parentElement;return e}function kr(t,e,i){var n,r;return"function"==typeof URL?(r=new URL(e,document.location.href),n=document.location.origin===r.origin):(r=e,n=s(e,document.location.origin)),!(Q.config.selfRequestsOnly&&!n)&&ce(t,"htmx:validateUrl",le({url:r,sameHost:n},i))}function he(t,e,i,n,r,s){var o=null,a=null;if((r=null!=r?r:{}).returnPromise&&"undefined"!=typeof Promise)var l=new Promise((function(t,e){o=t,a=e}));null==i&&(i=re().body);var c=r.handler||Mr,h=r.select||null;if(!se(i))return ie(o),l;var u=r.targetOverride||ye(i);if(null==u||u==me)return fe(i,"htmx:targetError",{target:te(i,"hx-target")}),ie(a),l;var d=ae(i),p=d.lastButtonClicked;if(p){var f=ee(p,"formaction");null!=f&&(e=f);var m=ee(p,"formmethod");null!=m&&"dialog"!==m.toLowerCase()&&(t=m)}var g=ne(i,"hx-confirm");if(void 0===s){var _={target:u,elt:i,path:e,verb:t,triggeringEvent:n,etc:r,issueRequest:function(s){return he(t,e,i,n,r,!!s)},question:g};if(!1===ce(i,"htmx:confirm",_))return ie(o),l}var y=i,v=ne(i,"hx-sync"),b=null,x=!1;if(v){var w=v.split(":"),E=w[0].trim();if(y="this"===E?xe(i,"hx-sync"):ue(i,E),v=(w[1]||"drop").trim(),d=ae(y),"drop"===v&&d.xhr&&!0!==d.abortable)return ie(o),l;if("abort"===v){if(d.xhr)return ie(o),l;x=!0}else"replace"===v?ce(y,"htmx:abort"):0===v.indexOf("queue")&&(b=(v.split(" ")[1]||"last").trim())}if(d.xhr){if(!d.abortable){if(null==b){if(n){var S=ae(n);S&&S.triggerSpec&&S.triggerSpec.queue&&(b=S.triggerSpec.queue)}null==b&&(b="last")}return null==d.queuedRequests&&(d.queuedRequests=[]),"first"===b&&0===d.queuedRequests.length||"all"===b?d.queuedRequests.push((function(){he(t,e,i,n,r)})):"last"===b&&(d.queuedRequests=[],d.queuedRequests.push((function(){he(t,e,i,n,r)}))),ie(o),l}ce(y,"htmx:abort")}var T=new XMLHttpRequest;d.xhr=T,d.abortable=x;var M=function(){d.xhr=null,d.abortable=!1,null!=d.queuedRequests&&d.queuedRequests.length>0&&d.queuedRequests.shift()()},A=ne(i,"hx-prompt");if(A){var C=prompt(A);if(null===C||!ce(i,"htmx:prompt",{prompt:C,target:u}))return ie(o),M(),l}if(g&&!s&&!confirm(g))return ie(o),M(),l;var k=xr(i,u,C);"get"===t||Sr(i)||(k["Content-Type"]="application/x-www-form-urlencoded"),r.headers&&(k=le(k,r.headers));var P=dr(i,t),I=P.errors,D=P.values;r.values&&(D=le(D,r.values));var O=le(D,Hr(i)),L=yr(O,i);Q.config.getCacheBusterParam&&"get"===t&&(L["org.htmx.cache-buster"]=ee(u,"id")||"true"),null!=e&&""!==e||(e=re().location.href);var z=Rr(i,"hx-request"),R=ae(i).boosted,F=Q.config.methodsThatUseUrlParams.indexOf(t)>=0,B={boosted:R,useUrlParams:F,parameters:L,unfilteredParameters:O,headers:k,target:u,verb:t,errors:I,withCredentials:r.credentials||z.credentials||Q.config.withCredentials,timeout:r.timeout||z.timeout||Q.config.timeout,path:e,triggeringEvent:n};if(!ce(i,"htmx:configRequest",B))return ie(o),M(),l;if(e=B.path,t=B.verb,k=B.headers,L=B.parameters,F=B.useUrlParams,(I=B.errors)&&I.length>0)return ce(i,"htmx:validation:halted",B),ie(o),M(),l;var N=e.split("#"),j=N[0],V=N[1],U=e;if(F&&(U=j,0!==Object.keys(L).length&&(U.indexOf("?")<0?U+="?":U+="&",U+=mr(L),V&&(U+="#"+V))),!kr(i,U,B))return fe(i,"htmx:invalidPath",B),ie(a),l;if(T.open(t.toUpperCase(),U,!0),T.overrideMimeType("text/html"),T.withCredentials=B.withCredentials,T.timeout=B.timeout,z.noHeaders);else for(var $ in k)if(k.hasOwnProperty($)){var H=k[$];Lr(T,$,H)}var q={xhr:T,target:u,requestConfig:B,etc:r,boosted:R,select:h,pathInfo:{requestPath:e,finalRequestPath:U,anchor:V}};if(T.onload=function(){try{var t=Ir(i);if(q.pathInfo.responsePath=Ar(T),c(i,q),lr(W,G),ce(i,"htmx:afterRequest",q),ce(i,"htmx:afterOnLoad",q),!se(i)){for(var e=null;t.length>0&&null==e;){var n=t.shift();se(n)&&(e=n)}e&&(ce(e,"htmx:afterRequest",q),ce(e,"htmx:afterOnLoad",q))}ie(o),M()}catch(t){throw fe(i,"htmx:onLoadError",le({error:t},q)),t}},T.onerror=function(){lr(W,G),fe(i,"htmx:afterRequest",q),fe(i,"htmx:sendError",q),ie(a),M()},T.onabort=function(){lr(W,G),fe(i,"htmx:afterRequest",q),fe(i,"htmx:sendAbort",q),ie(a),M()},T.ontimeout=function(){lr(W,G),fe(i,"htmx:afterRequest",q),fe(i,"htmx:timeout",q),ie(a),M()},!ce(i,"htmx:beforeRequest",q))return ie(o),M(),l;var W=or(i),G=sr(i);oe(["loadstart","loadend","progress","abort"],(function(t){oe([T,T.upload],(function(e){e.addEventListener(t,(function(e){ce(i,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})}))}))})),ce(i,"htmx:beforeSend",q);var Z=F?null:Er(T,i,L);return T.send(Z),l}function Pr(t,e){var i=e.xhr,n=null,r=null;if(O(i,/HX-Push:/i)?(n=i.getResponseHeader("HX-Push"),r="push"):O(i,/HX-Push-Url:/i)?(n=i.getResponseHeader("HX-Push-Url"),r="push"):O(i,/HX-Replace-Url:/i)&&(n=i.getResponseHeader("HX-Replace-Url"),r="replace"),n)return"false"===n?{}:{type:r,path:n};var s=e.pathInfo.finalRequestPath,o=e.pathInfo.responsePath,a=ne(t,"hx-push-url"),l=ne(t,"hx-replace-url"),c=ae(t).boosted,h=null,u=null;return a?(h="push",u=a):l?(h="replace",u=l):c&&(h="push",u=o||s),u?"false"===u?{}:("true"===u&&(u=o||s),e.pathInfo.anchor&&-1===u.indexOf("#")&&(u=u+"#"+e.pathInfo.anchor),{type:h,path:u}):{}}function Mr(t,e){var i=e.xhr,n=e.target,r=e.etc,s=(e.requestConfig,e.select);if(ce(t,"htmx:beforeOnLoad",e)){if(O(i,/HX-Trigger:/i)&&_e(i,"HX-Trigger",t),O(i,/HX-Location:/i)){er();var o=i.getResponseHeader("HX-Location");return 0===o.indexOf("{")&&(f=E(o),o=f.path,delete f.path),void Nr("GET",o,f).then((function(){tr(o)}))}var a=O(i,/HX-Refresh:/i)&&"true"===i.getResponseHeader("HX-Refresh");if(O(i,/HX-Redirect:/i))return location.href=i.getResponseHeader("HX-Redirect"),void(a&&location.reload());if(a)location.reload();else{O(i,/HX-Retarget:/i)&&("this"===i.getResponseHeader("HX-Retarget")?e.target=t:e.target=ue(t,i.getResponseHeader("HX-Retarget")));var l=Pr(t,e),c=i.status>=200&&i.status<400&&204!==i.status,h=i.response,u=i.status>=400,d=Q.config.ignoreTitle,p=le({shouldSwap:c,serverResponse:h,isError:u,ignoreTitle:d},e);if(ce(n,"htmx:beforeSwap",p)){if(n=p.target,h=p.serverResponse,u=p.isError,d=p.ignoreTitle,e.target=n,e.failed=u,e.successful=!u,p.shouldSwap){286===i.status&&at(t),R(t,(function(e){h=e.transformResponse(h,i,t)})),l.type&&er();var f,m=r.swapOverride;O(i,/HX-Reswap:/i)&&(m=i.getResponseHeader("HX-Reswap")),(f=wr(t,m)).hasOwnProperty("ignoreTitle")&&(d=f.ignoreTitle),n.classList.add(Q.config.swappingClass);var g=null,_=null,y=function(){try{var r,o=document.activeElement,a={};try{a={elt:o,start:o?o.selectionStart:null,end:o?o.selectionEnd:null}}catch(o){}s&&(r=s),O(i,/HX-Reselect:/i)&&(r=i.getResponseHeader("HX-Reselect")),l.type&&(ce(re().body,"htmx:beforeHistoryUpdate",le({history:l},e)),"push"===l.type?(tr(l.path),ce(re().body,"htmx:pushedIntoHistory",{path:l.path})):(rr(l.path),ce(re().body,"htmx:replacedInHistory",{path:l.path})));var c=T(n);if(je(f.swapStyle,n,t,h,c,r),a.elt&&!se(a.elt)&&ee(a.elt,"id")){var u=document.getElementById(ee(a.elt,"id")),p={preventScroll:void 0!==f.focusScroll?!f.focusScroll:!Q.config.defaultFocusScroll};if(u){if(a.start&&u.setSelectionRange)try{u.setSelectionRange(a.start,a.end)}catch(o){}u.focus(p)}}if(n.classList.remove(Q.config.swappingClass),oe(c.elts,(function(t){t.classList&&t.classList.add(Q.config.settlingClass),ce(t,"htmx:afterSwap",e)})),O(i,/HX-Trigger-After-Swap:/i)){var m=t;se(t)||(m=re().body),_e(i,"HX-Trigger-After-Swap",m)}var y=function(){if(oe(c.tasks,(function(t){t.call()})),oe(c.elts,(function(t){t.classList&&t.classList.remove(Q.config.settlingClass),ce(t,"htmx:afterSettle",e)})),e.pathInfo.anchor){var n=re().getElementById(e.pathInfo.anchor);n&&n.scrollIntoView({block:"start",behavior:"auto"})}if(c.title&&!d){var r=C("title");r?r.innerHTML=c.title:window.document.title=c.title}if(Cr(c.elts,f),O(i,/HX-Trigger-After-Settle:/i)){var s=t;se(t)||(s=re().body),_e(i,"HX-Trigger-After-Settle",s)}ie(g)};f.settleDelay>0?setTimeout(y,f.settleDelay):y()}catch(o){throw fe(t,"htmx:swapError",e),ie(_),o}},v=Q.config.globalViewTransitions;if(f.hasOwnProperty("transition")&&(v=f.transition),v&&ce(t,"htmx:beforeTransition",e)&&"undefined"!=typeof Promise&&document.startViewTransition){var b=new Promise((function(t,e){g=t,_=e})),x=y;y=function(){document.startViewTransition((function(){return x(),b}))}}f.swapDelay>0?setTimeout(y,f.swapDelay):y()}u&&fe(t,"htmx:responseError",le({error:"Response Status Error Code "+i.status+" from "+e.pathInfo.requestPath},e))}}}}var Xr={};function Dr(){return{init:function(t){return null},onEvent:function(t,e){return!0},transformResponse:function(t,e,i){return t},isInlineSwap:function(t){return!1},handleSwap:function(t,e,i,n){return!1},encodeParameters:function(t,e,i){return null}}}function Ur(t,e){e.init&&e.init(r),Xr[t]=le(Dr(),e)}function Br(t){delete Xr[t]}function Fr(t,e,i){if(null==t)return e;null==e&&(e=[]),null==i&&(i=[]);var n=te(t,"hx-ext");return n&&oe(n.split(","),(function(t){if("ignore:"!=(t=t.replace(/ /g,"")).slice(0,7)){if(i.indexOf(t)<0){var n=Xr[t];n&&e.indexOf(n)<0&&e.push(n)}}else i.push(t.slice(7))})),Fr(u(t),e,i)}var Vr=!1;function jr(t){Vr||"complete"===re().readyState?t():re().addEventListener("DOMContentLoaded",t)}function _r(){!1!==Q.config.includeIndicatorStyles&&re().head.insertAdjacentHTML("beforeend","<style> ."+Q.config.indicatorClass+"{opacity:0} ."+Q.config.requestClass+" ."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+Q.config.requestClass+"."+Q.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} </style>")}function zr(){var t=re().querySelector('meta[name="htmx-config"]');return t?E(t.content):null}function $r(){var t=zr();t&&(Q.config=le(Q.config,t))}return re().addEventListener("DOMContentLoaded",(function(){Vr=!0})),jr((function(){$r(),_r();var t=re().body;zt(t);var e=re().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");t.addEventListener("htmx:abort",(function(t){var e=ae(t.target);e&&e.xhr&&e.xhr.abort()}));const i=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(t){t.state&&t.state.htmx?(ar(),oe(e,(function(t){ce(t,"htmx:restored",{document:re(),triggerEvent:ce})}))):i&&i(t)},setTimeout((function(){ce(t,"htmx:load",{}),t=null}),0)})),Q}()},__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},517:function(t,e,i){var n=i(4406);t.exports=function(){"use strict";var t,e,i;function r(n,r){if(t)if(e){var s="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk); self.onerror = null;",o={};t(o),i=r(o),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([s],{type:"text/javascript"})))}else e=r;else t=r}return r(["exports"],(function(t){var e="undefined"!=typeof self?self:{},i="3.1.2";let r;const s={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=n.env.API_URL_REGEX?new RegExp(n.env.API_URL_REGEX):t}catch(e){r=t}}return r},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!s.API_URL)return null;try{const t=new URL(s.API_URL);return"api.mapbox.cn"===t.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===t.hostname?"https://events.mapbox.com/events/v2":null}catch(t){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},o={supported:!1,testSupport:function(t){!c&&l&&(h?u(t):a=t)}};let a,l,c=!1,h=!1;function u(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,l),t.isContextLost())return;o.supported=!0}catch(t){}t.deleteTexture(e),c=!0}e.document&&(l=e.document.createElement("img"),l.onload=function(){a&&u(a),a=null,h=!0},l.onerror=function(){c=!0,a=null},l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const d="01";function p(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f=m;function m(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=n}m.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,n=0;n<8;n++){var r=this.sampleCurveX(i)-t;if(Math.abs(r)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=r/s}var o=0,a=1;for(i=t,n=0;n<20&&(r=this.sampleCurveX(i),!(Math.abs(r-t)<e));n++)t>r?o=i:a=i,i=.5*(a-o)+o;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var g=p(f),_=y;function y(t,e){this.x=t,this.y=e}y.prototype={clone:function(){return new y(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},y.convert=function(t){return t instanceof y?t:Array.isArray(t)?new y(t[0],t[1]):t};var v=p(_);function b(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!b(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!b(t[i],e[i]))return!1;return!0}return t===e}const x=Math.PI/180,w=180/Math.PI;function E(t){return t*x}function S(t){return t*w}const T=[[0,0],[1,0],[1,1],[0,1]];function M(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function A(t){let e=1/0,i=1/0,n=-1/0,r=-1/0;for(const s of t)e=Math.min(e,s.x),i=Math.min(i,s.y),n=Math.max(n,s.x),r=Math.max(r,s.y);return{min:new v(e,i),max:new v(n,r)}}function C(t,e,i=0,n=!0){const r=new v(i,i),s=t.sub(r),o=e.add(r),a=[s,new v(o.x,s.y),o,new v(s.x,o.y)];return n&&a.push(s.clone()),a}function k(t,e,i,n){const r=new g(t,e,i,n);return function(t){return r.solve(t)}}const P=k(.25,.1,.25,1);function I(t,e,i){return Math.min(i,Math.max(e,t))}function D(t,e,i){return(i=I((i-t)/(e-t),0,1))*i*(3-2*i)}function O(t,e,i){const n=i-e,r=((t-e)%n+n)%n+e;return r===e?i:r}function L(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const r=new Array(t.length);let s=null;t.forEach(((t,o)=>{e(t,((t,e)=>{t&&(s=t),r[o]=e,0==--n&&i(s,r)}))}))}function z(t){const e=[];for(const i in t)e.push(t[i]);return e}function R(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}function F(t,e){const i={};for(let n=0;n<e.length;n++){const r=e[n];r in t&&(i[r]=t[r])}return i}let B=1;function N(){return B++}function j(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function V(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function U(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function $(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e))}))}function H(t,e){return-1!==t.indexOf(e,t.length-e.length)}function q(t,e,i){const n={};for(const r in t)n[r]=e.call(i||this,t[r],r,t);return n}function W(t,e,i){const n={};for(const r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n}function G(t){return Array.isArray(t)?t.map(G):"object"==typeof t&&t?q(t,G):t}const Z={};function Y(t){Z[t]||("undefined"!=typeof console&&console.warn(t),Z[t]=!0)}function X(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function K(t){let e=0;for(let i,n,r=0,s=t.length,o=s-1;r<s;o=r++)i=t[r],n=t[o],e+=(n.x-i.x)*(i.y+n.y);return e}function Q([t,e,i]){const n=E(e+90),r=E(i);return{x:t*Math.cos(n)*Math.sin(r),y:t*Math.sin(n)*Math.sin(r),z:t*Math.cos(r),azimuthal:e,polar:i}}function J(t,e,i){const n=Math.sqrt(t*t+e*e+i*i),r=n>0?Math.acos(i/n)*w:0;let s=0!==t||0!==e?Math.atan2(-e,-t)*w+90:0;return s<0&&(s+=360),[n,s,r]}function tt(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function et(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,n,r)=>{const s=n||r;return e[i]=!s||s.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e}let it=null;function nt(){return!!e.document.fullscreenElement||!!e.document.webkitFullscreenElement}function rt(t){try{const i=e[t];return i.setItem("_mapbox_test_",1),i.removeItem("_mapbox_test_"),!0}catch(t){return!1}}function st(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}function ot(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]}function at(t,e){return[Math.pow(t[0],2.2)*e,Math.pow(t[1],2.2)*e,Math.pow(t[2],2.2)*e]}function lt(t){return[Math.pow(t[0],1/2.2),Math.pow(t[1],1/2.2),Math.pow(t[2],1/2.2)]}const ct="mapbox-tiles";let ht,ut,dt=500,pt=50;function ft(){try{return e.caches}catch(t){}}function mt(){ft()&&!ht&&(ht=e.caches.open(ct))}function gt(t){const e=t.indexOf("?");if(e<0)return t;const i=function(t){const e=t.indexOf("?");return e>0?t.slice(e+1).split("&"):[]}(t),n=i.filter((t=>{const e=t.split("=");return"language"===e[0]||"worldview"===e[0]}));return n.length?`${t.slice(0,e)}?${n.join("&")}`:t.slice(0,e)}let _t=1/0;function yt(t){_t++,_t>pt&&(t.getActor().send("enforceCacheSizeLimit",dt),_t=0)}const vt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(vt);class bt extends Error{constructor(t,e,i){401===e&&Ot(i)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=e,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const xt=tt()?()=>self.worker&&self.worker.referrer:()=>("blob:"===e.location.protocol?e.parent:e).location.href,wt=function(t,i){if(!(/^file:/.test(n=t.url)||/^file:/.test(xt())&&!/^\w+:/.test(n))){if(e.fetch&&e.Request&&e.AbortController&&e.Request.prototype.hasOwnProperty("signal"))return function(t,i){const n=new e.AbortController,r=new e.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:xt(),referrerPolicy:t.referrerPolicy,signal:n.signal});let s=!1,o=!1;const a=(l=r.url).indexOf("sku=")>0&&Ot(l);var l;"json"===t.type&&r.headers.set("Accept","application/json");const c=(n,s,l)=>{if(o)return;if(n&&"SecurityError"!==n.message&&Y(n.toString()),s&&l)return h(s);const c=Date.now();e.fetch(r).then((e=>{if(e.ok){const t=a?e.clone():null;return h(e,t,c)}return i(new bt(e.statusText,e.status,t.url))})).catch((e=>{"AbortError"!==e.name&&i(new Error(`${e.message} ${t.url}`))}))},h=(n,a,l)=>{("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((t=>{o||(a&&l&&function(t,i,n){if(mt(),!ht)return;const r={status:i.status,statusText:i.statusText,headers:new e.Headers};i.headers.forEach(((t,e)=>r.headers.set(e,t)));const s=et(i.headers.get("Cache-Control")||"");if(s["no-store"])return;s["max-age"]&&r.headers.set("Expires",new Date(n+1e3*s["max-age"]).toUTCString());const o=r.headers.get("Expires");o&&(new Date(o).getTime()-n<42e4||function(t,e){if(void 0===ut)try{new Response(new ReadableStream),ut=!0}catch(t){ut=!1}ut?e(t.body):t.blob().then(e)}(i,(i=>{const n=new e.Response(i,r);mt(),ht&&ht.then((e=>e.put(gt(t.url),n))).catch((t=>Y(t.message)))})))}(r,a,l),s=!0,i(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((t=>{o||i(new Error(t.message))}))};return a?function(t,e){if(mt(),!ht)return e(null);const i=gt(t.url);ht.then((t=>{t.match(i).then((n=>{const r=function(t){if(!t)return!1;const e=new Date(t.headers.get("Expires")||0),i=et(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(n);t.delete(i),r&&t.put(i,n.clone()),e(null,n,r)})).catch(e)})).catch(e)}(r,c):c(null,null),{cancel:()=>{o=!0,s||n.abort()}}}(t,i);if(tt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,i,void 0,!0)}var n;return function(t,i){const n=new e.XMLHttpRequest;n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer");for(const e in t.headers)n.setRequestHeader(e,t.headers[e]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=()=>{i(new Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let e=n.response;if("json"===t.type)try{e=JSON.parse(n.response)}catch(t){return i(t)}i(null,e,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else i(new bt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:()=>n.abort()}}(t,i)},Et=function(t,e){return wt(R(t,{type:"json"}),e)},St=function(t,e){return wt(R(t,{type:"arrayBuffer"}),e)};function Tt(t){const i=e.document.createElement("a");return i.href=t,i.protocol===e.document.location.protocol&&i.host===e.document.location.host}const Mt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let At,Ct;At=[],Ct=0;const kt=function(t,i){if(o.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ct>=s.MAX_PARALLEL_IMAGE_REQUESTS){const e={requestParameters:t,callback:i,cancelled:!1,cancel(){this.cancelled=!0}};return At.push(e),e}Ct++;let n=!1;const r=()=>{if(!n)for(n=!0,Ct--;At.length&&Ct<s.MAX_PARALLEL_IMAGE_REQUESTS;){const t=At.shift(),{requestParameters:e,callback:i,cancelled:n}=t;n||(t.cancel=kt(e,i).cancel)}},a=St(t,((t,n,s,o)=>{r(),t?i(t):n&&(e.createImageBitmap?function(t,i){const n=new e.Blob([new Uint8Array(t)],{type:"image/png"});e.createImageBitmap(n).then((t=>{i(null,t)})).catch((t=>{i(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(n,((t,e)=>i(t,e,s,o))):function(t,i){const n=new e.Image,r=e.URL;n.onload=()=>{i(null,n),r.revokeObjectURL(n.src),n.onload=null,e.requestAnimationFrame((()=>{n.src=Mt}))},n.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const s=new e.Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?r.createObjectURL(s):Mt}(n,((t,e)=>i(t,e,s,o))))}));return{cancel:()=>{a.cancel(),r()}}},Pt="NO_ACCESS_TOKEN";class It{constructor(t,e,i){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const t=function(){let t="";for(let e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",d,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!Dt(t))return t;const n=Bt(t);return n.params.push(`sdk=js-${i}`),n.path=`/styles/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!Dt(t))return t;const i=Bt(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeModelURL(t,e){if(!Dt(t))return t;const i=Bt(t);return i.path=`/models/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e,i,n){if(!Dt(t))return t;const r=Bt(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),i&&r.params.push(`language=${i}`),n&&r.params.push(`worldview=${n}`),this._makeAPIURL(r,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const r=Bt(t);return Dt(t)?(r.path=`/styles/v1${r.path}/sprite${e}${i}`,this._makeAPIURL(r,this._customAccessToken||n)):(r.path+=`${e}${i}`,Nt(r))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Dt(t))return t;const n=Bt(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==n.authority&&512===i?"@2x":""}${o.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${s.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${s.TILE_URL_VERSION}${n.path}`);const r=this._customAccessToken||function(t){for(const e of t){const t=e.match(/^access_token=(.*)$/);if(t)return t[1]}return null}(n.params)||s.ACCESS_TOKEN;return s.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,r)}canonicalizeTileURL(t,e){const i=Bt(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${s.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${s.TILE_URL_VERSION}/`,"")}`;let r=i.params;return e&&(r=r.filter((t=>!t.match(/^access_token=/)))),r.length&&(n+=`?${r.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&Dt(e),n=[];for(const e of t.tiles||[])Ot(e)?n.push(this.canonicalizeTileURL(e,i)):n.push(e);return n}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=Bt(s.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==n.path&&(t.path=`${n.path}${t.path}`),!s.REQUIRE_ACCESS_TOKEN)return Nt(t);if(e=e||s.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e||""}`),Nt(t)}}function Dt(t){return 0===t.indexOf("mapbox:")}function Ot(t){return s.API_URL_REGEX.test(t)}function Lt(t){return s.API_CDN_URL_REGEX.test(t)}function zt(t){return s.API_STYLE_REGEX.test(t)&&!Rt(t)}function Rt(t){return s.API_SPRITE_REGEX.test(t)}const Ft=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Bt(t){const e=t.match(Ft);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Nt(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const jt="mapbox.eventData";function Vt(t){if(!t)return null;const i=t.split(".");if(!i||3!==i.length)return null;try{return JSON.parse(decodeURIComponent(e.atob(i[1]).split("").map((t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(t){return null}}class Ut{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=Vt(s.ACCESS_TOKEN);let n="";return n=i&&i.u?e.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(Number("0x"+e))))):s.ACCESS_TOKEN||"",t?`${jt}.${t}:${n}`:`${jt}:${n}`}fetchEventData(){const t=rt("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{const t=e.localStorage.getItem(i);t&&(this.eventData=JSON.parse(t));const r=e.localStorage.getItem(n);r&&(this.anonId=r)}catch(t){Y("Unable to read from LocalStorage")}}saveEventData(){const t=rt("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{e.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&e.localStorage.setItem(i,JSON.stringify(this.eventData))}catch(t){Y("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,e,i,n){if(!s.EVENTS_URL)return;const r=Bt(s.EVENTS_URL);r.params.push(`access_token=${n||s.ACCESS_TOKEN||""}`);const o={event:this.type,created:new Date(t).toISOString()},a=e?R(o,e):o,l={url:Nt(r),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=function(t,e){return wt(R(t,{method:"POST"}),e)}(l,(t=>{this.pendingRequest=null,i(t),this.saveEventData(),this.processRequests(n)}))}queueRequest(t,e){this.queue.push(t),this.processRequests(e)}}const $t=new class extends Ut{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){s.EVENTS_URL&&s.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>Dt(t)||Ot(t)))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=Vt(s.ACCESS_TOKEN),n=e?e.u:s.ACCESS_TOKEN;let r=n!==this.eventData.tokenU;U(this.anonId)||(this.anonId=j(),r=!0);const o=this.queue.shift();if(this.eventData.lastSuccess){const t=new Date(this.eventData.lastSuccess),e=new Date(o),i=(o-this.eventData.lastSuccess)/864e5;r=r||i>=1||i<-1||t.getDate()!==e.getDate()}else r=!0;r?this.postEvent(o,{sdkIdentifier:"mapbox-gl-js",sdkVersion:i,skuId:d,"enabled.telemetry":!1,userId:this.anonId},(t=>{t||(this.eventData.lastSuccess=o,this.eventData.tokenU=n)}),t):this.processRequests()}},Ht=$t.postTurnstileEvent.bind($t),qt=new class extends Ut{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,s.EVENTS_URL&&(i||s.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(Pt)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:n}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),U(this.anonId)||(this.anonId=j()),this.postEvent(n,{sdkIdentifier:"mapbox-gl-js",sdkVersion:i,skuId:d,skuToken:this.skuToken,userId:this.anonId},(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t))}},Wt=qt.postMapLoadEvent.bind(qt),Gt=new class extends Ut{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){s.EVENTS_URL&&(t||s.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:n,performanceData:r}=this.queue.shift(),s=function(t){const n=e.performance.getEntriesByType("resource"),r=e.performance.getEntriesByType("mark"),s=function(t){const e={};if(t)for(const i in t)if("other"!==i)for(const n of t[i]){const t=`${i}ResolveRangeMin`,r=`${i}ResolveRangeMax`,s=`${i}RequestCount`,o=`${i}RequestCachedCount`;e[t]=Math.min(e[t]||1/0,n.startTime),e[r]=Math.max(e[r]||-1/0,n.responseEnd);const a=t=>{void 0===e[t]&&(e[t]=0),++e[t]};void 0!==n.transferSize&&0===n.transferSize&&a(o),a(s)}return e}(function(t,e){const i={};if(t)for(const n of t){const t=e(n);void 0===i[t]&&(i[t]=[]),i[t].push(n)}return i}(n,ee)),o=e.devicePixelRatio,a=e.navigator.connection||e.navigator.mozConnection||e.navigator.webkitConnection,l={counters:[],metadata:[],attributes:[]},c=(t,e,i)=>{null!=i&&t.push({name:e,value:i.toString()})};for(const t in s)c(l.counters,t,s[t]);if(t.interactionRange[0]!==1/0&&t.interactionRange[1]!==-1/0&&(c(l.counters,"interactionRangeMin",t.interactionRange[0]),c(l.counters,"interactionRangeMax",t.interactionRange[1])),r)for(const t of Object.keys(Jt)){const e=Jt[t],i=r.find((t=>t.name===e));i&&c(l.counters,e,i.startTime)}return c(l.counters,"visibilityHidden",t.visibilityHidden),c(l.attributes,"style",function(t){if(t)for(const e of t){const t=e.name.split("?")[0];if(zt(t)){const e=t.split("/").slice(-2);if(2===e.length)return`mapbox://styles/${e[0]}/${e[1]}`}}}(n)),c(l.attributes,"terrainEnabled",t.terrainEnabled?"true":"false"),c(l.attributes,"fogEnabled",t.fogEnabled?"true":"false"),c(l.attributes,"projection",t.projection),c(l.attributes,"zoom",t.zoom),c(l.metadata,"devicePixelRatio",o),c(l.metadata,"connectionEffectiveType",a?a.effectiveType:void 0),c(l.metadata,"navigatorUserAgent",e.navigator.userAgent),c(l.metadata,"screenWidth",e.screen.width),c(l.metadata,"screenHeight",e.screen.height),c(l.metadata,"windowWidth",e.innerWidth),c(l.metadata,"windowHeight",e.innerHeight),c(l.metadata,"mapWidth",t.width/o),c(l.metadata,"mapHeight",t.height/o),c(l.metadata,"webglRenderer",t.renderer),c(l.metadata,"webglVendor",t.vendor),c(l.metadata,"sdkVersion",i),c(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(r);for(const t of s.metadata);for(const t of s.counters);for(const t of s.attributes);this.postEvent(n,s,(()=>{}),t)}},Zt=Gt.postPerformanceEvent.bind(Gt),Yt=new class extends Ut{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!s.API_URL||!s.SESSION_PATH)return;const r=Bt(s.API_URL+s.SESSION_PATH);r.params.push(`sku=${e||""}`),r.params.push(`access_token=${n||s.ACCESS_TOKEN||""}`);const o={url:Nt(r),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(t,e){return wt(R(t,{method:"GET"}),e)}(o,(t=>{this.pendingRequest=null,i(t),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,s.SESSION_PATH&&s.API_URL&&(i||s.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(Pt)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t)}},Xt=Yt.getSessionAPI.bind(Yt),Kt=new Set;function Qt(t,e){e?Kt.add(t):Kt.delete(t)}const Jt={create:"create",load:"load",fullLoad:"fullLoad"},te={mark(t){e.performance.mark(t)},measure(t,i,n){e.performance.measure(t,i,n)}};function ee(t){const e=t.name.split("?")[0];return Lt(e)&&e.includes("mapbox-gl.js")?"javascript":Lt(e)&&e.includes("mapbox-gl.css")?"css":function(t){return s.API_FONTS_REGEX.test(t)}(e)?"fontRange":Rt(e)?"sprite":zt(e)?"style":function(t){return s.API_TILEJSON_REGEX.test(t)}(e)?"tilejson":"other"}const ie=e.performance;function ne(t){const e=t?t.url.toString():void 0;return ie.getEntriesByName(e)}var re=se;function se(t){return!function(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===oe[e=t&&t.failIfMajorPerformanceCaveat]&&(oe[e]=function(t){var e,i=function(t){var e=document.createElement("canvas"),i=Object.create(se.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,e.getContext("webgl",i)||e.getContext("experimental-webgl",i)}(t);if(!i)return!1;try{e=i.createShader(i.VERTEX_SHADER)}catch(t){return!1}return!(!e||i.isContextLost())&&(i.shaderSource(e,"void main() {}"),i.compileShader(e),!0===i.getShaderParameter(e,i.COMPILE_STATUS))}(e)),oe[e]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var e}(t)}var oe={};let ae,le,ce,he,ue;function de(){return null==ae&&(ae=e.OffscreenCanvas&&new e.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof e.createImageBitmap),ae}se.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const pe={now:()=>void 0!==he?he:e.performance.now(),setNow(t){he=t},restoreNow(){he=void 0},frame(t){const i=e.requestAnimationFrame(t);return{cancel:()=>e.cancelAnimationFrame(i)}},getImageData(t,i=0){const{width:n,height:r}=t;ue||(ue=e.document.createElement("canvas"));const s=ue.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return(n>ue.width||r>ue.height)&&(ue.width=n,ue.height=r),s.clearRect(-i,-i,n+2*i,r+2*i),s.drawImage(t,0,0,n,r),s.getImageData(-i,-i,n+2*i,r+2*i)},resolveURL:t=>(le||(le=e.document.createElement("a")),le.href=t,le.href),get devicePixelRatio(){return e.devicePixelRatio},get prefersReducedMotion(){return!!e.matchMedia&&(null==ce&&(ce=e.matchMedia("(prefers-reduced-motion: reduce)")),ce.matches)},hasCanvasFingerprintNoise(){if(!de())return!1;const t=new e.OffscreenCanvas(85,1),i=t.getContext("2d",{willReadFrequently:!0});let n=0;for(let e=0;e<t.width;++e)i.fillStyle=`rgba(${n++},${n++},${n++}, 255)`,i.fillRect(e,0,1,1);const r=i.getImageData(0,0,t.width,t.height);n=0;for(let t=0;t<r.data.length;++t)if(t%4!=3&&n++!==r.data[t])return!0;return!1}};function fe(t,i,n){const r=e.document.createElement(t);return void 0!==i&&(r.className=i),n&&n.appendChild(r),r}function me(t,i,n){const r=e.document.createElementNS("http://www.w3.org/2000/svg",t);for(const t of Object.keys(i))r.setAttributeNS(null,t,i[t]);return n&&n.appendChild(r),r}const ge=e.document&&e.document.documentElement.style,_e=ge&&void 0!==ge.userSelect?"userSelect":"WebkitUserSelect";let ye;function ve(){ge&&_e&&(ye=ge[_e],ge[_e]="none")}function be(){ge&&_e&&(ge[_e]=ye)}function xe(t){t.preventDefault(),t.stopPropagation(),e.removeEventListener("click",xe,!0)}function we(){e.addEventListener("click",xe,!0),e.setTimeout((()=>{e.removeEventListener("click",xe,!0)}),0)}function Ee(t,e){const i=t.getBoundingClientRect();return Me(t,i,e)}function Se(t,e){const i=t.getBoundingClientRect(),n=[];for(let r=0;r<e.length;r++)n.push(Me(t,i,e[r]));return n}function Te(t){return void 0!==e.InstallTrigger&&2===t.button&&t.ctrlKey&&e.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button}function Me(t,e,i){const n=t.offsetWidth===e.width?1:t.offsetWidth/e.width;return new v((i.clientX-e.left)*n,(i.clientY-e.top)*n)}function Ae(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Ce(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);-1!==n&&i[t].splice(n,1)}}class ke{constructor(t,e={}){R(this,e),this.type=t}}class Pe extends ke{constructor(t,e={}){super("error",R({error:t},e))}}class Ie{on(t,e){return this._listeners=this._listeners||{},Ae(t,e,this._listeners),this}off(t,e){return Ce(t,e,this._listeners),Ce(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},Ae(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new ke(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of n)Ce(i,e,this._oneTimeListeners),e.call(this,t);const r=this._eventedParent;r&&(R(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(t))}else t instanceof Pe&&console.error(t.error);return this}listens(t){return!!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var De=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"camera":{"type":"camera"},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"expression":{},"property-type":"data-constant"},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","default":[0,1],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');class Oe{constructor(t,e,i,n){this.message=(t?`${t}: `:"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)}}class Le extends Oe{}function ze(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}function Re(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Fe(t){if(Array.isArray(t))return t.map(Fe);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Fe(t[i]);return e}return Re(t)}class Be extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var Ne=Be;class je{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new je(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var Ve=je;const Ue={kind:"null"},$e={kind:"number"},He={kind:"string"},qe={kind:"boolean"},We={kind:"color"},Ge={kind:"object"},Ze={kind:"value"},Ye={kind:"collator"},Xe={kind:"formatted"},Ke={kind:"resolvedImage"};function Qe(t,e){return{kind:"array",itemType:t,N:e}}function Je(t){if("array"===t.kind){const e=Je(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const ti=[Ue,$e,He,qe,We,Xe,Ge,Qe(Ze),Ke];function ei(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ei(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of ti)if(!ei(t,e))return null}return`Expected ${Je(t)} but found ${Je(e)} instead.`}function ii(t,e){return e.some((e=>e.kind===t.kind))}function ni(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var ri,si={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function oi(t){return(t=Math.round(t))<0?0:t>255?255:t}function ai(t){return oi("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function li(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function ci(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{ri={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in si)return si[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),r=i.indexOf(")");if(-1!==n&&r+1===i.length){var s=i.substr(0,n),o=i.substr(n+1,r-(n+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=li(o.pop());case"rgb":return 3!==o.length?null:[ai(o[0]),ai(o[1]),ai(o[2]),a];case"hsla":if(4!==o.length)return null;a=li(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,c=li(o[1]),h=li(o[2]),u=h<=.5?h*(c+1):h+c-h*c,d=2*h-u;return[oi(255*ci(d,u,l+1/3)),oi(255*ci(d,u,l)),oi(255*ci(d,u,l-1/3)),a];default:return null}}return null}}catch(t){}class hi{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof hi)return t;if("string"!=typeof t)return;const e=ri(t);return e?new hi(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}toArray01(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[t/n,e/n,i/n,n]}toArray01Scaled(t){const{r:e,g:i,b:n,a:r}=this;return 0===r?[0,0,0]:[e/r*t,i/r*t,n/r*t]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:i,a:n}=this;return[t,e,i,n]}toArray01Linear(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[Math.pow(t/n,2.2),Math.pow(e/n,2.2),Math.pow(i/n,2.2),n]}}hi.black=new hi(0,0,0,1),hi.white=new hi(1,1,1,1),hi.transparent=new hi(0,0,0,0),hi.red=new hi(1,0,0,1),hi.blue=new hi(0,0,1,1);var ui=hi;class di{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class pi{constructor(t,e,i,n,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class fi{constructor(t){this.sections=t}static fromString(t){return new fi([new pi(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.namePrimary.length))}static factory(t){return t instanceof fi?t:fi.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.namePrimary]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class mi{constructor(t){this.namePrimary=t.namePrimary,t.nameSecondary&&(this.nameSecondary=t.nameSecondary),this.available=t.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(t,e){return t?new mi({namePrimary:t,nameSecondary:e,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function gi(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function _i(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof ui)return!0;if(t instanceof di)return!0;if(t instanceof fi)return!0;if(t instanceof mi)return!0;if(Array.isArray(t)){for(const e of t)if(!_i(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!_i(t[e]))return!1;return!0}return!1}function yi(t){if(null===t)return Ue;if("string"==typeof t)return He;if("boolean"==typeof t)return qe;if("number"==typeof t)return $e;if(t instanceof ui)return We;if(t instanceof di)return Ye;if(t instanceof fi)return Xe;if(t instanceof mi)return Ke;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=yi(e);if(i){if(i===t)continue;i=Ze;break}i=t}return Qe(i||Ze,e)}return Ge}function vi(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ui||t instanceof fi||t instanceof mi?t.toString():JSON.stringify(t)}class bi{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!_i(t[1]))return e.error("invalid value");const i=t[1];let n=yi(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new bi(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ui?["rgba"].concat(this.value.toArray()):this.value instanceof fi?this.value.serialize():this.value}}var xi=bi,wi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Ei={string:He,number:$e,boolean:qe,object:Ge};class Si{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,s;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in Ei)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=Ei[i],n++}else r=Ze;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],n++}i=Qe(r,s)}else i=Ei[r];const s=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Ze);if(!i)return null;s.push(i)}return new Si(i,s)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!ei(this.type,yi(i)))return i;if(e===this.args.length-1)throw new wi(`Expected value to be of type ${Je(this.type)}, but found ${Je(yi(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}var Ti=Si;class Mi{constructor(t){this.type=Xe,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=t.length-1;++i){const s=t[i];if(r&&"object"==typeof s&&!Array.isArray(s)){r=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,$e),!t))return null;let i=null;if(s["text-font"]&&(i=e.parse(s["text-font"],1,Qe(He)),!i))return null;let o=null;if(s["text-color"]&&(o=e.parse(s["text-color"],1,We),!o))return null;const a=n[n.length-1];a.scale=t,a.font=i,a.textColor=o}else{const s=e.parse(t[i],1,Ze);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:s,scale:null,font:null,textColor:null})}}return new Mi(n)}evaluate(t){return new fi(this.sections.map((e=>{const i=e.content.evaluate(t);return yi(i)===Ke?new pi("",i,null,null,null):new pi(vi(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class Ai{constructor(t,e){this.type=Ke,this.inputPrimary=t,this.inputSecondary=e}static parse(t,e){if(t.length<2)return e.error("Expected two or more arguments.");const i=e.parse(t[1],1,He);if(!i)return e.error("No image name provided.");if(2===t.length)return new Ai(i);const n=e.parse(t[2],1,He);return n?new Ai(i,n):e.error("Secondary image variant is not a string.")}evaluate(t){const e=mi.fromString(this.inputPrimary.evaluate(t),this.inputSecondary?this.inputSecondary.evaluate(t):void 0);return e&&t.availableImages&&(e.available=t.availableImages.indexOf(e.namePrimary)>-1,e.nameSecondary&&e.available&&t.availableImages&&(e.available=t.availableImages.indexOf(e.nameSecondary)>-1)),e}eachChild(t){t(this.inputPrimary),this.inputSecondary&&t(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function Ci(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}const ki={"to-boolean":qe,"to-color":We,"to-number":$e,"to-string":He};class Pi{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0],n=[];let r=Ue;if("to-array"===i){if(!Array.isArray(t[1]))return null;const i=t[1].length;if(e.expectedType){if("array"!==e.expectedType.kind)return e.error(`Expected ${e.expectedType.kind} but found array.`);r=Qe(e.expectedType.itemType,i)}else{if(!(i>0&&_i(t[1][0])))return null;r=Qe(yi(t[1][0]),i)}for(let s=0;s<i;s++){const i=t[1][s];let o;if("array"===Ci(i))o=e.parse(i,void 0,r.itemType);else{const t=Ci(i);if(t!==r.itemType.kind)return e.error(`Expected ${r.itemType.kind} but found ${t}.`);o=e.registry.literal.parse(["literal",void 0===i?null:i],e)}if(!o)return null;n.push(o)}}else{if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");r=ki[i];for(let i=1;i<t.length;i++){const r=e.parse(t[i],i,Ze);if(!r)return null;n.push(r)}}return new Pi(r,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof ui)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:gi(e[0],e[1],e[2],e[3]),!i))return new ui(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new wi(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new wi(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?fi.fromString(vi(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?mi.fromString(vi(this.args[0].evaluate(t))):"array"===this.type.kind?this.args.map((e=>e.evaluate(t))):vi(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Mi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ai(this.args[0]).serialize();const t="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Ii=Pi;const Di=["Unknown","Point","LineString","Polygon"];var Oi=class{constructor(t){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Di[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(t){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ui.parse(t)),e}getConfig(t){return this.options?this.options.get(t):null}};class Li{constructor(t,e,i,n,r){this.name=t,this.type=e,this._evaluate=i,this.args=n,this._overloadIndex=r}evaluate(t){if(!this._evaluate){const t=Li.definitions[this.name];this._evaluate=Array.isArray(t)?t[2]:t.overloads[this._overloadIndex][1]}return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=Li.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=[];let a=null,l=-1;for(const[n,c]of s){if(Array.isArray(n)&&n.length!==t.length-1)continue;o.push(n),l++,a=new Zn(e.registry,e.path,null,e.scope,void 0,e.options);const s=[];let h=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(n)?n[e-1]:n.type,o=a.parse(i,1+s.length,r);if(!o){h=!0;break}s.push(o)}if(!h)if(Array.isArray(n)&&n.length!==s.length)a.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(n)?n[t]:n.type,i=s[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new Li(i,r,c,s,l)}}if(1===o.length)e.errors.push(...a.errors);else{const i=(o.length?o:s.map((([t])=>t))).map(zi).join(" | "),n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],1+n.length);if(!r)return null;n.push(Je(r.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){Li.definitions=e;for(const i in e)t[i]=Li}}function zi(t){return Array.isArray(t)?`(${t.map(Je).join(", ")})`:`(${Je(t.type)}...)`}var Ri=Li;class Fi{constructor(t,e,i){this.type=Ye,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,qe);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,qe);if(!r)return null;let s=null;return i.locale&&(s=e.parse(i.locale,1,He),!s)?null:new Fi(n,r,s)}evaluate(t){return new di(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}var Bi={exports:{}};Bi.exports=function(){function t(i,n,r,s,o){for(;s>r;){if(s-r>600){var a=s-r+1,l=n-r+1,c=Math.log(a),h=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*h*(a-h)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(r,Math.floor(n-l*h/a+u)),Math.min(s,Math.floor(n+(a-l)*h/a+u)),o)}var d=i[n],p=r,f=s;for(e(i,r,n),o(i[s],d)>0&&e(i,r,s);p<f;){for(e(i,p,f),p++,f--;o(i[p],d)<0;)p++;for(;o(i[f],d)>0;)f--}0===o(i[r],d)?e(i,r,f):e(i,++f,s),f<=n&&(r=f+1),n<=f&&(s=f-1)}}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return t<e?-1:t>e?1:0}return function(e,n,r,s,o){t(e,n,r||0,s||e.length-1,o||i)}}();var Ni=p(Bi.exports);function ji(t){let e=0;for(let i,n,r=0,s=t.length,o=s-1;r<s;o=r++)i=t[r],n=t[o],e+=(n.x-i.x)*(i.y+n.y);return e}function Vi(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ui(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function $i(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],s=t[0]-i[0],o=t[1]-i[1];return n*o-s*r==0&&n*s<=0&&r*o<=0}function Hi(t,e,i=!1){let n=!1;for(let a=0,l=e.length;a<l;a++){const l=e[a];for(let e=0,a=l.length,c=a-1;e<a;c=e++){const a=l[c],h=l[e];if($i(t,a,h))return i;(s=a)[1]>(r=t)[1]!=(o=h)[1]>r[1]&&r[0]<(o[0]-s[0])*(r[1]-s[1])/(o[1]-s[1])+s[0]&&(n=!n)}}var r,s,o;return n}function qi(t,e,i,n){const r=n[0]-i[0],s=n[1]-i[1],o=(t[0]-i[0])*s-r*(t[1]-i[1]),a=(e[0]-i[0])*s-r*(e[1]-i[1]);return o>0&&a<0||o<0&&a>0}function Wi(t,e,i,n){return 0!=(r=[n[0]-i[0],n[1]-i[1]])[0]*(s=[e[0]-t[0],e[1]-t[1]])[1]-r[1]*s[0]&&!(!qi(t,e,i,n)||!qi(i,n,t,e));var r,s}const Gi=8192;function Zi(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(i*r*Gi),Math.round(n*r*Gi)]}function Yi(t,e){for(let i=0;i<e.length;i++)if(Hi(t,e[i]))return!0;return!1}function Xi(t,e,i){for(const n of i)for(let i=0,r=n.length,s=r-1;i<r;s=i++)if(Wi(t,e,n[s],n[i]))return!0;return!1}function Ki(t,e){for(let i=0;i<t.length;++i)if(!Hi(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Xi(t[i],t[i+1],e))return!1;return!0}function Qi(t,e){for(let i=0;i<e.length;i++)if(Ki(t,e[i]))return!0;return!1}function Ji(t,e,i){const n=[];for(let r=0;r<t.length;r++){const s=[];for(let n=0;n<t[r].length;n++){const o=Zi(t[r][n],i);Vi(e,o),s.push(o)}n.push(s)}return n}function tn(t,e,i){const n=[];for(let r=0;r<t.length;r++){const s=Ji(t[r],e,i);n.push(s)}return n}function en(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}Vi(e,t)}function nn(t,e,i,n){const r=Math.pow(2,n.z)*Gi,s=[n.x*Gi,n.y*Gi],o=[];if(!t)return o;for(const n of t)for(const t of n){const n=[t.x+s[0],t.y+s[1]];en(n,e,i,r),o.push(n)}return o}function rn(t,e,i,n){const r=Math.pow(2,n.z)*Gi,s=[n.x*Gi,n.y*Gi],o=[];if(!t)return o;for(const i of t){const t=[];for(const n of i){const i=[n.x+s[0],n.y+s[1]];Vi(e,i),t.push(i)}o.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const n of t)en(n,e,i,r)}var a;return o}class sn{constructor(t,e){this.type=qe,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(_i(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new sn(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new sn(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new sn(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const s=Ji(e.coordinates,n,r),o=nn(t.geometry(),i,n,r);if(!Ui(i,n))return!1;for(const t of o)if(!Hi(t,s))return!1}if("MultiPolygon"===e.type){const s=tn(e.coordinates,n,r),o=nn(t.geometry(),i,n,r);if(!Ui(i,n))return!1;for(const t of o)if(!Yi(t,s))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const s=Ji(e.coordinates,n,r),o=rn(t.geometry(),i,n,r);if(!Ui(i,n))return!1;for(const t of o)if(!Ki(t,s))return!1}if("MultiPolygon"===e.type){const s=tn(e.coordinates,n,r),o=rn(t.geometry(),i,n,r);if(!Ui(i,n))return!1;for(const t of o)if(!Qi(t,s))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var on=sn,an={exports:{}};an.exports=function(){var t={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},e=1/298.257223563,i=e*(2-e),n=Math.PI/180,r=function(e,r){if(void 0===e)throw new Error("No latitude given.");if(r&&!t[r])throw new Error("Unknown unit "+r+". Use one of: "+Object.keys(t).join(", "));var s=6378.137*n*(r?t[r]:1),o=Math.cos(e*n),a=1/(1-i*(1-o*o)),l=Math.sqrt(a);this.kx=s*l*o,this.ky=s*l*a*(1-i)},s={units:{configurable:!0}};function o(t,e){return t[0]===e[0]&&t[1]===e[1]}function a(t,e,i){var n=l(e[0]-t[0]);return[t[0]+n*i,t[1]+(e[1]-t[1])*i]}function l(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}return r.fromTile=function(t,e,i){var s=Math.PI*(1-2*(t+.5)/Math.pow(2,e)),o=Math.atan(.5*(Math.exp(s)-Math.exp(-s)))/n;return new r(o,i)},s.units.get=function(){return t},r.prototype.distance=function(t,e){var i=l(t[0]-e[0])*this.kx,n=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+n*n)},r.prototype.bearing=function(t,e){var i=l(e[0]-t[0])*this.kx;return Math.atan2(i,(e[1]-t[1])*this.ky)/n},r.prototype.destination=function(t,e,i){var r=i*n;return this.offset(t,Math.sin(r)*e,Math.cos(r)*e)},r.prototype.offset=function(t,e,i){return[t[0]+e/this.kx,t[1]+i/this.ky]},r.prototype.lineDistance=function(t){for(var e=0,i=0;i<t.length-1;i++)e+=this.distance(t[i],t[i+1]);return e},r.prototype.area=function(t){for(var e=0,i=0;i<t.length;i++)for(var n=t[i],r=0,s=n.length,o=s-1;r<s;o=r++)e+=l(n[r][0]-n[o][0])*(n[r][1]+n[o][1])*(i?-1:1);return Math.abs(e)/2*this.kx*this.ky},r.prototype.along=function(t,e){var i=0;if(e<=0)return t[0];for(var n=0;n<t.length-1;n++){var r=t[n],s=t[n+1],o=this.distance(r,s);if((i+=o)>e)return a(r,s,(e-(i-o))/o)}return t[t.length-1]},r.prototype.pointToSegmentDistance=function(t,e,i){var n=e[0],r=e[1],s=l(i[0]-n)*this.kx,o=(i[1]-r)*this.ky,a=0;return 0===s&&0===o||((a=(l(t[0]-n)*this.kx*s+(t[1]-r)*this.ky*o)/(s*s+o*o))>1?(n=i[0],r=i[1]):a>0&&(n+=s/this.kx*a,r+=o/this.ky*a)),s=l(t[0]-n)*this.kx,o=(t[1]-r)*this.ky,Math.sqrt(s*s+o*o)},r.prototype.pointOnLine=function(t,e){for(var i,n,r,s,o=1/0,a=0;a<t.length-1;a++){var c=t[a][0],h=t[a][1],u=l(t[a+1][0]-c)*this.kx,d=(t[a+1][1]-h)*this.ky,p=0;0===u&&0===d||((p=(l(e[0]-c)*this.kx*u+(e[1]-h)*this.ky*d)/(u*u+d*d))>1?(c=t[a+1][0],h=t[a+1][1]):p>0&&(c+=u/this.kx*p,h+=d/this.ky*p));var f=(u=l(e[0]-c)*this.kx)*u+(d=(e[1]-h)*this.ky)*d;f<o&&(o=f,i=c,n=h,r=a,s=p)}return{point:[i,n],index:r,t:Math.max(0,Math.min(1,s))}},r.prototype.lineSlice=function(t,e,i){var n=this.pointOnLine(i,t),r=this.pointOnLine(i,e);if(n.index>r.index||n.index===r.index&&n.t>r.t){var s=n;n=r,r=s}var a=[n.point],l=n.index+1,c=r.index;!o(i[l],a[0])&&l<=c&&a.push(i[l]);for(var h=l+1;h<=c;h++)a.push(i[h]);return o(i[c],r.point)||a.push(r.point),a},r.prototype.lineSliceAlong=function(t,e,i){for(var n=0,r=[],s=0;s<i.length-1;s++){var o=i[s],l=i[s+1],c=this.distance(o,l);if((n+=c)>t&&0===r.length&&r.push(a(o,l,(t-(n-c))/c)),n>=e)return r.push(a(o,l,(e-(n-c))/c)),r;n>t&&r.push(l)}return r},r.prototype.bufferPoint=function(t,e){var i=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-i,t[0]+n,t[1]+i]},r.prototype.bufferBBox=function(t,e){var i=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-i,t[2]+n,t[3]+i]},r.prototype.insideBBox=function(t,e){return l(t[0]-e[0])>=0&&l(t[0]-e[2])<=0&&t[1]>=e[1]&&t[1]<=e[3]},Object.defineProperties(r,s),r}();var ln=p(an.exports),cn={exports:{}};cn.exports=function(){var t=function(t,i){if(void 0===t&&(t=[]),void 0===i&&(i=e),this.data=t,this.length=this.data.length,this.compare=i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function e(t,e){return t<e?-1:t>e?1:0}return t.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},t.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},t.prototype.peek=function(){return this.data[0]},t.prototype._up=function(t){for(var e=this.data,i=this.compare,n=e[t];t>0;){var r=t-1>>1,s=e[r];if(i(n,s)>=0)break;e[t]=s,t=r}e[t]=n},t.prototype._down=function(t){for(var e=this.data,i=this.compare,n=this.length>>1,r=e[t];t<n;){var s=1+(t<<1),o=e[s],a=s+1;if(a<this.length&&i(e[a],o)<0&&(s=a,o=e[a]),i(o,r)>=0)break;e[t]=o,t=s}e[t]=r},t}();var hn=p(cn.exports),un=8192;function dn(t,e){return e.dist-t.dist}const pn=100,fn=50;function mn(t){const e=[1/0,1/0,-1/0,-1/0];if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}function gn(t){return t[1]-t[0]+1}function _n(t,e){const i=t[1]>=t[0]&&t[1]<e;return i||console.warn("Distance Expression: Index is out of range"),i}function yn(t,e){if(t[0]>t[1])return[null,null];const i=gn(t);if(e){if(2===i)return[t,null];const e=Math.floor(i/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}{if(1===i)return[t,null];const e=Math.floor(i/2)-1;return[[t[0],t[0]+e],[t[0]+e+1,t[1]]]}}function vn(t,e){const i=[1/0,1/0,-1/0,-1/0];if(!_n(e,t.length))return i;for(let n=e[0];n<=e[1];++n)Vi(i,t[n]);return i}function bn(t){const e=[1/0,1/0,-1/0,-1/0];for(let i=0;i<t.length;++i)for(let n=0;n<t[i].length;++n)Vi(e,t[i][n]);return e}function xn(t,e,i){if(mn(t)||mn(e))return NaN;let n=0,r=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(r=t[1]-e[3]),t[3]<e[1]&&(r=e[1]-t[3]),i.distance([0,0],[n,r])}function wn(t,e){const i=Math.pow(2,e.z);return[(r=(t.x/un+e.x)/i,360*r-180),(n=(t.y/un+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,r}function En(t,e){const i=[];for(let n=0;n<t.length;++n)i.push(wn(t[n],e));return i}function Sn(t,e,i){const n=i.pointOnLine(e,t).point;return i.distance(t,n)}function Tn(t,e,i,n,r){const s=i.slice(n[0],n[1]+1);let o=1/0;for(let i=e[0];i<=e[1];++i)if(0===(o=Math.min(o,Sn(t[i],s,r))))return 0;return o}function Mn(t,e,i,n,r){const s=Math.min(r.pointToSegmentDistance(t,i,n),r.pointToSegmentDistance(e,i,n)),o=Math.min(r.pointToSegmentDistance(i,t,e),r.pointToSegmentDistance(n,t,e));return Math.min(s,o)}function An(t,e,i,n,r){if(!_n(e,t.length)||!_n(n,i.length))return NaN;let s=1/0;for(let o=e[0];o<e[1];++o)for(let e=n[0];e<n[1];++e){if(Wi(t[o],t[o+1],i[e],i[e+1]))return 0;s=Math.min(s,Mn(t[o],t[o+1],i[e],i[e+1],r))}return s}function Cn(t,e,i,n,r){if(!_n(e,t.length)||!_n(n,i.length))return NaN;let s=1/0;for(let o=e[0];o<=e[1];++o)for(let e=n[0];e<=n[1];++e)if(0===(s=Math.min(s,r.distance(t[o],i[e]))))return s;return s}function kn(t,e,i){if(Hi(t,e,!0))return 0;let n=1/0;for(const r of e){const e=r.length;if(e<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(r[0]!==r[e-1]&&0===(n=Math.min(n,i.pointToSegmentDistance(t,r[e-1],r[0]))))return n;if(0===(n=Math.min(n,Sn(t,r,i))))return n}return n}function Pn(t,e,i,n){if(!_n(e,t.length))return NaN;for(let n=e[0];n<=e[1];++n)if(Hi(t[n],i,!0))return 0;let r=1/0;for(let s=e[0];s<e[1];++s)for(const e of i)for(let i=0,o=e.length,a=o-1;i<o;a=i++){if(Wi(t[s],t[s+1],e[a],e[i]))return 0;r=Math.min(r,Mn(t[s],t[s+1],e[a],e[i],n))}return r}function In(t,e){for(const i of t)for(let t=0;t<=i.length-1;++t)if(Hi(i[t],e,!0))return!0;return!1}function Dn(t,e,i,n=1/0){const r=bn(t),s=bn(e);if(n!==1/0&&xn(r,s,i)>=n)return n;if(Ui(r,s)){if(In(t,e))return 0}else if(In(e,t))return 0;let o=n;for(const n of t)for(let t=0,r=n.length,s=r-1;t<r;s=t++)for(const r of e)for(let e=0,a=r.length,l=a-1;e<a;l=e++){if(Wi(n[s],n[t],r[l],r[e]))return 0;o=Math.min(o,Mn(n[s],n[t],r[l],r[e],i))}return o}function On(t,e,i,n,r,s,o){if(null===s||null===o)return;const a=xn(vn(n,s),vn(r,o),i);a<e&&t.push({dist:a,range1:s,range2:o})}function Ln(t,e,i,n,r=1/0){let s=Math.min(n.distance(t[0],i[0][0]),r);if(0===s)return s;const o=new hn([{dist:0,range1:[0,t.length-1],range2:[0,0]}],dn),a=e?fn:pn,l=bn(i);for(;o.length;){const r=o.pop();if(r.dist>=s)continue;const c=r.range1;if(gn(c)<=a){if(!_n(c,t.length))return NaN;if(e){const e=Pn(t,c,i,n);if(0===(s=Math.min(s,e)))return s}else for(let e=c[0];e<=c[1];++e){const r=kn(t[e],i,n);if(0===(s=Math.min(s,r)))return s}}else{const i=yn(c,e);if(null!==i[0]){const e=xn(vn(t,i[0]),l,n);e<s&&o.push({dist:e,range1:i[0],range2:[0,0]})}if(null!==i[1]){const e=xn(vn(t,i[1]),l,n);e<s&&o.push({dist:e,range1:i[1],range2:[0,0]})}}}return s}function zn(t,e,i,n,r,s=1/0){let o=Math.min(s,r.distance(t[0],i[0]));if(0===o)return o;const a=new hn([{dist:0,range1:[0,t.length-1],range2:[0,i.length-1]}],dn),l=e?fn:pn,c=n?fn:pn;for(;a.length;){const s=a.pop();if(s.dist>=o)continue;const h=s.range1,u=s.range2;if(gn(h)<=l&&gn(u)<=c){if(!_n(h,t.length)||!_n(u,i.length))return NaN;if(e&&n?o=Math.min(o,An(t,h,i,u,r)):e||n?e&&!n?o=Math.min(o,Tn(i,u,t,h,r)):!e&&n&&(o=Math.min(o,Tn(t,h,i,u,r))):o=Math.min(o,Cn(t,h,i,u,r)),0===o)return o}else{const s=yn(h,e),l=yn(u,n);On(a,o,r,t,i,s[0],l[0]),On(a,o,r,t,i,s[0],l[1]),On(a,o,r,t,i,s[1],l[0]),On(a,o,r,t,i,s[1],l[1])}}return o}function Rn(t,e,i,n,r=1/0){let s=r;const o=vn(t,[0,t.length-1]);for(const r of i)if(!(s!==1/0&&xn(o,vn(r,[0,r.length-1]),n)>=s)&&(s=Math.min(s,zn(t,e,r,!0,n,s)),0===s))return s;return s}function Fn(t,e,i,n,r=1/0){let s=r;const o=vn(t,[0,t.length-1]);for(const r of i){if(s!==1/0&&xn(o,bn(r),n)>=s)continue;const i=Ln(t,e,r,n,s);if(isNaN(i))return i;if(0===(s=Math.min(s,i)))return s}return s}function Bn(t){return"Point"===t||"MultiPoint"===t||"LineString"===t||"MultiLineString"===t||"Polygon"===t||"MultiPolygon"===t}class Nn{constructor(t,e){this.type=$e,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires either one argument, but found ' ${t.length-1} instead.`);if(_i(t[1])){const e=t[1];if("FeatureCollection"===e.type){for(let t=0;t<e.features.length;++t)if(Bn(e.features[t].geometry.type))return new Nn(e,e.features[t].geometry)}else if("Feature"===e.type){if(Bn(e.geometry.type))return new Nn(e,e.geometry)}else if(Bn(e.type))return new Nn(e,e)}return e.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(t){const e=t.geometry(),i=t.canonicalID();if(null!=e&&null!=i){if("Point"===t.geometryType())return function(t,e,i){const n=[];for(const i of t)for(const t of i)n.push(wn(t,e));const r=new ln(n[0][1],"meters");return"Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type?zn(n,!1,"Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,r):"MultiLineString"===i.type?Rn(n,!1,i.coordinates,r):"Polygon"===i.type||"MultiPolygon"===i.type?Fn(n,!1,"Polygon"===i.type?[i.coordinates]:i.coordinates,r):null}(e,i,this.geometries);if("LineString"===t.geometryType())return function(t,e,i){const n=[];for(const i of t){const t=[];for(const n of i)t.push(wn(n,e));n.push(t)}const r=new ln(n[0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return Rn("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r);if("MultiLineString"===i.type){let t=1/0;for(let e=0;e<i.coordinates.length;e++){const s=Rn(i.coordinates[e],!0,n,r,t);if(isNaN(s))return s;if(0===(t=Math.min(t,s)))return t}return t}if("Polygon"===i.type||"MultiPolygon"===i.type){let t=1/0;for(let e=0;e<n.length;e++){const s=Fn(n[e],!0,"Polygon"===i.type?[i.coordinates]:i.coordinates,r,t);if(isNaN(s))return s;if(0===(t=Math.min(t,s)))return t}return t}return null}(e,i,this.geometries);if("Polygon"===t.geometryType())return function(t,e,i){const n=[];for(const i of function(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,s;for(let e=0;e<i;e++){const i=ji(t[e]);0!==i&&(t[e].area=Math.abs(i),void 0===s&&(s=i<0),s===i<0?(r&&n.push(r),r=[t[e]]):r.push(t[e]))}return r&&n.push(r),n}(t)){const t=[];for(let n=0;n<i.length;++n)t.push(En(i[n],e));n.push(t)}const r=new ln(n[0][0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return Fn("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r);if("MultiLineString"===i.type){let t=1/0;for(let e=0;e<i.coordinates.length;e++){const s=Fn(i.coordinates[e],!0,n,r,t);if(isNaN(s))return s;if(0===(t=Math.min(t,s)))return t}return t}return"Polygon"===i.type||"MultiPolygon"===i.type?function(t,e,i){let n=1/0;for(const r of t)for(const t of e){const e=Dn(r,t,i,n);if(isNaN(e))return e;if(0===(n=Math.min(n,e)))return n}return n}("Polygon"===i.type?[i.coordinates]:i.coordinates,n,r):null}(e,i,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}var jn=Nn;function Vn(t){if(t instanceof Ri){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof on)return!1;if(t instanceof jn)return!1;let e=!0;return t.eachChild((t=>{e&&!Vn(t)&&(e=!1)})),e}function Un(t){if(t instanceof Ri&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Un(t)&&(e=!1)})),e}function $n(t){if(t instanceof Ri&&"config"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!$n(t)&&(e=!1)})),e}function Hn(t,e){if(t instanceof Ri&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Hn(t,e)&&(i=!1)})),i}class qn{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new qn(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Wn=qn;class Gn{constructor(t,e=[],i,n=new Ve,r=[],s){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i,this.options=s}parse(t,e,i,n,r={}){return e||i?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new Ti(e,[t]):"coerce"===i?new Ii(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof t[0]?this.registry[t[0]]:void 0;if(n){let r=n.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof xi)&&"resolvedImage"!==r.type.kind&&Yn(r)){const e=new Oi(this.options);try{r=new xi(r.type,r.evaluate(e))}catch(t){return this.error(t.message),null}}return r}return Ii.parse(["to-array",t],this)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Gn(this.registry,n,e||null,r,this.errors,this.options)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Ne(i,t))}checkSubtype(t,e){const i=ei(t,e);return i&&this.error(i),i}}var Zn=Gn;function Yn(t){if(t instanceof Wn)return Yn(t.boundExpression);if(t instanceof Ri&&"error"===t.name)return!1;if(t instanceof Ri&&"config"===t.name)return!1;if(t instanceof Fi)return!1;if(t instanceof on)return!1;if(t instanceof jn)return!1;const e=t instanceof Ii||t instanceof Ti;let i=!0;return t.eachChild((t=>{i=e?i&&Yn(t):i&&t instanceof xi})),!!i&&Vn(t)&&Hn(t,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light"])}function Xn(t,e){const i=t.length-1;let n,r,s=0,o=i,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;s=a+1}else{if(!(n>e))throw new wi("Input is not a number.");o=a-1}return 0}class Kn{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,$e);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let i=1;i<t.length;i+=2){const s=1===i?-1/0:t[i],o=t[i+1],a=i,l=i+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(o,l,r);if(!c)return null;r=r||c.type,n.push([s,c])}return new Kn(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[Xn(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Qn=Kn;function Jn(t,e,i){return t*(1-i)+e*i}function tr(t,e,i){return t.map(((t,n)=>Jn(t,e[n],i)))}var er=Object.freeze({__proto__:null,array:tr,color:function(t,e,i){return new ui(Jn(t.r,e.r,i),Jn(t.g,e.g,i),Jn(t.b,e.b,i),Jn(t.a,e.a,i))},number:Jn});const ir=.95047,nr=1.08883,rr=4/29,sr=6/29,or=3*sr*sr,ar=sr*sr*sr,lr=Math.PI/180,cr=180/Math.PI;function hr(t){return t>ar?Math.pow(t,1/3):t/or+rr}function ur(t){return t>sr?t*t*t:or*(t-rr)}function dr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function pr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fr(t){const e=pr(t.r),i=pr(t.g),n=pr(t.b),r=hr((.4124564*e+.3575761*i+.1804375*n)/ir),s=hr((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*s-16,a:500*(r-s),b:200*(s-hr((.0193339*e+.119192*i+.9503041*n)/nr)),alpha:t.a}}function mr(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*ur(e),i=ir*ur(i),n=nr*ur(n),new ui(dr(3.2404542*i-1.5371385*e-.4985314*n),dr(-.969266*i+1.8760108*e+.041556*n),dr(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function gr(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const _r={forward:fr,reverse:mr,interpolate:function(t,e,i){return{l:Jn(t.l,e.l,i),a:Jn(t.a,e.a,i),b:Jn(t.b,e.b,i),alpha:Jn(t.alpha,e.alpha,i)}}},yr={forward:function(t){const{l:e,a:i,b:n}=fr(t),r=Math.atan2(n,i)*cr;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*lr,i=t.c;return mr({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:gr(t.h,e.h,i),c:Jn(t.c,e.c,i),l:Jn(t.l,e.l,i),alpha:Jn(t.alpha,e.alpha,i)}}};var vr=Object.freeze({__proto__:null,hcl:yr,lab:_r});class br{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=xr(e,t.base,i,n);else if("linear"===t.name)r=xr(e,1,i,n);else if("cubic-bezier"===t.name){const s=t.controlPoints;r=new g(s[0],s[1],s[2],s[3]).solve(xr(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...s]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,$e),!r)return null;const o=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=We:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<s.length;t+=2){const i=s[t],n=s[t+1],r=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',r);if(o.length&&o[o.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=e.parse(n,l,a);if(!c)return null;a=a||c.type,o.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new br(a,i,n,r,o):e.error(`Type ${Je(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const s=Xn(e,n),o=br.interpolationFactor(this.interpolation,n,e[s],e[s+1]),a=i[s].evaluate(t),l=i[s+1].evaluate(t);return"interpolate"===this.operator?er[this.type.kind.toLowerCase()](a,l,o):"interpolate-hcl"===this.operator?yr.reverse(yr.interpolate(yr.forward(a),yr.forward(l),o)):_r.reverse(_r.interpolate(_r.forward(a),_r.forward(l),o))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function xr(t,e,i,n){const r=n-i,s=t-i;return 0===r?0:1===e?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}var wr=br;class Er{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of t.slice(1)){const t=e.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const s=n&&r.some((t=>ei(n,t.type)));return new Er(s?Ze:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(t),i&&i instanceof mi&&!i.available&&(e||(e=i),i=null,n===this.args.length))return e;if(null!==i)break}return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Sr=Er;class Tr{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let n=1;n<t.length-1;n+=2){const r=t[n];if("string"!=typeof r)return e.error(`Expected string, but found ${typeof r} instead.`,n);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const s=e.parse(t[n+1],n+1);if(!s)return null;i.push([r,s])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new Tr(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}var Mr=Tr;class Ar{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,$e),n=e.parse(t[2],2,Qe(e.expectedType||Ze));return i&&n?new Ar(n.type.itemType,i,n):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new wi(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new wi(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new wi(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Cr=Ar;class kr{constructor(t,e){this.type=qe,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ze),n=e.parse(t[2],2,Ze);return i&&n?ii(i.type,[qe,He,$e,Ue,Ze])?new kr(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Je(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!ni(e,["boolean","string","number","null"]))throw new wi(`Expected first argument to be of type boolean, string, number or null, but found ${Je(yi(e))} instead.`);if(!ni(i,["string","array"]))throw new wi(`Expected second argument to be of type array or string, but found ${Je(yi(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Pr=kr;class Ir{constructor(t,e,i){this.type=$e,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ze),n=e.parse(t[2],2,Ze);if(!i||!n)return null;if(!ii(i.type,[qe,He,$e,Ue,Ze]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Je(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,$e);return r?new Ir(i,n,r):null}return new Ir(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!ni(e,["boolean","string","number","null"]))throw new wi(`Expected first argument to be of type boolean, string, number or null, but found ${Je(yi(e))} instead.`);if(!ni(i,["string","array"]))throw new wi(`Expected second argument to be of type array or string, but found ${Je(yi(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Dr=Ir;class Or{constructor(t,e,i,n,r,s){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},s=[];for(let o=2;o<t.length-1;o+=2){let a=t[o];const l=t[o+1];Array.isArray(a)||(a=[a]);const c=e.concat(o);if(0===a.length)return c.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,yi(t)))return null}else i=yi(t);if(void 0!==r[String(t)])return c.error("Branch labels must be unique.");r[String(t)]=s.length}const h=e.parse(l,o,n);if(!h)return null;n=n||h.type,s.push(h)}const o=e.parse(t[1],1,Ze);if(!o)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==o.type.kind&&e.concat(1).checkSubtype(i,o.type)?null:new Or(i,n,o,r,s,a):null}evaluate(t){const e=this.input.evaluate(t);return(yi(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of i)t.push(1===n.length?r(n[0]):n.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var Lr=Or;class zr{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let r=1;r<t.length-1;r+=2){const s=e.parse(t[r],r,qe);if(!s)return null;const o=e.parse(t[r+1],r+1,i);if(!o)return null;n.push([s,o]),i=i||o.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new zr(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Rr=zr;class Fr{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ze),n=e.parse(t[2],2,$e);if(!i||!n)return null;if(!ii(i.type,[Qe(Ze),He,Ze]))return e.error(`Expected first argument to be of type array or string, but found ${Je(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,$e);return r?new Fr(i.type,i,n,r):null}return new Fr(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!ni(e,["string","array"]))throw new wi(`Expected first argument to be of type array or string, but found ${Je(yi(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Br=Fr;function Nr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function jr(t,e,i,n){return 0===n.compare(e,i)}function Vr(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=qe,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let s=e.parse(t[1],1,Ze);if(!s)return null;if(!Nr(i,s.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Je(s.type)}'.`);let o=e.parse(t[2],2,Ze);if(!o)return null;if(!Nr(i,o.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Je(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${Je(s.type)}' and '${Je(o.type)}'.`);n&&("value"===s.type.kind&&"value"!==o.type.kind?s=new Ti(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new Ti(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Ye),!a)return null}return new r(s,o,a)}evaluate(r){const s=this.lhs.evaluate(r),o=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=yi(s),i=yi(o);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new wi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=yi(s),i=yi(o);if("string"!==t.kind||"string"!==i.kind)return e(r,s,o)}return this.collator?i(r,s,o,this.collator.evaluate(r)):e(r,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Ur=Vr("==",(function(t,e,i){return e===i}),jr),$r=Vr("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!jr(0,e,i,n)})),Hr=Vr("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),qr=Vr(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),Wr=Vr("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),Gr=Vr(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class Zr{constructor(t,e,i,n,r,s){this.type=He,this.number=t,this.locale=e,this.currency=i,this.unit=n,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,$e);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,He),!r))return null;let s=null;if(n.currency&&(s=e.parse(n.currency,1,He),!s))return null;let o=null;if(n.unit&&(o=e.parse(n.unit,1,He),!o))return null;let a=null;if(n["min-fraction-digits"]&&(a=e.parse(n["min-fraction-digits"],1,$e),!a))return null;let l=null;return n["max-fraction-digits"]&&(l=e.parse(n["max-fraction-digits"],1,$e),!l)?null:new Zr(i,r,s,o,a,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class Yr{constructor(t){this.type=$e,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${Je(i.type)} instead.`):new Yr(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new wi(`Expected value to be of type string or array, but found ${Je(yi(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}function Xr(t){return function(){t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}const Kr={"==":Ur,"!=":$r,">":qr,"<":Hr,">=":Gr,"<=":Wr,array:Ti,at:Cr,boolean:Ti,case:Rr,coalesce:Sr,collator:Fi,format:Mi,image:Ai,in:Pr,"index-of":Dr,interpolate:wr,"interpolate-hcl":wr,"interpolate-lab":wr,length:Yr,let:Mr,literal:xi,match:Lr,number:Ti,"number-format":Zr,object:Ti,slice:Br,step:Qn,string:Ti,"to-boolean":Ii,"to-color":Ii,"to-number":Ii,"to-string":Ii,var:Wn,within:on,distance:jn};function Qr(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const s=r?r.evaluate(t):1,o=gi(e,i,n,s);if(o)throw new wi(o);return new ui(e/255*s,i/255*s,n/255*s,s)}function Jr(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const s=r?r.evaluate(t):1,o=function(t,e,i,n){return"number"==typeof t&&t>=0&&t<=360?"number"==typeof e&&e>=0&&e<=100&&"number"==typeof i&&i>=0&&i<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'h' must be between 0 and 360.`}(e,i,n,s);if(o)throw new wi(o);const a=`hsla(${e}, ${i}%, ${n}%, ${s})`,l=ui.parse(a);if(!l)throw new wi(`Failed to parse HSLA color: ${a}`);return l}function ts(t,e){return t in e}function es(t,e){const i=e[t];return void 0===i?null:i}function is(t,e){switch(t){case"string":return String(e);case"number":return+e;case"boolean":return!!e;case"color":return ui.parse(e)}return e}function ns(t,e,i,n){return void 0!==n&&(t=n*Math.round(t/n)),void 0!==e&&t<e&&(t=e),void 0!==i&&t>i&&(t=i),t}function rs(t,e,i){i.length&&(e+=`${i}`);const n=t.getConfig(e);if(!n)return null;const{type:r,value:s,values:o,minValue:a,maxValue:l,stepValue:c}=n,h=n.default.evaluate(t);let u=s?s.evaluate(t):h;return r&&(u=is(r,u)),void 0!==s&&void 0!==u&&o&&!o.includes(u)&&(u=h,r&&(u=is(r,u))),void 0===u||void 0===a&&void 0===l&&void 0===c||("number"==typeof u?u=ns(u,a,l,c):Array.isArray(u)&&(u=u.map((t=>"number"==typeof t?ns(t,a,l,c):t)))),u}function ss(t){return{type:t}}Ri.register(Kr,{error:[{kind:"error"},[He],(t,[e])=>{throw new wi(e.evaluate(t))}],typeof:[He,[Ze],(t,[e])=>Je(yi(e.evaluate(t)))],"to-rgba":[Qe($e,4),[We],(t,[e])=>e.evaluate(t).toArray()],rgb:[We,[$e,$e,$e],Qr],rgba:[We,[$e,$e,$e,$e],Qr],hsl:[We,[$e,$e,$e],Jr],hsla:[We,[$e,$e,$e,$e],Jr],has:{type:qe,overloads:[[[He],(t,[e])=>ts(e.evaluate(t),t.properties())],[[He,Ge],(t,[e,i])=>ts(e.evaluate(t),i.evaluate(t))]]},get:{type:Ze,overloads:[[[He],(t,[e])=>es(e.evaluate(t),t.properties())],[[He,Ge],(t,[e,i])=>es(e.evaluate(t),i.evaluate(t))]]},config:{type:Ze,overloads:[[[He],(t,[e])=>rs(t,e.evaluate(t),"")],[[He,He],(t,[e,i])=>rs(t,e.evaluate(t),i.evaluate(t))]]},"feature-state":[Ze,[He],(t,[e])=>es(e.evaluate(t),t.featureState||{})],properties:[Ge,[],t=>t.properties()],"geometry-type":[He,[],t=>t.geometryType()],id:[Ze,[],t=>t.id()],zoom:[$e,[],t=>t.globals.zoom],pitch:[$e,[],t=>t.globals.pitch||0],"distance-from-center":[$e,[],t=>t.distanceFromCenter()],"measure-light":[$e,[He],(t,[e])=>t.measureLight(e.evaluate(t))],"heatmap-density":[$e,[],t=>t.globals.heatmapDensity||0],"line-progress":[$e,[],t=>t.globals.lineProgress||0],"raster-value":[$e,[],t=>t.globals.rasterValue||0],"sky-radial-progress":[$e,[],t=>t.globals.skyRadialProgress||0],accumulated:[Ze,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[$e,ss($e),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[$e,ss($e),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:$e,overloads:[[[$e,$e],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[$e],(t,[e])=>-e.evaluate(t)]]},"/":[$e,[$e,$e],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[$e,[$e,$e],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[$e,[],()=>Math.LN2],pi:[$e,[],()=>Math.PI],e:[$e,[],()=>Math.E],"^":[$e,[$e,$e],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[$e,[$e],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[$e,[$e],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[$e,[$e],(t,[e])=>Math.log(e.evaluate(t))],log2:[$e,[$e],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[$e,[$e],(t,[e])=>Math.sin(e.evaluate(t))],cos:[$e,[$e],(t,[e])=>Math.cos(e.evaluate(t))],tan:[$e,[$e],(t,[e])=>Math.tan(e.evaluate(t))],asin:[$e,[$e],(t,[e])=>Math.asin(e.evaluate(t))],acos:[$e,[$e],(t,[e])=>Math.acos(e.evaluate(t))],atan:[$e,[$e],(t,[e])=>Math.atan(e.evaluate(t))],min:[$e,ss($e),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[$e,ss($e),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[$e,[$e],(t,[e])=>Math.abs(e.evaluate(t))],round:[$e,[$e],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[$e,[$e],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[$e,[$e],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[qe,[He,Ze],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[qe,[Ze],(t,[e])=>t.id()===e.value],"filter-type-==":[qe,[He],(t,[e])=>t.geometryType()===e.value],"filter-<":[qe,[He,Ze],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[qe,[Ze],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[qe,[He,Ze],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[qe,[Ze],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[qe,[He,Ze],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[qe,[Ze],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[qe,[He,Ze],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[qe,[Ze],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[qe,[Ze],(t,[e])=>e.value in t.properties()],"filter-has-id":[qe,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[qe,[Qe(He)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[qe,[Qe(Ze)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[qe,[He,Qe(Ze)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[qe,[He,Qe(Ze)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:qe,overloads:[[[qe,qe],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[ss(qe),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:qe,overloads:[[[qe,qe],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[ss(qe),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[qe,[qe],(t,[e])=>!e.evaluate(t)],"is-supported-script":[qe,[He],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[He,[He],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[He,[He],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[He,ss(Ze),(t,e)=>e.map((e=>vi(e.evaluate(t)))).join("")],"resolved-locale":[He,[Ye],(t,[e])=>e.evaluate(t).resolvedLocale()],random:[$e,[$e,$e,Ze],(t,e)=>{const[i,n,r]=e.map((e=>e.evaluate(t)));if(i>n)return i;if(i===n)return i;let s;if("string"==typeof r)s=function(t){let e=0;if(0===t.length)return e;for(let i=0;i<t.length;i++)e=(e<<5)-e+t.charCodeAt(i),e&=e;return e}(r);else{if("number"!=typeof r)throw new wi(`Invalid seed input: ${r}`);s=r}return i+Xr(s)()*(n-i)}]});var os=Kr;function as(t){return{result:"success",value:t}}function ls(t){return{result:"error",value:t}}function cs(t,e){return!!t&&!!t.parameters&&t.parameters.indexOf(e)>-1}function hs(t){return"data-driven"===t["property-type"]}function us(t){return cs(t.expression,"measure-light")}function ds(t){return cs(t.expression,"zoom")}function ps(t){return!!t.expression&&t.expression.interpolated}function fs(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ms(t){return t}function gs(t,e){const i="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],r=n||!(n||void 0!==t.property),s=t.type||(ps(e)?"exponential":"interval");if(i&&((t=ze({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],ui.parse(t[1])]))),t.default=ui.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!vr[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let o,a,l;if("exponential"===s)o=bs;else if("interval"===s)o=vs;else if("categorical"===s){o=ys,a=Object.create(null);for(const e of t.stops)a[e[0]]=e[1];l=typeof t.stops[0][0]}else{if("identity"!==s)throw new Error(`Unknown function type "${s}"`);o=xs}if(n){const i={},n=[];for(let e=0;e<t.stops.length;e++){const r=t.stops[e],s=r[0].zoom;void 0===i[s]&&(i[s]={zoom:s,type:t.type,property:t.property,default:t.default,stops:[]},n.push(s)),i[s].stops.push([r[0].value,r[1]])}const r=[];for(const t of n)r.push([i[t].zoom,gs(i[t],e)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:wr.interpolationFactor.bind(void 0,s),zoomStops:r.map((t=>t[0])),evaluate:({zoom:i},n)=>bs({stops:r,base:t.base},e,i).evaluate(i,n)}}if(r){const i="exponential"===s?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:wr.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:i})=>o(t,e,i,a,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[t.property]:void 0;return void 0===r?_s(t.default,e.default):o(t,e,r,a,l)}}}function _s(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function ys(t,e,i,n,r){return _s(typeof i===r?n[i]:void 0,t.default,e.default)}function vs(t,e,i){if("number"!==Ci(i))return _s(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const r=Xn(t.stops.map((t=>t[0])),i);return t.stops[r][1]}function bs(t,e,i){const n=void 0!==t.base?t.base:1;if("number"!==Ci(i))return _s(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const s=Xn(t.stops.map((t=>t[0])),i),o=function(t,e,i,n){const r=n-i,s=t-i;return 0===r?0:1===e?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],l=t.stops[s+1][1];let c=er[e.type]||ms;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=vr[t.colorSpace];c=(t,i)=>e.reverse(e.interpolate(e.forward(t),e.forward(i),o))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==i)return c(e,i,o)}}:c(a,l,o)}function xs(t,e,i){return"color"===e.type?i=ui.parse(i):"formatted"===e.type?i=fi.fromString(i.toString()):"resolvedImage"===e.type?i=mi.fromString(i.toString()):Ci(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),_s(i,t.default,e.default)}class ws{constructor(t,e,i){this.expression=t,this._warningHistory={},this._evaluator=new Oi(i),this._defaultValue=e?function(t){return"color"===t.type&&(fs(t.default)||Array.isArray(t.default))?new ui(0,0,0,0):"color"===t.type?ui.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,s,o,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,s,o,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new wi(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function Es(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in os}function Ss(t,e,i){const n=new Zn(os,[],e?function(t){const e={color:We,string:He,number:$e,enum:He,boolean:qe,formatted:Xe,resolvedImage:Ke};return"array"===t.type?Qe(e[t.value]||Ze,t.length):e[t.type]}(e):void 0,void 0,void 0,i),r=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?as(new ws(r,e,i)):ls(n.errors)}class Ts{constructor(t,e,i){this.kind=t,this._styleExpression=e,this.isLightConstant=i,this.isStateDependent="constant"!==t&&!Un(e.expression),this.isConfigDependent=!$n(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,s)}evaluate(t,e,i,n,r,s){return this._styleExpression.evaluate(t,e,i,n,r,s)}}class Ms{constructor(t,e,i,n,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Un(e.expression),this.isLightConstant=r,this.isConfigDependent=!$n(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,s)}evaluate(t,e,i,n,r,s){return this._styleExpression.evaluate(t,e,i,n,r,s)}interpolationFactor(t,e,i){return this.interpolationType?wr.interpolationFactor(this.interpolationType,t,e,i):0}}function As(t,e,i){if("error"===(t=Ss(t,e,i)).result)return t;const n=t.value.expression,r=Vn(n);if(!r&&!hs(e))return ls([new Ne("","data expressions not supported")]);const s=Hn(n,["zoom","pitch","distance-from-center"]);if(!s&&!ds(e))return ls([new Ne("","zoom expressions not supported")]);const o=Hn(n,["measure-light"]);if(!o&&!us(e))return ls([new Ne("","measure-light expression not supported")]);const a=e.expression&&e.expression.relaxZoomRestriction,l=ks(n);return l||s||a?l instanceof Ne?ls([l]):l instanceof wr&&!ps(e)?ls([new Ne("",'"interpolate" expressions cannot be used with this property')]):as(l?new Ms(r?"camera":"composite",t.value,l.labels,l instanceof wr?l.interpolation:void 0,o):new Ts(r?"constant":"source",t.value,o)):ls([new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Cs{constructor(t,e){this._parameters=t,this._specification=e,ze(this,gs(this._parameters,this._specification))}static deserialize(t){return new Cs(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function ks(t){let e=null;if(t instanceof Mr)e=ks(t.result);else if(t instanceof Sr){for(const i of t.args)if(e=ks(i),e)break}else(t instanceof Qn||t instanceof wr)&&t.input instanceof Ri&&"zoom"===t.input.name&&(e=t);return e instanceof Ne||t.eachChild((t=>{const i=ks(t);i instanceof Ne?e=i:e&&i&&e!==i&&(e=new Ne("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Ps(t){const e=t.key,i=t.value,n=t.valueSpec||{},r=t.objectElementValidators||{},s=t.style,o=t.styleSpec;let a=[];const l=Ci(i);if("object"!==l)return[new Oe(e,i,`object expected, ${l} found`)];for(const t in i){const l=t.split(".")[0];let c;r[l]?c=r[l]:n[l]?c=po:r["*"]?c=r["*"]:n["*"]&&(c=po),c?a=a.concat(c({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:n[l]||n["*"],style:s,styleSpec:o,object:i,objectKey:t},i)):a.push(new Le(e,i[t],`unknown property "${t}"`))}for(const t in n)r[t]||n[t].required&&void 0===n[t].default&&void 0===i[t]&&a.push(new Oe(e,i,`missing required property "${t}"`));return a}function Is(t){const e=t.value,i=t.valueSpec,n=t.style,r=t.styleSpec,s=t.key,o=t.arrayElementValidator||po;if("array"!==Ci(e))return[new Oe(s,e,`array expected, ${Ci(e)} found`)];if(i.length&&e.length!==i.length)return[new Oe(s,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new Oe(s,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let a={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum,function:void 0};r.$version<7&&(a.function=i.function),"object"===Ci(i.value)&&(a=i.value);let l=[];for(let t=0;t<e.length;t++)l=l.concat(o({array:e,arrayIndex:t,value:e[t],valueSpec:a,style:n,styleSpec:r,key:`${s}[${t}]`},!0));return l}function Ds(t){const e=t.key,i=t.value,n=t.valueSpec;let r=Ci(i);if("number"===r&&i!=i&&(r="NaN"),"number"!==r)return[new Oe(e,i,`number expected, ${r} found`)];if("minimum"in n){let r=n.minimum;if("array"===Ci(n.minimum)&&(r=n.minimum[t.arrayIndex]),i<r)return[new Oe(e,i,`${i} is less than the minimum value ${r}`)]}if("maximum"in n){let r=n.maximum;if("array"===Ci(n.maximum)&&(r=n.maximum[t.arrayIndex]),i>r)return[new Oe(e,i,`${i} is greater than the maximum value ${r}`)]}return[]}function Os(t){const e=t.valueSpec,i=Re(t.value.type);let n,r,s,o={};const a="categorical"!==i&&void 0===t.value.property,l=!a,c="array"===Ci(t.value.stops)&&"array"===Ci(t.value.stops[0])&&"object"===Ci(t.value.stops[0][0]),h=Ps({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new Oe(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(Is({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===Ci(n)&&0===n.length&&e.push(new Oe(t.key,n,"array must have at least one stop")),e},default:function(t){return po({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&a&&h.push(new Oe(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||h.push(new Oe(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!ps(t.valueSpec)&&h.push(new Oe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!hs(t.valueSpec)?h.push(new Oe(t.key,t.value,"property functions not supported")):a&&!ds(t.valueSpec)&&h.push(new Oe(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||h.push(new Oe(t.key,t.value,'"property" property is required')),h;function u(t){let i=[];const n=t.value,a=t.key;if("array"!==Ci(n))return[new Oe(a,n,`array expected, ${Ci(n)} found`)];if(2!==n.length)return[new Oe(a,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==Ci(n[0]))return[new Oe(a,n,`object expected, ${Ci(n[0])} found`)];if(void 0===n[0].zoom)return[new Oe(a,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new Oe(a,n,"object stop key must have value")];const e=Re(n[0].zoom);if("number"!=typeof e)return[new Oe(a,n[0].zoom,"stop zoom values must be numbers")];if(s&&s>e)return[new Oe(a,n[0].zoom,"stop zoom values must appear in ascending order")];e!==s&&(s=e,r=void 0,o={}),i=i.concat(Ps({key:`${a}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ds,value:d}}))}else i=i.concat(d({key:`${a}[0]`,value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return Es(Fe(n[1]))?i.concat([new Oe(`${a}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(po({key:`${a}[1]`,value:n[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function d(t,s){const a=Ci(t.value),l=Re(t.value),c=null!==t.value?t.value:s;if(n){if(a!==n)return[new Oe(t.key,c,`${a} stop domain type must match previous stop domain type ${n}`)]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new Oe(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==i){let n=`number expected, ${a} found`;return hs(e)&&void 0===i&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Oe(t.key,c,n)]}return"categorical"!==i||"number"!==a||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===a&&"number"==typeof l&&"number"==typeof r&&void 0!==r&&l<r?[new Oe(t.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===i&&l in o?[new Oe(t.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new Oe(t.key,c,`integer expected, found ${String(l)}`)]}}function Ls(t){const e=("property"===t.expressionContext?As:Ss)(Fe(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new Oe(`${t.key}${e.key}`,t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new Oe(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Un(i))return[new Oe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return zs(i,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Hn(i,["zoom","feature-state"]))return[new Oe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Vn(i))return[new Oe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function zs(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const t of e.valueSpec.expression.parameters)i.delete(t);if(0===i.size)return[];const n=[];return t instanceof Ri&&i.has(t.name)?[new Oe(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild((t=>{n.push(...zs(t,e))})),n)}function Rs(t){const e=t.key,i=t.value,n=t.valueSpec,r=[];return Array.isArray(n.values)?-1===n.values.indexOf(Re(i))&&r.push(new Oe(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(n.values).indexOf(Re(i))&&r.push(new Oe(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),r}function Fs(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Fs(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Bs(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Fs(t)||(t=qs(t));const i=t;let n=!0;try{n=function(t){if(!Vs(t))return t;let e=Fe(t);return js(e),e=Ns(e),e}(i)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const r=De[`filter_${e}`],s=Ss(n,r);let o=null;if("error"===s.result)throw new Error(s.value.map((t=>`${t.key}: ${t.message}`)).join(", "));o=(t,e,i)=>s.value.evaluate(t,e,{},i);let a=null,l=null;if(n!==i){const t=Ss(i,r);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(e,i,n,r,s)=>t.value.evaluate(e,i,{},n,void 0,void 0,r,s),l=!Vn(t.value.expression)}return{filter:o,dynamicFilter:a||void 0,needGeometry:Hs(n),needFeature:!!l}}function Ns(t){if(!Array.isArray(t))return t;const e=function(t){if(Us.has(t[0]))for(let e=1;e<t.length;e++)if(Vs(t[e]))return!0;return t}(t);return!0===e?e:e.map((t=>Ns(t)))}function js(t){let e=!1;const i=[];if("case"===t[0]){for(let n=1;n<t.length-1;n+=2)e=e||Vs(t[n]),i.push(t[n+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||Vs(t[1]);for(let e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||Vs(t[1]);for(let e=1;e<t.length-1;e+=2)i.push(t[e+1])}e&&(t.length=0,t.push("any",...i));for(let e=1;e<t.length;e++)js(t[e])}function Vs(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let e=1;e<t.length;e++)if(Vs(t[e]))return!0;return!1}const Us=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function $s(t,e){return t<e?-1:t>e?1:0}function Hs(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(Hs(t[e]))return!0;return!1}function qs(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Ws(t[1],t[2],"=="):"!="===e?Ys(Ws(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Ws(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(qs))):"all"===e?["all"].concat(t.slice(1).map(qs)):"none"===e?["all"].concat(t.slice(1).map(qs).map(Ys)):"in"===e?Gs(t[1],t.slice(2)):"!in"===e?Ys(Gs(t[1],t.slice(2))):"has"===e?Zs(t[1]):"!has"!==e||Ys(Zs(t[1]));var i}function Ws(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Gs(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort($s)]]:["filter-in-small",t,["literal",e]]}}function Zs(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ys(t){return["!",t]}function Xs(t){return Fs(Fe(t.value))?Ls(ze({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Ks(t)}function Ks(t){const e=t.value,i=t.key;if("array"!==Ci(e))return[new Oe(i,e,`array expected, ${Ci(e)} found`)];const n=t.styleSpec;let r,s=[];if(e.length<1)return[new Oe(i,e,"filter array must have at least 1 element")];switch(s=s.concat(Rs({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Re(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Re(e[1])&&s.push(new Oe(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&s.push(new Oe(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(r=Ci(e[1]),"string"!==r&&s.push(new Oe(`${i}[1]`,e[1],`string expected, ${r} found`)));for(let o=2;o<e.length;o++)r=Ci(e[o]),"$type"===Re(e[1])?s=s.concat(Rs({key:`${i}[${o}]`,value:e[o],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&s.push(new Oe(`${i}[${o}]`,e[o],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let n=1;n<e.length;n++)s=s.concat(Ks({key:`${i}[${n}]`,value:e[n],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":r=Ci(e[1]),2!==e.length?s.push(new Oe(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==r&&s.push(new Oe(`${i}[1]`,e[1],`string expected, ${r} found`))}return s}function Qs(t,e){const i=t.key,n=t.style,r=t.layer,s=t.styleSpec,o=t.value,a=t.objectKey,l=s[`${e}_${t.layerType}`];if(!l)return[];const c=a.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return po({key:i,value:o,valueSpec:s.transition,style:n,styleSpec:s});const h=t.valueSpec||l[a];if(!h)return[new Le(i,o,`unknown property "${a}"`)];let u;if("string"===Ci(o)&&hs(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(o))){const t=`\`{ "type": "identity", "property": ${u?JSON.stringify(u[1]):'"_"'} }\``;return[new Oe(i,o,`"${a}" does not support interpolation syntax\nUse an identity property function instead: ${t}.`)]}const d=[];if("symbol"===t.layerType)"text-field"!==a||!n||n.glyphs||n.imports||d.push(new Oe(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&fs(Fe(o))&&"identity"===Re(o.type)&&d.push(new Oe(i,o,'"text-font" does not support identity functions'));else if("model"===t.layerType&&"paint"===e&&r&&r.layout&&r.layout.hasOwnProperty("model-id")&&hs(h)&&(us(h)||ds(h))){const t=As(Fe(o),h),e=t.value.expression||t.value._styleExpression.expression;e&&!Hn(e,["measure-light"])&&("model-emissive-strength"===a&&Vn(e)&&Un(e)||d.push(new Oe(i,o,`${a} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return d.concat(po({key:t.key,value:o,valueSpec:h,style:n,styleSpec:s,expressionContext:"property",propertyType:e,propertyKey:a}))}function Js(t){return Qs(t,"paint")}function to(t){return Qs(t,"layout")}function eo(t){let e=[];const i=t.value,n=t.key,r=t.style,s=t.styleSpec;i.type||i.ref||e.push(new Oe(n,i,'either "type" or "ref" is required'));let o=Re(i.type);const a=Re(i.ref);if(i.id){const s=Re(i.id);for(let o=0;o<t.arrayIndex;o++){const t=r.layers[o];Re(t.id)===s&&e.push(new Oe(n,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in i&&e.push(new Oe(n,i[t],`"${t}" is prohibited for ref layers`))})),r.layers.forEach((e=>{Re(e.id)===a&&(t=e)})),t?t.ref?e.push(new Oe(n,i.ref,"ref cannot reference another ref layer")):o=Re(t.type):"string"==typeof a&&e.push(new Oe(n,i.ref,`ref layer "${a}" not found`))}else if("background"!==o&&"sky"!==o&&"slot"!==o)if(i.source){const t=r.sources&&r.sources[i.source],s=t&&Re(t.type);t?"vector"===s&&"raster"===o?e.push(new Oe(n,i.source,`layer "${i.id}" requires a raster source`)):"raster"===s&&"raster"!==o?e.push(new Oe(n,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==s||i["source-layer"]?"raster-dem"===s&&"hillshade"!==o?e.push(new Oe(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||"geojson"===s&&t.lineMetrics||e.push(new Oe(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Oe(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Oe(n,i.source,`source "${i.source}" not found`))}else e.push(new Oe(n,i,'missing required property "source"'));return e=e.concat(Ps({key:n,value:i,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>po({key:`${n}.type`,value:i.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:t=>Xs(ze({layerType:o},t)),layout:t=>Ps({layer:i,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>to(ze({layerType:o},t))}}),paint:t=>Ps({layer:i,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>Js(ze({layerType:o,layer:i},t))}})}})),e}function io(t){const e=t.value,i=t.key,n=Ci(e);return"string"!==n?[new Oe(i,e,`string expected, ${n} found`)]:[]}const no={promoteId:function({key:t,value:e}){if("string"===Ci(e))return io({key:t,value:e});{const i=[];for(const n in e)i.push(...io({key:`${t}.${n}`,value:e[n]}));return i}}};function ro(t){const e=t.value,i=t.key,n=t.styleSpec,r=t.style;if(!e.type)return[new Oe(i,e,'"type" is required')];const s=Re(e.type);let o=[];switch(["vector","raster","raster-dem"].includes(s)&&(e.url||e.tiles||o.push(new Oe(i,e,'Either "url" or "tiles" is required.'))),s){case"vector":case"raster":case"raster-dem":return o=o.concat(Ps({key:i,value:e,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:no})),o;case"geojson":if(o=Ps({key:i,value:e,valueSpec:n.source_geojson,style:r,styleSpec:n,objectElementValidators:no}),e.cluster)for(const t in e.clusterProperties){const[n,r]=e.clusterProperties[t],s="string"==typeof n?[n,["accumulated"],["get",t]]:n;o.push(...Ls({key:`${i}.${t}.map`,value:r,expressionContext:"cluster-map"})),o.push(...Ls({key:`${i}.${t}.reduce`,value:s,expressionContext:"cluster-reduce"}))}return o;case"video":return Ps({key:i,value:e,valueSpec:n.source_video,style:r,styleSpec:n});case"image":return Ps({key:i,value:e,valueSpec:n.source_image,style:r,styleSpec:n});case"canvas":return[new Oe(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Rs({key:`${i}.type`,value:e.type,valueSpec:{values:so(n)},style:r,styleSpec:n})}}function so(t){return t.source.reduce(((e,i)=>{const n=t[i];return"enum"===n.type.type&&(e=e.concat(Object.keys(n.type.values))),e}),[])}function oo(t){const e=t.value;let i=[];if(!e)return i;const n=Ci(e);return"string"!==n?(i=i.concat([new Oe(t.key,e,`string expected, "${n}" found`)]),i):(function(t){const e=-1===t.indexOf("://");try{return new URL(t,e?"http://example.com":void 0),!0}catch(t){return!1}}(e)||(i=i.concat([new Oe(t.key,e,`invalid url "${e}"`)])),i)}function ao(t){const e=t.value,i=t.styleSpec,n=i.light,r=t.style;let s=[];const o=Ci(e);if(void 0===e)return s;if("object"!==o)return s=s.concat([new Oe("light",e,`object expected, ${o} found`)]),s;for(const t in e){const o=t.match(/^(.*)-transition$/);s=s.concat(o&&n[o[1]]&&n[o[1]].transition?po({key:t,value:e[t],valueSpec:i.transition,style:r,styleSpec:i}):n[t]?po({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}):[new Oe(t,e[t],`unknown property "${t}"`)])}return s}function lo(t){const e=t.value;let i=[];if(!e)return i;const n=Ci(e);if("object"!==n)return i=i.concat([new Oe("light-3d",e,`object expected, ${n} found`)]),i;const r=t.styleSpec,s=r["light-3d"],o=t.key,a=t.style,l=t.style.lights;for(const t of["type","id"])if(!(t in e))return i=i.concat([new Oe("light-3d",e,`missing property ${t} on light`)]),i;if(e.type&&l)for(let n=0;n<t.arrayIndex;n++){const t=Re(e.type),r=l[n];Re(r.type)===t&&i.push(new Oe(o,e.id,`duplicate light type "${e.type}", previously defined at line ${r.id.__line__}`))}const c=`properties_light_${e.type}`;if(!(c in r))return i=i.concat([new Oe("light-3d",e,`Invalid light type ${e.type}`)]),i;const h=r[c];for(const n in e)if("properties"===n){const s=e[n],o=Ci(s);if("object"!==o)return i=i.concat([new Oe("properties",s,`object expected, ${o} found`)]),i;for(const e in s)i=i.concat(h[e]?po({key:e,value:s[e],valueSpec:h[e],style:a,styleSpec:r}):[new Le(t.key,s[e],`unknown property "${e}"`)])}else{const t=n.match(/^(.*)-transition$/);i=i.concat(t&&s[t[1]]&&s[t[1]].transition?po({key:n,value:e[n],valueSpec:r.transition,style:a,styleSpec:r}):s[n]?po({key:n,value:e[n],valueSpec:s[n],style:a,styleSpec:r}):[new Le(n,e[n],`unknown property "${n}"`)])}return i}function co(t){const e=t.value,i=t.key,n=t.style,r=t.styleSpec,s=r.terrain;let o=[];const a=Ci(e);if(void 0===e)return o;if("null"===a)return o;if("object"!==a)return o=o.concat([new Oe("terrain",e,`object expected, ${a} found`)]),o;for(const t in e){const i=t.match(/^(.*)-transition$/);o=o.concat(i&&s[i[1]]&&s[i[1]].transition?po({key:t,value:e[t],valueSpec:r.transition,style:n,styleSpec:r}):s[t]?po({key:t,value:e[t],valueSpec:s[t],style:n,styleSpec:r}):[new Le(t,e[t],`unknown property "${t}"`)])}if(e.source){const t=n.sources&&n.sources[e.source],r=t&&Re(t.type);t?"raster-dem"!==r&&o.push(new Oe(i,e.source,`terrain cannot be used with a source of type ${String(r)}, it only be used with a "raster-dem" source type`)):o.push(new Oe(i,e.source,`source "${e.source}" not found`))}else o.push(new Oe(i,e,'terrain is missing required property "source"'));return o}function ho(t){const e=t.value,i=t.style,n=t.styleSpec,r=n.fog;let s=[];const o=Ci(e);if(void 0===e)return s;if("object"!==o)return s=s.concat([new Oe("fog",e,`object expected, ${o} found`)]),s;for(const t in e){const o=t.match(/^(.*)-transition$/);s=s.concat(o&&r[o[1]]&&r[o[1]].transition?po({key:t,value:e[t],valueSpec:n.transition,style:i,styleSpec:n}):r[t]?po({key:t,value:e[t],valueSpec:r[t],style:i,styleSpec:n}):[new Le(t,e[t],`unknown property "${t}"`)])}return s}const uo={"*":()=>[],array:Is,boolean:function(t){const e=t.value,i=t.key,n=Ci(e);return"boolean"!==n?[new Oe(i,e,`boolean expected, ${n} found`)]:[]},number:Ds,color:function(t){const e=t.key,i=t.value,n=Ci(i);return"string"!==n?[new Oe(e,i,`color expected, ${n} found`)]:null===ri(i)?[new Oe(e,i,`color expected, "${i}" found`)]:[]},enum:Rs,filter:Xs,function:Os,layer:eo,object:Ps,source:ro,model:oo,light:ao,"light-3d":lo,terrain:co,fog:ho,string:io,formatted:function(t){return 0===io(t).length?[]:Ls(t)},resolvedImage:function(t){return 0===io(t).length?[]:Ls(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,r=t.style;let s=[];const o=Ci(e);if("object"===o)for(const t in e)s=s.concat(po({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}));else"string"!==o&&(s=s.concat([new Oe("projection",e,`object or string expected, ${o} found`)]));return s},import:function(t){const{value:e,styleSpec:i}=t,{data:n,...r}=e;Object.defineProperty(r,"__line__",{value:e.__line__,enumerable:!1});let s=Ps(ze({},t,{value:r,valueSpec:i.import}));return""===Re(r.id)&&s.push(new Oe(`${t.key}.id`,r,"import id can't be an empty string")),n&&(s=s.concat(mo(n,i,{key:`${t.key}.data`}))),s}};function po(t,e=!1){const i=t.value,n=t.valueSpec,r=t.styleSpec;if(n.expression&&fs(Re(i)))return Os(t);if(n.expression&&Es(Fe(i)))return Ls(t);if(n.type&&uo[n.type]){const i=uo[n.type](t);return!0===e&&i.length>0&&"array"===Ci(t.value)?Ls(t):i}return Ps(ze({},t,{valueSpec:n.type?r[n.type]:n}))}function fo(t){const e=t.value,i=t.key,n=io(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Oe(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Oe(i,e,'"glyphs" url must include a "{range}" token'))),n}function mo(t,e=De,i={}){return po({key:i.key||"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:fo,"*":()=>[]}})}function go(t,e=De){return Ao(mo(t,e))}const _o=t=>Ao(ro(t)),yo=t=>Ao(ao(t)),vo=t=>Ao(lo(t)),bo=t=>Ao(co(t)),xo=t=>Ao(ho(t)),wo=t=>Ao(eo(t)),Eo=t=>Ao(Xs(t)),So=t=>Ao(Js(t)),To=t=>Ao(to(t)),Mo=t=>Ao(oo(t));function Ao(t){return t.slice().sort(((t,e)=>t.line&&e.line?t.line-e.line:0))}function Co(t,e){let i=!1;if(e&&e.length)for(const n of e)n instanceof Le?Y(n.message):(t.fire(new Pe(new Error(n.message))),i=!0);return i}var ko=Io,Po=3;function Io(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(i=r[2]);for(var s=0;s<this.d*this.d;s++){var o=r[Po+s],a=r[Po+s+1];n.push(o===a?null:r.subarray(o,a))}var l=r[Po+n.length+1];this.keys=r.subarray(r[Po+n.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var h=i/e*t;this.min=-h,this.max=t+h}Io.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},Io.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Io.prototype._insertCell=function(t,e,i,n,r,s){this.cells[r].push(s)},Io.prototype.query=function(t,e,i,n,r){var s=this.min,o=this.max;if(t<=s&&e<=s&&o<=i&&o<=n&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,i,n,this._queryCell,a,{},r),a},Io.prototype._queryCell=function(t,e,i,n,r,s,o,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,h=this.bboxes,u=0;u<l.length;u++){var d=l[u];if(void 0===o[d]){var p=4*d;(a?a(h[p+0],h[p+1],h[p+2],h[p+3]):t<=h[p+2]&&e<=h[p+3]&&i>=h[p+0]&&n>=h[p+1])?(o[d]=!0,s.push(c[d])):o[d]=!1}}},Io.prototype._forEachCell=function(t,e,i,n,r,s,o,a){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),h=this._convertToCellCoord(i),u=this._convertToCellCoord(n),d=l;d<=h;d++)for(var p=c;p<=u;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&r.call(this,t,e,i,n,f,s,o,a))return}},Io.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Io.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Io.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Po+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var s=e,o=0;o<t.length;o++){var a=t[o];r[Po+o]=s,r.set(a,s),s+=a.length}return r[Po+t.length]=s,r.set(this.keys,s),r[Po+t.length+1]=s+=this.keys.length,r.set(this.bboxes,s),s+=this.bboxes.length,r.buffer};var Do=p(ko);const Oo={};function Lo(t,e,i={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Oo[e]={klass:t,omit:i.omit||[]}}Lo(Object,"Object"),Do.serialize=function(t,e){const i=t.toArrayBuffer();return e&&e.add(i),{buffer:i}},Do.deserialize=function(t){return new Do(t.buffer)},Object.defineProperty(Do,"name",{value:"Grid"}),Lo(Do,"Grid"),Lo(ui,"Color"),Lo(Error,"Error"),Lo(bt,"AJAXError"),Lo(mi,"ResolvedImage"),Lo(Cs,"StylePropertyFunction"),Lo(ws,"StyleExpression",{omit:["_evaluator"]}),Lo(Ms,"ZoomDependentExpression"),Lo(Ts,"ZoomConstantExpression"),Lo(Ri,"CompoundExpression",{omit:["_evaluate"]});for(const t in os)Oo[os[t]._classRegistryKey]||Lo(os[t],`Expression${t}`);function zo(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ro(t){return e.ImageBitmap&&t instanceof e.ImageBitmap}function Fo(t,i){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(zo(t)||Ro(t))return i&&i.add(t),t;if(ArrayBuffer.isView(t)){const e=t;return i&&i.add(e.buffer),e}if(t instanceof e.ImageData)return i&&i.add(t.data.buffer),t;if(Array.isArray(t)){const e=[];for(const n of t)e.push(Fo(n,i));return e}if(t instanceof Map){const e={$name:"Map"};for(const[i,n]of t.entries())e[i]=Fo(n);return e}if("object"==typeof t){const e=t.constructor,n=e._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${n}`);const r=e.serialize?e.serialize(t,i):{};if(!e.serialize){for(const e in t)t.hasOwnProperty(e)&&(Oo[n].omit.indexOf(e)>=0||(r[e]=Fo(t[e],i)));t instanceof Error&&(r.message=t.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(r.$name=n),r}throw new Error("can't serialize object of type "+typeof t)}function Bo(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||zo(t)||Ro(t)||ArrayBuffer.isView(t)||t instanceof e.ImageData)return t;if(Array.isArray(t))return t.map(Bo);if("object"==typeof t){const e=t.$name||"Object";if("Map"===e){const e=new Map;for(const i of Object.keys(t))"$name"!==i&&e.set(i,Bo(t[i]));return e}const{klass:i}=Oo[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const e of Object.keys(t))"$name"!==e&&(n[e]=Bo(t[e]));return n}throw new Error("can't deserialize object of type "+typeof t)}const No={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519,"CJK Unified Ideographs Extension B":t=>t>=131072&&t<=173791};function jo(t){for(const e of t)if($o(e.charCodeAt(0)))return!0;return!1}function Vo(t){for(const e of t)if(!Uo(e.charCodeAt(0)))return!1;return!0}function Uo(t){return!(No.Arabic(t)||No["Arabic Supplement"](t)||No["Arabic Extended-A"](t)||No["Arabic Presentation Forms-A"](t)||No["Arabic Presentation Forms-B"](t))}function $o(t){return!(746!==t&&747!==t&&(t<4352||!(No["Bopomofo Extended"](t)||No.Bopomofo(t)||No["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||No["CJK Compatibility Ideographs"](t)||No["CJK Compatibility"](t)||No["CJK Radicals Supplement"](t)||No["CJK Strokes"](t)||!(!No["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||No["CJK Unified Ideographs Extension A"](t)||No["CJK Unified Ideographs"](t)||No["Enclosed CJK Letters and Months"](t)||No["Hangul Compatibility Jamo"](t)||No["Hangul Jamo Extended-A"](t)||No["Hangul Jamo Extended-B"](t)||No["Hangul Jamo"](t)||No["Hangul Syllables"](t)||No.Hiragana(t)||No["Ideographic Description Characters"](t)||No.Kanbun(t)||No["Kangxi Radicals"](t)||No["Katakana Phonetic Extensions"](t)||No.Katakana(t)&&12540!==t||!(!No["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!No["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||No["Unified Canadian Aboriginal Syllabics"](t)||No["Unified Canadian Aboriginal Syllabics Extended"](t)||No["Vertical Forms"](t)||No["Yijing Hexagram Symbols"](t)||No["Yi Syllables"](t)||No["Yi Radicals"](t))))}function Ho(t){return!($o(t)||function(t){return!!(No["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||No["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||No["Letterlike Symbols"](t)||No["Number Forms"](t)||No["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||No["Control Pictures"](t)&&9251!==t||No["Optical Character Recognition"](t)||No["Enclosed Alphanumerics"](t)||No["Geometric Shapes"](t)||No["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||No["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||No["CJK Symbols and Punctuation"](t)||No.Katakana(t)||No["Private Use Area"](t)||No["CJK Compatibility Forms"](t)||No["Small Form Variants"](t)||No["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function qo(t){return t>=1424&&t<=2303||No["Arabic Presentation Forms-A"](t)||No["Arabic Presentation Forms-B"](t)}function Wo(t,e){return!(!e&&qo(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||No.Khmer(t))}function Go(t){for(const e of t)if(qo(e.charCodeAt(0)))return!0;return!1}const Zo="deferred",Yo="loading",Xo="loaded";let Ko=null,Qo="unavailable",Jo=null;const ta=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Qo="error"),Ko&&Ko(t)};function ea(){ia.fire(new ke("pluginStateChange",{pluginStatus:Qo,pluginURL:Jo}))}const ia=new Ie,na=function(){return Qo},ra=function(){if(Qo!==Zo||!Jo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Qo=Yo,ea(),Jo&&St({url:Jo},(t=>{t?ta(t):(Qo=Xo,ea())}))},sa={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Qo===Xo||null!=sa.applyArabicShaping,isLoading:()=>Qo===Yo,setState(t){Qo=t.pluginStatus,Jo=t.pluginURL},isParsed:()=>null!=sa.applyArabicShaping&&null!=sa.processBidirectionalText&&null!=sa.processStyledBidirectionalText,getPluginURL:()=>Jo};class oa{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.transition=e.transition,this.pitch=e.pitch,this.brightness=e.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(t){return function(t,e){for(const i of t)if(!Wo(i.charCodeAt(0),e))return!1;return!0}(t,sa.isLoaded())}}class aa{constructor(t,e,i){this.property=t,this.value=e,this.expression=function(t,e,i){if(fs(t))return new Cs(t,e);if(Es(t)||Array.isArray(t)&&t.length>0){const n=As(t,e,i);if("error"===n.result)throw new Error(n.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return n.value}{let i=t;return"string"==typeof t&&"color"===e.type&&(i=ui.parse(t)),{kind:"constant",isConfigDependent:!1,evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class la{constructor(t,e){this.property=t,this.value=new aa(t,void 0,e)}transitioned(t,e){return new ha(this.property,this.value,e,R({},t.transition,this.transition),t.now)}untransitioned(){return new ha(this.property,this.value,null,{},0)}}class ca{constructor(t,e){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._options=e,this.isConfigDependent=!1}getValue(t){return G(this._values[t].value.value)}setValue(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new la(this._values[t].property,this._options)),this._values[t].value=new aa(this._values[t].property,null===e?void 0:G(e),this._options),this.isConfigDependent=this.isConfigDependent||this._values[t].value.expression.isConfigDependent}setTransitionOrValue(t,e){e&&(this._options=e);const i=this._properties.properties;if(t)for(const e in t){const n=t[e];if(H(e,"-transition")){const t=e.slice(0,-11);i[t]&&this.setTransition(t,n)}else i[e]&&this.setValue(e,n)}}getTransition(t){return G(this._values[t].transition)}setTransition(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new la(this._values[t].property)),this._values[t].transition=G(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const i=new ua(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(t,e._values[n]);return i}untransitioned(){const t=new ua(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class ha{constructor(t,e,i,n,r){const s=n.delay||0,o=n.duration||0;r=r||0,this.property=t,this.value=e,this.begin=r+s,this.end=this.begin+o,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const n=t.now||0,r=this.value.possiblyEvaluate(t,e,i),s=this.prior;if(s){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return s.possiblyEvaluate(t,e,i);{const o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(s.possiblyEvaluate(t,e,i),r,M(o))}}return r}}class ua{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const n=new fa(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(t,e,i);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class da{constructor(t,e){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._options=e,this.isConfigDependent=!1}getValue(t){return G(this._values[t].value)}setValue(t,e){this._values[t]=new aa(this._values[t].property,null===e?void 0:G(e),this._options),this.isConfigDependent=this.isConfigDependent||this._values[t].expression.isConfigDependent}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const n=new fa(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(t,e,i);return n}}class pa{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,n){return this.property.evaluate(this.value,this.parameters,t,e,i,n)}}class fa{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class ma{constructor(t){this.specification=t}possiblyEvaluate(t,e){return t.expression.evaluate(e)}interpolate(t,e,i){const n=er[this.specification.type];return n?n(t,e,i):t}}class ga{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,n){return new pa(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,n)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new pa(this,{kind:"constant",value:void 0},t.parameters);const n=er[this.specification.type];return n?new pa(this,{kind:"constant",value:n(t.value.value,e.value.value,i)},t.parameters):t}evaluate(t,e,i,n,r,s){return"constant"===t.kind?t.value:t.evaluate(e,i,n,r,s)}}class _a{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,n){return!!t.expression.evaluate(e,null,{},i,n)}interpolate(){return!1}}class ya{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const e=new oa(0,{});for(const i in t){const n=t[i];n.specification.overridable&&this.overridableProperties.push(i);const r=this.defaultPropertyValues[i]=new aa(n,void 0),s=this.defaultTransitionablePropertyValues[i]=new la(n);this.defaultTransitioningPropertyValues[i]=s.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=r.possiblyEvaluate(e)}}}Lo(ga,"DataDrivenProperty"),Lo(ma,"DataConstantProperty"),Lo(_a,"ColorRampProperty");const va="";function ba(t){return t.indexOf(va)>=0}function xa(t,e){return e?`${t}${va}${e}`:t}function wa(t){const e=t.indexOf(va);return e>=0?t.slice(0,e):t}const Ea="-transition";class Sa extends Ie{constructor(t,e,i){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.isConfigDependent=!1,"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&"sky"!==t.type&&"slot"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),this.options=i,t.slot&&(this.slot=t.slot),e.layout&&(this._unevaluatedLayout=new da(e.layout,i),this.isConfigDependent=this.isConfigDependent||this._unevaluatedLayout.isConfigDependent),e.paint)){this._transitionablePaint=new ca(e.paint,i);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this.isConfigDependent=this.isConfigDependent||this._transitionablePaint.isConfigDependent,this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new fa(e.paint)}}setScope(t){this.scope=t,this.fqid=xa(this.id,t)}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,i={}){if(null!=e&&this._validate(To,`layers.${this.id}.layout.${t}`,t,e,i))return;if("custom"===this.type&&"visibility"===t)return void(this.visibility=e);const n=this._unevaluatedLayout;n._properties.properties[t]&&(n.setValue(t,e),this.isConfigDependent=this.isConfigDependent||n.isConfigDependent,"visibility"===t&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(t){return H(t,Ea)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate(So,`layers.${this.id}.paint.${t}`,t,e,i))return!1;const n=this._transitionablePaint,r=n._properties.properties;if(H(t,Ea)){const i=t.slice(0,-11);return r[i]&&n.setTransition(i,e||void 0),!1}if(!r[t])return!1;const s=n._values[t],o=s.value.isDataDriven(),a=s.value;n.setValue(t,e),this.isConfigDependent=this.isConfigDependent||n.isConfigDependent,this._handleSpecialPaintPropertyUpdate(t);const l=n._values[t].value,c=l.isDataDriven(),h=H(t,"pattern")||"line-dasharray"===t;return c||o||h||this._handleOverridablePaintPropertyUpdate(t,a,l)}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getDefaultProgramParams(t,e){return null}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){return W({id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()},((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,n,r={}){return(!r||!1!==r.validate)&&Co(this,t.call(go,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:De,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof pa&&hs(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=Bs(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(){this._stats&&(this._stats.numRenderedVerticesInShadowPass=0,this._stats.numRenderedVerticesInTransparentPass=0)}}class Ta{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages=new Set}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(t,e){this._updatedSourceCaches[t]=e,this.setDirty()}discardSourceCacheUpdate(t){delete this._updatedSourceCaches[t]}updateLayer(t){const e=t.scope;this._updatedLayers[e]=this._updatedLayers[e]||new Set,this._updatedLayers[e].add(t.id),this.setDirty()}removeLayer(t){const e=t.scope;this._removedLayers[e]=this._removedLayers[e]||{},this._updatedLayers[e]=this._updatedLayers[e]||new Set,this._removedLayers[e][t.id]=t,this._updatedLayers[e].delete(t.id),this._updatedPaintProps.delete(t.fqid),this.setDirty()}getRemovedLayer(t){return this._removedLayers[t.scope]?this._removedLayers[t.scope][t.id]:null}discardLayerRemoval(t){this._removedLayers[t.scope]&&delete this._removedLayers[t.scope][t.id]}getLayerUpdatesByScope(){const t={};for(const e in this._updatedLayers)t[e]=t[e]||{},t[e].updatedIds=Array.from(this._updatedLayers[e].values());for(const e in this._removedLayers)t[e]=t[e]||{},t[e].removedIds=Object.keys(this._removedLayers[e]);return t}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(t){this._updatedPaintProps.add(t.fqid),this.setDirty()}getUpdatedImages(){return Array.from(this._updatedImages.values())}updateImage(t){this._updatedImages.add(t),this.setDirty()}resetUpdatedImages(){this._updatedImages.clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages.clear()}}const Ma={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Aa{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ca{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.add(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ka(t,e=1){let i=0,n=0;return{members:t.map((t=>{const r=Ma[t.type].BYTES_PER_ELEMENT,s=i=Pa(i,Math.max(e,r)),o=t.components||1;return n=Math.max(n,r),i+=r*o,{name:t.name,type:t.type,components:o,offset:s}})),size:Pa(i,Math.max(n,e)),alignment:e}}function Pa(t,e){return Math.ceil(t/e)*e}class Ia extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=i,t}}Ia.prototype.bytesPerElement=4,Lo(Ia,"StructArrayLayout2i4");class Da extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.int16[r+0]=e,this.int16[r+1]=i,this.int16[r+2]=n,t}}Da.prototype.bytesPerElement=6,Lo(Da,"StructArrayLayout3i6");class Oa extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const s=4*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=r,t}}Oa.prototype.bytesPerElement=8,Lo(Oa,"StructArrayLayout4i8");class La extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r)}emplace(t,e,i,n,r,s){const o=5*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,this.int16[o+4]=s,t}}La.prototype.bytesPerElement=10,Lo(La,"StructArrayLayout5i10");class za extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,s,o)}emplace(t,e,i,n,r,s,o,a){const l=6*t,c=12*t,h=3*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=s,this.uint8[c+7]=o,this.float32[h+2]=a,t}}za.prototype.bytesPerElement=12,Lo(za,"StructArrayLayout2i4ub1f12");class Ra extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const s=4*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=n,this.float32[s+3]=r,t}}Ra.prototype.bytesPerElement=16,Lo(Ra,"StructArrayLayout4f16");class Fa extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r)}emplace(t,e,i,n,r,s){const o=6*t,a=3*t;return this.uint16[o+0]=e,this.uint16[o+1]=i,this.uint16[o+2]=n,this.uint16[o+3]=r,this.float32[a+2]=s,t}}Fa.prototype.bytesPerElement=12,Lo(Fa,"StructArrayLayout4ui1f12");class Ba extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const s=4*t;return this.uint16[s+0]=e,this.uint16[s+1]=i,this.uint16[s+2]=n,this.uint16[s+3]=r,t}}Ba.prototype.bytesPerElement=8,Lo(Ba,"StructArrayLayout4ui8");class Na extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r,s)}emplace(t,e,i,n,r,s,o){const a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=s,this.int16[a+5]=o,t}}Na.prototype.bytesPerElement=12,Lo(Na,"StructArrayLayout6i12");class ja extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o,a,l,c,h,u){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,n,r,s,o,a,l,c,h,u)}emplace(t,e,i,n,r,s,o,a,l,c,h,u,d){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=n,this.int16[p+3]=r,this.uint16[p+4]=s,this.uint16[p+5]=o,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=h,this.int16[p+10]=u,this.int16[p+11]=d,t}}ja.prototype.bytesPerElement=24,Lo(ja,"StructArrayLayout4i4ui4i24");class Va extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r,s)}emplace(t,e,i,n,r,s,o){const a=10*t,l=5*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.float32[l+2]=r,this.float32[l+3]=s,this.float32[l+4]=o,t}}Va.prototype.bytesPerElement=20,Lo(Va,"StructArrayLayout3i3f20");class Ua extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Ua.prototype.bytesPerElement=4,Lo(Ua,"StructArrayLayout1ul4");class $a extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,t}}$a.prototype.bytesPerElement=4,Lo($a,"StructArrayLayout2ui4");class Ha extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o,a,l,c,h,u,d){const p=this.length;return this.resize(p+1),this.emplace(p,t,e,i,n,r,s,o,a,l,c,h,u,d)}emplace(t,e,i,n,r,s,o,a,l,c,h,u,d,p){const f=20*t,m=10*t;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=r,this.int16[f+4]=s,this.float32[m+3]=o,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=h,this.uint32[m+8]=u,this.uint16[f+18]=d,this.uint16[f+19]=p,t}}Ha.prototype.bytesPerElement=40,Lo(Ha,"StructArrayLayout5i4f1i1ul2ui40");class qa extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,s,o)}emplace(t,e,i,n,r,s,o,a){const l=8*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+4]=r,this.int16[l+5]=s,this.int16[l+6]=o,this.int16[l+7]=a,t}}qa.prototype.bytesPerElement=16,Lo(qa,"StructArrayLayout3i2i2i16");class Wa extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r)}emplace(t,e,i,n,r,s){const o=4*t,a=8*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.int16[a+6]=r,this.int16[a+7]=s,t}}Wa.prototype.bytesPerElement=16,Lo(Wa,"StructArrayLayout2f1f2i16");class Ga extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const s=12*t,o=3*t;return this.uint8[s+0]=e,this.uint8[s+1]=i,this.float32[o+1]=n,this.float32[o+2]=r,t}}Ga.prototype.bytesPerElement=12,Lo(Ga,"StructArrayLayout2ub2f12");class Za extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,this.uint16[r+2]=n,t}}Za.prototype.bytesPerElement=6,Lo(Za,"StructArrayLayout3ui6");class Ya extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b){const x=this.length;return this.resize(x+1),this.emplace(x,t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b)}emplace(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x){const w=30*t,E=15*t,S=60*t;return this.int16[w+0]=e,this.int16[w+1]=i,this.int16[w+2]=n,this.float32[E+2]=r,this.float32[E+3]=s,this.uint16[w+8]=o,this.uint16[w+9]=a,this.uint32[E+5]=l,this.uint32[E+6]=c,this.uint32[E+7]=h,this.uint16[w+16]=u,this.uint16[w+17]=d,this.uint16[w+18]=p,this.float32[E+10]=f,this.float32[E+11]=m,this.uint8[S+48]=g,this.uint8[S+49]=_,this.uint8[S+50]=y,this.uint32[E+13]=v,this.int16[w+28]=b,this.uint8[S+58]=x,t}}Ya.prototype.bytesPerElement=60,Lo(Ya,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Xa extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x,w,E,S,T,M,A,C,k,P,I){const D=this.length;return this.resize(D+1),this.emplace(D,t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x,w,E,S,T,M,A,C,k,P,I)}emplace(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x,w,E,S,T,M,A,C,k,P,I,D){const O=20*t,L=40*t,z=80*t;return this.float32[O+0]=e,this.float32[O+1]=i,this.int16[L+4]=n,this.int16[L+5]=r,this.int16[L+6]=s,this.int16[L+7]=o,this.int16[L+8]=a,this.int16[L+9]=l,this.int16[L+10]=c,this.int16[L+11]=h,this.int16[L+12]=u,this.uint16[L+13]=d,this.uint16[L+14]=p,this.uint16[L+15]=f,this.uint16[L+16]=m,this.uint16[L+17]=g,this.uint16[L+18]=_,this.uint16[L+19]=y,this.uint16[L+20]=v,this.uint16[L+21]=b,this.uint16[L+22]=x,this.uint16[L+23]=w,this.uint16[L+24]=E,this.uint16[L+25]=S,this.uint16[L+26]=T,this.uint16[L+27]=M,this.uint32[O+14]=A,this.float32[O+15]=C,this.float32[O+16]=k,this.float32[O+17]=P,this.float32[O+18]=I,this.uint8[z+76]=D,t}}Xa.prototype.bytesPerElement=80,Lo(Xa,"StructArrayLayout2f9i15ui1ul4f1ub80");class Ka extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Ka.prototype.bytesPerElement=4,Lo(Ka,"StructArrayLayout1f4");class Qa extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r)}emplace(t,e,i,n,r,s){const o=5*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,this.float32[o+4]=s,t}}Qa.prototype.bytesPerElement=20,Lo(Qa,"StructArrayLayout5f20");class Ja extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,s,o)}emplace(t,e,i,n,r,s,o,a){const l=7*t;return this.float32[l+0]=e,this.float32[l+1]=i,this.float32[l+2]=n,this.float32[l+3]=r,this.float32[l+4]=s,this.float32[l+5]=o,this.float32[l+6]=a,t}}Ja.prototype.bytesPerElement=28,Lo(Ja,"StructArrayLayout7f28");class tl extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const s=6*t;return this.uint32[3*t+0]=e,this.uint16[s+2]=i,this.uint16[s+3]=n,this.uint16[s+4]=r,t}}tl.prototype.bytesPerElement=12,Lo(tl,"StructArrayLayout1ul3ui12");class el extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}el.prototype.bytesPerElement=2,Lo(el,"StructArrayLayout1ui2");class il extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.float32[r+0]=e,this.float32[r+1]=i,this.float32[r+2]=n,t}}il.prototype.bytesPerElement=12,Lo(il,"StructArrayLayout3f12");class nl extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=i,t}}nl.prototype.bytesPerElement=8,Lo(nl,"StructArrayLayout2f8");class rl extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m){const g=this.length;return this.resize(g+1),this.emplace(g,t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m)}emplace(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g){const _=16*t;return this.float32[_+0]=e,this.float32[_+1]=i,this.float32[_+2]=n,this.float32[_+3]=r,this.float32[_+4]=s,this.float32[_+5]=o,this.float32[_+6]=a,this.float32[_+7]=l,this.float32[_+8]=c,this.float32[_+9]=h,this.float32[_+10]=u,this.float32[_+11]=d,this.float32[_+12]=p,this.float32[_+13]=f,this.float32[_+14]=m,this.float32[_+15]=g,t}}rl.prototype.bytesPerElement=64,Lo(rl,"StructArrayLayout16f64");class sl extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,s,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,s,o)}emplace(t,e,i,n,r,s,o,a){const l=10*t,c=5*t;return this.uint16[l+0]=e,this.uint16[l+1]=i,this.uint16[l+2]=n,this.uint16[l+3]=r,this.float32[c+2]=s,this.float32[c+3]=o,this.float32[c+4]=a,t}}sl.prototype.bytesPerElement=20,Lo(sl,"StructArrayLayout4ui3f20");class ol extends Ca{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint8[1*t+0]=e,t}}ol.prototype.bytesPerElement=1,Lo(ol,"StructArrayLayout1ub1");class al extends Aa{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}al.prototype.size=40;class ll extends Ha{get(t){return new al(this,t)}}Lo(ll,"CollisionBoxArray");class cl extends Aa{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}cl.prototype.size=60;class hl extends Ya{get(t){return new cl(this,t)}}Lo(hl,"PlacedSymbolArray");class ul extends Aa{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(t){this._structArray.uint32[this._pos4+14]=t}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(t){this._structArray.float32[this._pos4+18]=t}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}ul.prototype.size=80;class dl extends Xa{get(t){return new ul(this,t)}}Lo(dl,"SymbolInstanceArray");class pl extends Ka{getoffsetX(t){return this.float32[1*t+0]}}Lo(pl,"GlyphOffsetArray");class fl extends Ia{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}Lo(fl,"SymbolLineVertexArray");class ml extends Aa{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}ml.prototype.size=12;class gl extends tl{get(t){return new ml(this,t)}}Lo(gl,"FeatureIndexArray");class _l extends $a{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}Lo(_l,"FillExtrusionCentroidArray");const yl=ka([{name:"a_pos",components:2,type:"Int16"}],4),vl=ka([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class bl{constructor(t=[]){this.segments=t}_prepareSegment(t,e,i,n){let r=this.segments[this.segments.length-1];return t>bl.MAX_VERTEX_ARRAY_LENGTH&&Y(`Max vertices per segment is ${bl.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!r||r.vertexLength+t>bl.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:e,primitiveOffset:i,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r}prepareSegment(t,e,i,n){return this._prepareSegment(t,e.length,i.length,n)}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,n){return new bl([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}function xl(t,e){return 256*(t=I(Math.floor(t),0,255))+I(Math.floor(e),0,255)}bl.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Lo(bl,"SegmentVector");const wl=ka([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),El=ka([{name:"a_dash",components:4,type:"Uint16"}]);var Sl={exports:{}},Tl={exports:{}};!function(t){t.exports=function(t,e){var i,n,r,s,o,a,l,c;for(n=t.length-(i=3&t.length),r=e,o=3432918353,a=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,r=27492+(65535&(s=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(s>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}}(Tl);var Ml=Tl.exports,Al={exports:{}};!function(t){t.exports=function(t,e){for(var i,n=t.length,r=e^n,s=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++s;switch(n){case 3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}}(Al);var Cl=Ml,kl=Al.exports;Sl.exports=Cl,Sl.exports.murmur3=Cl,Sl.exports.murmur2=kl;var Pl=p(Sl.exports);class Il{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(t,e,i,n){this.ids.push(Dl(t)),this.positions.push(e,i,n)}eachPosition(t,e){const i=Dl(t);let n=0,r=this.ids.length-1;for(;n<r;){const t=n+r>>1;this.ids[t]>=i?r=t:n=t+1}for(;this.ids[n]===i;)e(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(t,e){const i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Ol(i,n,0,i.length-1),e&&(e.add(i.buffer),e.add(n.buffer)),{ids:i,positions:n}}static deserialize(t){const e=new Il;let i;e.ids=t.ids,e.positions=t.positions;for(const t of e.ids)t!==i&&e.uniqueIds.push(t),i=t;return e.indexed=!0,e}}function Dl(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Pl(String(t))}function Ol(t,e,i,n){for(;i<n;){const r=t[i+n>>1];let s=i-1,o=n+1;for(;;){do{s++}while(t[s]<r);do{o--}while(t[o]>r);if(s>=o)break;Ll(t,s,o),Ll(e,3*s,3*o),Ll(e,3*s+1,3*o+1),Ll(e,3*s+2,3*o+2)}o-i<n-o?(Ol(t,e,i,o),i=o+1):(Ol(t,e,o+1,n),n=o)}}function Ll(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}Lo(Il,"FeaturePositionMap");class zl{constructor(t){this.gl=t.gl,this.initialized=!1}fetchUniformLocation(t,e){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(t,e),this.initialized=!0),!!this.location}}class Rl extends zl{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}}class Fl extends zl{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class Bl extends zl{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}}class Nl extends zl{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}}class jl extends zl{constructor(t){super(t),this.current=[0,0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3])))}}class Vl extends zl{constructor(t){super(t),this.current=ui.transparent}set(t,e,i){this.fetchUniformLocation(t,e)&&(i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a)))}}const Ul=new Float32Array(16);class $l extends zl{constructor(t){super(t),this.current=Ul}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let t=1;t<16;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}}const Hl=new Float32Array(9);class ql extends zl{constructor(t){super(t),this.current=Hl}set(t,e,i){if(this.fetchUniformLocation(t,e))for(let t=0;t<9;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}const Wl=new Float32Array(4);class Gl extends zl{constructor(t){super(t),this.current=Wl}set(t,e,i){if(this.fetchUniformLocation(t,e))for(let t=0;t<4;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}function Zl(t){return[xl(255*t.r,255*t.g),xl(255*t.b,255*t.a)]}class Yl{constructor(t,e,i){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=i}setUniform(t,e,i,n,r){e.set(t,r,n.constantOr(this.value))}getBinding(t,e){return"color"===this.type?new Vl(t):new Fl(t)}}class Xl{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,e,i,n,r){const s="u_pattern"===r||"u_dash"===r?this.pattern:"u_pixel_ratio"===r?this.pixelRatio:null;s&&e.set(t,r,s)}getBinding(t,e){return"u_pattern"===e||"u_dash"===e?new jl(t):new Fl(t)}}class Kl{constructor(t,e,i,n){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,i,n,r,s,o){const a=this.paintVertexArray.length,l=this.expression.evaluate(new oa(0,{brightness:s}),e,{},r,n,o);this.paintVertexArray.resize(t),this._setPaintValue(a,t,l)}updatePaintArray(t,e,i,n,r,s,o){const a=this.expression.evaluate({zoom:0,brightness:o},i,n,void 0,r);this._setPaintValue(t,e,a)}_setPaintValue(t,e,i){if("color"===this.type){const n=Zl(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ql{constructor(t,e,i,n,r,s){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=i,this.useIntegerZoom=n,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new s}populatePaintArray(t,e,i,n,r,s,o){const a=this.expression.evaluate(new oa(this.zoom,{brightness:s}),e,{},r,n,o),l=this.expression.evaluate(new oa(this.zoom+1,{brightness:s}),e,{},r,n,o),c=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(c,t,a,l)}updatePaintArray(t,e,i,n,r,s,o){const a=this.expression.evaluate({zoom:this.zoom,brightness:o},i,n,void 0,r),l=this.expression.evaluate({zoom:this.zoom+1,brightness:o},i,n,void 0,r);this._setPaintValue(t,e,a,l)}_setPaintValue(t,e,i,n){if("color"===this.type){const r=Zl(i),s=Zl(n);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1],s[0],s[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e,i,n,r){const s=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,o=I(this.expression.interpolationFactor(s,this.zoom,this.zoom+1),0,1);e.set(t,r,o)}getBinding(t,e){return new Fl(t)}}class Jl{constructor(t,e,i,n,r){this.expression=t,this.layerId=r,this.paintVertexAttributes=("array"===i?El:wl).members;for(let t=0;t<e.length;++t);this.paintVertexArray=new n}populatePaintArray(t,e,i){const n=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],i)}updatePaintArray(t,e,i,n,r,s,o){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],s)}_setPaintValues(t,e,i,n){if(!n||!i)return;const r=n[i];if(!r)return;const{tl:s,br:o,pixelRatio:a}=r;for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,s[0],s[1],o[0],o[1],a)}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class tc{constructor(t,e,i=(()=>!0)){this.binders={},this._buffers=[];const n=[];for(const r in t.paint._values){const s=t.paint.get(r);if(!i(r))continue;if(!(s instanceof pa&&hs(s.property.specification)))continue;const o=nc(r,t.type),a=s.value,l=s.property.specification.type,c=!!s.property.useIntegerZoom,h="line-dasharray"===r||r.endsWith("pattern"),u="line-dasharray"===r&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==a.kind||u)if("source"===a.kind||u||h){const e=oc(r,l,"source");this.binders[r]=h?new Jl(a,o,l,e,t.id):new Kl(a,o,l,e),n.push(`/a_${r}`)}else{const t=oc(r,l,"composite");this.binders[r]=new Ql(a,o,l,c,e,t),n.push(`/z_${r}`)}else this.binders[r]=h?new Xl(a.value,o):new Yl(a.value,o,l),n.push(`/u_${r}`)}this.cacheKey=n.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Kl||e instanceof Ql?e.maxValue:0}populatePaintArrays(t,e,i,n,r,s,o){for(const a in this.binders){const l=this.binders[a];(l instanceof Kl||l instanceof Ql||l instanceof Jl)&&l.populatePaintArray(t,e,i,n,r,s,o)}}setConstantPatternPositions(t){for(const e in this.binders){const i=this.binders[e];i instanceof Xl&&i.setConstantPatternPositions(t)}}updatePaintArrays(t,e,i,n,r,s,o,a){let l=!1;const c=Object.keys(t),h=0!==c.length,u=h?c:e.uniqueIds;for(const c in this.binders){const d=this.binders[c];if((d instanceof Kl||d instanceof Ql||d instanceof Jl)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=r.paint.get(c);d.expression=p.value;for(const i of u){const r=t[i.toString()];e.eachPosition(i,((t,e,i)=>{const l=n.feature(t);d.updatePaintArray(e,i,l,r,s,o,a)}))}if(!h)for(const e of i.uniqueIds){const r=t[e.toString()];i.eachPosition(e,((t,e,i)=>{const l=n.feature(t);d.updatePaintArray(e,i,l,r,s,o,a)}))}l=!0}}return l}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Yl||i instanceof Xl)&&t.push(...i.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Kl||i instanceof Ql||i instanceof Jl)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Yl||i instanceof Xl||i instanceof Ql)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Yl||n instanceof Xl||n instanceof Ql)for(const r of n.uniformNames)e.push({name:r,property:i,binding:n.getBinding(t,r)})}return e}setUniforms(t,e,i,n,r){for(const{name:e,property:s,binding:o}of i)this.binders[s].setUniform(t,o,r,n.get(s),e)}updatePaintBuffers(){this._buffers=[];for(const t in this.binders){const e=this.binders[t];(e instanceof Kl||e instanceof Ql||e instanceof Jl)&&e.paintVertexBuffer&&this._buffers.push(e.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Kl||i instanceof Ql||i instanceof Jl)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Kl||e instanceof Ql||e instanceof Jl)&&e.destroy()}}}class ec{constructor(t,e,i=(()=>!0)){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new tc(n,e,i);this.needsUpload=!1,this._featureMap=new Il,this._featureMapWithoutIds=new Il,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(t,e,i,n,r,s,o,a){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,n,r,s,o,a);void 0!==e.id?this._featureMap.add(e.id,i,this._bufferOffset,t):(this._featureMapWithoutIds.add(this._idlessCounter,i,this._bufferOffset,t),this._idlessCounter+=1),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,n,r,s){for(const o of i)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,this._featureMapWithoutIds,e,o,n,r,s||0)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const ic={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function nc(t,e){return ic[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const rc={"line-pattern":{source:Fa,composite:Fa},"fill-pattern":{source:Fa,composite:Fa},"fill-extrusion-pattern":{source:Fa,composite:Fa},"line-dasharray":{source:Ba,composite:Ba}},sc={color:{source:nl,composite:Ra},number:{source:Ka,composite:nl}};function oc(t,e,i){const n=rc[t];return n&&n[i]||sc[e][i]}Lo(Yl,"ConstantBinder"),Lo(Xl,"PatternConstantBinder"),Lo(Kl,"SourceExpressionBinder"),Lo(Jl,"PatternCompositeBinder"),Lo(Ql,"CompositeExpressionBinder"),Lo(tc,"ProgramConfiguration",{omit:["_buffers"]}),Lo(ec,"ProgramConfigurationSet");class ac{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}setNorthEast(t){return this._ne=t instanceof Zd?new Zd(t.lng,t.lat):Zd.convert(t),this}setSouthWest(t){return this._sw=t instanceof Zd?new Zd(t.lng,t.lat):Zd.convert(t),this}extend(t){const e=this._sw,i=this._ne;let n,r;if(t instanceof Zd)n=t,r=t;else{if(!(t instanceof ac))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(ac.convert(t)):this.extend(Zd.convert(t)):"object"==typeof t&&null!==t&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(Zd.convert(t)):this;if(n=t._sw,r=t._ne,!n||!r)return this}return e||i?(e.lng=Math.min(n.lng,e.lng),e.lat=Math.min(n.lat,e.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Zd(n.lng,n.lat),this._ne=new Zd(r.lng,r.lat)),this}getCenter(){return new Zd((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Zd(this.getWest(),this.getNorth())}getSouthEast(){return new Zd(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:e,lat:i}=Zd.convert(t);let n=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(t){return!t||t instanceof ac?t:new ac(t)}}var lc={},cc={};Object.defineProperty(cc,"__esModule",{value:!0}),cc.setMatrixArrayType=function(t){cc.ARRAY_TYPE=uc=t},cc.toRadian=function(t){return t*pc},cc.equals=function(t,e){return Math.abs(t-e)<=hc*Math.max(1,Math.abs(t),Math.abs(e))},cc.RANDOM=cc.ARRAY_TYPE=cc.EPSILON=void 0;var hc=1e-6;cc.EPSILON=hc;var uc="undefined"!=typeof Float32Array?Float32Array:Array;cc.ARRAY_TYPE=uc;var dc=Math.random;cc.RANDOM=dc;var pc=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var fc={};function mc(t){return mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(t)}Object.defineProperty(fc,"__esModule",{value:!0}),fc.create=function(){var t=new gc.ARRAY_TYPE(4);return gc.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},fc.clone=function(t){var e=new gc.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},fc.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fc.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},fc.fromValues=function(t,e,i,n){var r=new gc.ARRAY_TYPE(4);return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r},fc.set=function(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t},fc.transpose=function(t,e){if(t===e){var i=e[1];t[1]=e[2],t[2]=i}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},fc.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=i*s-r*n;return o?(t[0]=s*(o=1/o),t[1]=-n*o,t[2]=-r*o,t[3]=i*o,t):null},fc.adjoint=function(t,e){var i=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=i,t},fc.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},fc.multiply=yc,fc.rotate=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+s*a,t[1]=r*l+o*a,t[2]=n*-a+s*l,t[3]=r*-a+o*l,t},fc.scale=function(t,e,i){var n=e[1],r=e[2],s=e[3],o=i[0],a=i[1];return t[0]=e[0]*o,t[1]=n*o,t[2]=r*a,t[3]=s*a,t},fc.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t},fc.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},fc.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},fc.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},fc.LDU=function(t,e,i,n){return t[2]=n[2]/n[0],i[0]=n[0],i[1]=n[1],i[3]=n[3]-t[2]*i[1],[t,e,i]},fc.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t},fc.subtract=vc,fc.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},fc.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1],l=e[2],c=e[3];return Math.abs(i-o)<=gc.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-a)<=gc.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-l)<=gc.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-c)<=gc.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))},fc.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},fc.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t},fc.sub=fc.mul=void 0;var gc=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==mc(t)&&"function"!=typeof t)return{default:t};var i=_c(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function _c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(_c=function(t){return t?i:e})(t)}function yc(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=i[0],l=i[1],c=i[2],h=i[3];return t[0]=n*a+s*l,t[1]=r*a+o*l,t[2]=n*c+s*h,t[3]=r*c+o*h,t}function vc(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}fc.mul=yc,fc.sub=vc;var bc={};function xc(t){return xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(t)}Object.defineProperty(bc,"__esModule",{value:!0}),bc.create=function(){var t=new wc.ARRAY_TYPE(6);return wc.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},bc.clone=function(t){var e=new wc.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},bc.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},bc.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},bc.fromValues=function(t,e,i,n,r,s){var o=new wc.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=r,o[5]=s,o},bc.set=function(t,e,i,n,r,s,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t},bc.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=i*s-n*r;return l?(t[0]=s*(l=1/l),t[1]=-n*l,t[2]=-r*l,t[3]=i*l,t[4]=(r*a-s*o)*l,t[5]=(n*o-i*a)*l,t):null},bc.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},bc.multiply=Sc,bc.rotate=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=Math.sin(i),h=Math.cos(i);return t[0]=n*h+s*c,t[1]=r*h+o*c,t[2]=n*-c+s*h,t[3]=r*-c+o*h,t[4]=a,t[5]=l,t},bc.scale=function(t,e,i){var n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=i[0],c=i[1];return t[0]=e[0]*l,t[1]=n*l,t[2]=r*c,t[3]=s*c,t[4]=o,t[5]=a,t},bc.translate=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=i[0],h=i[1];return t[0]=n,t[1]=r,t[2]=s,t[3]=o,t[4]=n*c+s*h+a,t[5]=r*c+o*h+l,t},bc.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t[4]=0,t[5]=0,t},bc.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},bc.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},bc.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},bc.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)},bc.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t},bc.subtract=Tc,bc.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t},bc.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t[4]=e[4]+i[4]*n,t[5]=e[5]+i[5]*n,t},bc.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},bc.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=e[0],c=e[1],h=e[2],u=e[3],d=e[4],p=e[5];return Math.abs(i-l)<=wc.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(n-c)<=wc.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-h)<=wc.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(s-u)<=wc.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(o-d)<=wc.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=wc.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))},bc.sub=bc.mul=void 0;var wc=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==xc(t)&&"function"!=typeof t)return{default:t};var i=Ec(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function Ec(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(Ec=function(t){return t?i:e})(t)}function Sc(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=i[0],h=i[1],u=i[2],d=i[3],p=i[4],f=i[5];return t[0]=n*c+s*h,t[1]=r*c+o*h,t[2]=n*u+s*d,t[3]=r*u+o*d,t[4]=n*p+s*f+a,t[5]=r*p+o*f+l,t}function Tc(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t}bc.mul=Sc,bc.sub=Tc;var Mc={};function Ac(t){return Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(t)}Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.create=function(){var t=new Cc.ARRAY_TYPE(9);return Cc.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},Mc.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},Mc.clone=function(t){var e=new Cc.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},Mc.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},Mc.fromValues=function(t,e,i,n,r,s,o,a,l){var c=new Cc.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=i,c[3]=n,c[4]=r,c[5]=s,c[6]=o,c[7]=a,c[8]=l,c},Mc.set=function(t,e,i,n,r,s,o,a,l,c){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t},Mc.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},Mc.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},Mc.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=h*o-a*c,d=-h*s+a*l,p=c*s-o*l,f=i*u+n*d+r*p;return f?(t[0]=u*(f=1/f),t[1]=(-h*n+r*c)*f,t[2]=(a*n-r*o)*f,t[3]=d*f,t[4]=(h*i-r*l)*f,t[5]=(-a*i+r*s)*f,t[6]=p*f,t[7]=(-c*i+n*l)*f,t[8]=(o*i-n*s)*f,t):null},Mc.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8];return t[0]=o*h-a*c,t[1]=r*c-n*h,t[2]=n*a-r*o,t[3]=a*l-s*h,t[4]=i*h-r*l,t[5]=r*s-i*a,t[6]=s*c-o*l,t[7]=n*l-i*c,t[8]=i*o-n*s,t},Mc.determinant=function(t){var e=t[3],i=t[4],n=t[5],r=t[6],s=t[7],o=t[8];return t[0]*(o*i-n*s)+t[1]*(-o*e+n*r)+t[2]*(s*e-i*r)},Mc.multiply=Pc,Mc.translate=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=i[0],p=i[1];return t[0]=n,t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=d*n+p*o+c,t[7]=d*r+p*a+h,t[8]=d*s+p*l+u,t},Mc.rotate=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=Math.sin(i),p=Math.cos(i);return t[0]=p*n+d*o,t[1]=p*r+d*a,t[2]=p*s+d*l,t[3]=p*o-d*n,t[4]=p*a-d*r,t[5]=p*l-d*s,t[6]=c,t[7]=h,t[8]=u,t},Mc.scale=function(t,e,i){var n=i[0],r=i[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},Mc.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},Mc.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},Mc.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},Mc.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},Mc.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=i+i,a=n+n,l=r+r,c=i*o,h=n*o,u=n*a,d=r*o,p=r*a,f=r*l,m=s*o,g=s*a,_=s*l;return t[0]=1-u-f,t[3]=h-_,t[6]=d+g,t[1]=h+_,t[4]=1-c-f,t[7]=p-m,t[2]=d-g,t[5]=p+m,t[8]=1-c-u,t},Mc.normalFromMat4=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],_=e[15],y=i*a-n*o,v=i*l-r*o,b=i*c-s*o,x=n*l-r*a,w=n*c-s*a,E=r*c-s*l,S=h*m-u*f,T=h*g-d*f,M=h*_-p*f,A=u*g-d*m,C=u*_-p*m,k=d*_-p*g,P=y*k-v*C+b*A+x*M-w*T+E*S;return P?(t[0]=(a*k-l*C+c*A)*(P=1/P),t[1]=(l*M-o*k-c*T)*P,t[2]=(o*C-a*M+c*S)*P,t[3]=(r*C-n*k-s*A)*P,t[4]=(i*k-r*M+s*T)*P,t[5]=(n*M-i*C-s*S)*P,t[6]=(m*E-g*w+_*x)*P,t[7]=(g*b-f*E-_*v)*P,t[8]=(f*w-m*b+_*y)*P,t):null},Mc.projection=function(t,e,i){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/i,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},Mc.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},Mc.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},Mc.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t},Mc.subtract=Ic,Mc.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t},Mc.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t[4]=e[4]+i[4]*n,t[5]=e[5]+i[5]*n,t[6]=e[6]+i[6]*n,t[7]=e[7]+i[7]*n,t[8]=e[8]+i[8]*n,t},Mc.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},Mc.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=e[0],d=e[1],p=e[2],f=e[3],m=e[4],g=e[5],_=e[6],y=e[7],v=e[8];return Math.abs(i-u)<=Cc.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(n-d)<=Cc.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(r-p)<=Cc.EPSILON*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(s-f)<=Cc.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(o-m)<=Cc.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(a-g)<=Cc.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(l-_)<=Cc.EPSILON*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-y)<=Cc.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(h-v)<=Cc.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))},Mc.sub=Mc.mul=void 0;var Cc=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==Ac(t)&&"function"!=typeof t)return{default:t};var i=kc(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function kc(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(kc=function(t){return t?i:e})(t)}function Pc(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=i[0],p=i[1],f=i[2],m=i[3],g=i[4],_=i[5],y=i[6],v=i[7],b=i[8];return t[0]=d*n+p*o+f*c,t[1]=d*r+p*a+f*h,t[2]=d*s+p*l+f*u,t[3]=m*n+g*o+_*c,t[4]=m*r+g*a+_*h,t[5]=m*s+g*l+_*u,t[6]=y*n+v*o+b*c,t[7]=y*r+v*a+b*h,t[8]=y*s+v*l+b*u,t}function Ic(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t}Mc.mul=Pc,Mc.sub=Ic;var Dc={};function Oc(t){return Oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(t)}Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.create=function(){var t=new Lc.ARRAY_TYPE(16);return Lc.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},Dc.clone=function(t){var e=new Lc.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},Dc.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},Dc.fromValues=function(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m){var g=new Lc.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=o,g[7]=a,g[8]=l,g[9]=c,g[10]=h,g[11]=u,g[12]=d,g[13]=p,g[14]=f,g[15]=m,g},Dc.set=function(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t[9]=h,t[10]=u,t[11]=d,t[12]=p,t[13]=f,t[14]=m,t[15]=g,t},Dc.identity=Rc,Dc.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=r,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},Dc.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],_=e[15],y=i*a-n*o,v=i*l-r*o,b=i*c-s*o,x=n*l-r*a,w=n*c-s*a,E=r*c-s*l,S=h*m-u*f,T=h*g-d*f,M=h*_-p*f,A=u*g-d*m,C=u*_-p*m,k=d*_-p*g,P=y*k-v*C+b*A+x*M-w*T+E*S;return P?(t[0]=(a*k-l*C+c*A)*(P=1/P),t[1]=(r*C-n*k-s*A)*P,t[2]=(m*E-g*w+_*x)*P,t[3]=(d*w-u*E-p*x)*P,t[4]=(l*M-o*k-c*T)*P,t[5]=(i*k-r*M+s*T)*P,t[6]=(g*b-f*E-_*v)*P,t[7]=(h*E-d*b+p*v)*P,t[8]=(o*C-a*M+c*S)*P,t[9]=(n*M-i*C-s*S)*P,t[10]=(f*w-m*b+_*y)*P,t[11]=(u*b-h*w-p*y)*P,t[12]=(a*T-o*A-l*S)*P,t[13]=(i*A-n*T+r*S)*P,t[14]=(m*v-f*x-g*y)*P,t[15]=(h*x-u*v+d*y)*P,t):null},Dc.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],_=e[15];return t[0]=a*(d*_-p*g)-u*(l*_-c*g)+m*(l*p-c*d),t[1]=-(n*(d*_-p*g)-u*(r*_-s*g)+m*(r*p-s*d)),t[2]=n*(l*_-c*g)-a*(r*_-s*g)+m*(r*c-s*l),t[3]=-(n*(l*p-c*d)-a*(r*p-s*d)+u*(r*c-s*l)),t[4]=-(o*(d*_-p*g)-h*(l*_-c*g)+f*(l*p-c*d)),t[5]=i*(d*_-p*g)-h*(r*_-s*g)+f*(r*p-s*d),t[6]=-(i*(l*_-c*g)-o*(r*_-s*g)+f*(r*c-s*l)),t[7]=i*(l*p-c*d)-o*(r*p-s*d)+h*(r*c-s*l),t[8]=o*(u*_-p*m)-h*(a*_-c*m)+f*(a*p-c*u),t[9]=-(i*(u*_-p*m)-h*(n*_-s*m)+f*(n*p-s*u)),t[10]=i*(a*_-c*m)-o*(n*_-s*m)+f*(n*c-s*a),t[11]=-(i*(a*p-c*u)-o*(n*p-s*u)+h*(n*c-s*a)),t[12]=-(o*(u*g-d*m)-h*(a*g-l*m)+f*(a*d-l*u)),t[13]=i*(u*g-d*m)-h*(n*g-r*m)+f*(n*d-r*u),t[14]=-(i*(a*g-l*m)-o*(n*g-r*m)+f*(n*l-r*a)),t[15]=i*(a*d-l*u)-o*(n*d-r*u)+h*(n*l-r*a),t},Dc.determinant=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*o-i*s)*(u*g-d*m)-(e*a-n*s)*(h*g-d*f)+(e*l-r*s)*(h*m-u*f)+(i*a-n*o)*(c*g-d*p)-(i*l-r*o)*(c*m-u*p)+(n*l-r*a)*(c*f-h*p)},Dc.multiply=Fc,Dc.translate=function(t,e,i){var n,r,s,o,a,l,c,h,u,d,p,f,m=i[0],g=i[1],_=i[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*_+e[12],t[13]=e[1]*m+e[5]*g+e[9]*_+e[13],t[14]=e[2]*m+e[6]*g+e[10]*_+e[14],t[15]=e[3]*m+e[7]*g+e[11]*_+e[15]):(r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],f=e[11],t[0]=n=e[0],t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=h,t[8]=u,t[9]=d,t[10]=p,t[11]=f,t[12]=n*m+a*g+u*_+e[12],t[13]=r*m+l*g+d*_+e[13],t[14]=s*m+c*g+p*_+e[14],t[15]=o*m+h*g+f*_+e[15]),t},Dc.scale=function(t,e,i){var n=i[0],r=i[1],s=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},Dc.rotate=function(t,e,i,n){var r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x,w,E,S,T,M,A,C=n[0],k=n[1],P=n[2],I=Math.hypot(C,k,P);return I<Lc.EPSILON?null:(C*=I=1/I,k*=I,P*=I,r=Math.sin(i),s=Math.cos(i),l=e[1],c=e[2],h=e[3],d=e[5],p=e[6],f=e[7],g=e[9],_=e[10],y=e[11],w=C*k*(o=1-s)-P*r,E=k*k*o+s,S=P*k*o+C*r,T=C*P*o+k*r,M=k*P*o-C*r,A=P*P*o+s,t[0]=(a=e[0])*(v=C*C*o+s)+(u=e[4])*(b=k*C*o+P*r)+(m=e[8])*(x=P*C*o-k*r),t[1]=l*v+d*b+g*x,t[2]=c*v+p*b+_*x,t[3]=h*v+f*b+y*x,t[4]=a*w+u*E+m*S,t[5]=l*w+d*E+g*S,t[6]=c*w+p*E+_*S,t[7]=h*w+f*E+y*S,t[8]=a*T+u*M+m*A,t[9]=l*T+d*M+g*A,t[10]=c*T+p*M+_*A,t[11]=h*T+f*M+y*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},Dc.rotateX=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*n,t[5]=o*r+h*n,t[6]=a*r+u*n,t[7]=l*r+d*n,t[8]=c*r-s*n,t[9]=h*r-o*n,t[10]=u*r-a*n,t[11]=d*r-l*n,t},Dc.rotateY=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*n,t[1]=o*r-h*n,t[2]=a*r-u*n,t[3]=l*r-d*n,t[8]=s*n+c*r,t[9]=o*n+h*r,t[10]=a*n+u*r,t[11]=l*n+d*r,t},Dc.rotateZ=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],h=e[5],u=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*n,t[1]=o*r+h*n,t[2]=a*r+u*n,t[3]=l*r+d*n,t[4]=c*r-s*n,t[5]=h*r-o*n,t[6]=u*r-a*n,t[7]=d*r-l*n,t},Dc.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},Dc.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Dc.fromRotation=function(t,e,i){var n,r,s,o=i[0],a=i[1],l=i[2],c=Math.hypot(o,a,l);return c<Lc.EPSILON?null:(o*=c=1/c,a*=c,l*=c,n=Math.sin(e),r=Math.cos(e),t[0]=o*o*(s=1-r)+r,t[1]=a*o*s+l*n,t[2]=l*o*s-a*n,t[3]=0,t[4]=o*a*s-l*n,t[5]=a*a*s+r,t[6]=l*a*s+o*n,t[7]=0,t[8]=o*l*s+a*n,t[9]=a*l*s-o*n,t[10]=l*l*s+r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},Dc.fromXRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=i,t[7]=0,t[8]=0,t[9]=-i,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Dc.fromYRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=i,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Dc.fromZRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=0,t[4]=-i,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Dc.fromRotationTranslation=Bc,Dc.fromQuat2=function(t,e){var i=new Lc.ARRAY_TYPE(3),n=-e[0],r=-e[1],s=-e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=n*n+r*r+s*s+o*o;return u>0?(i[0]=2*(a*o+h*n+l*s-c*r)/u,i[1]=2*(l*o+h*r+c*n-a*s)/u,i[2]=2*(c*o+h*s+a*r-l*n)/u):(i[0]=2*(a*o+h*n+l*s-c*r),i[1]=2*(l*o+h*r+c*n-a*s),i[2]=2*(c*o+h*s+a*r-l*n)),Bc(t,e,i),t},Dc.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},Dc.getScaling=Nc,Dc.getRotation=function(t,e){var i=new Lc.ARRAY_TYPE(3);Nc(i,e);var n=1/i[0],r=1/i[1],s=1/i[2],o=e[0]*n,a=e[1]*r,l=e[2]*s,c=e[4]*n,h=e[5]*r,u=e[6]*s,d=e[8]*n,p=e[9]*r,f=e[10]*s,m=o+h+f,g=0;return m>0?(g=2*Math.sqrt(m+1),t[3]=.25*g,t[0]=(u-p)/g,t[1]=(d-l)/g,t[2]=(a-c)/g):o>h&&o>f?(g=2*Math.sqrt(1+o-h-f),t[3]=(u-p)/g,t[0]=.25*g,t[1]=(a+c)/g,t[2]=(d+l)/g):h>f?(g=2*Math.sqrt(1+h-o-f),t[3]=(d-l)/g,t[0]=(a+c)/g,t[1]=.25*g,t[2]=(u+p)/g):(g=2*Math.sqrt(1+f-o-h),t[3]=(a-c)/g,t[0]=(d+l)/g,t[1]=(u+p)/g,t[2]=.25*g),t},Dc.fromRotationTranslationScale=function(t,e,i,n){var r=e[0],s=e[1],o=e[2],a=e[3],l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,p=r*h,f=s*c,m=s*h,g=o*h,_=a*l,y=a*c,v=a*h,b=n[0],x=n[1],w=n[2];return t[0]=(1-(f+g))*b,t[1]=(d+v)*b,t[2]=(p-y)*b,t[3]=0,t[4]=(d-v)*x,t[5]=(1-(u+g))*x,t[6]=(m+_)*x,t[7]=0,t[8]=(p+y)*w,t[9]=(m-_)*w,t[10]=(1-(u+f))*w,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},Dc.fromRotationTranslationScaleOrigin=function(t,e,i,n,r){var s=e[0],o=e[1],a=e[2],l=e[3],c=s+s,h=o+o,u=a+a,d=s*c,p=s*h,f=s*u,m=o*h,g=o*u,_=a*u,y=l*c,v=l*h,b=l*u,x=n[0],w=n[1],E=n[2],S=r[0],T=r[1],M=r[2],A=(1-(m+_))*x,C=(p+b)*x,k=(f-v)*x,P=(p-b)*w,I=(1-(d+_))*w,D=(g+y)*w,O=(f+v)*E,L=(g-y)*E,z=(1-(d+m))*E;return t[0]=A,t[1]=C,t[2]=k,t[3]=0,t[4]=P,t[5]=I,t[6]=D,t[7]=0,t[8]=O,t[9]=L,t[10]=z,t[11]=0,t[12]=i[0]+S-(A*S+P*T+O*M),t[13]=i[1]+T-(C*S+I*T+L*M),t[14]=i[2]+M-(k*S+D*T+z*M),t[15]=1,t},Dc.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=i+i,a=n+n,l=r+r,c=i*o,h=n*o,u=n*a,d=r*o,p=r*a,f=r*l,m=s*o,g=s*a,_=s*l;return t[0]=1-u-f,t[1]=h+_,t[2]=d-g,t[3]=0,t[4]=h-_,t[5]=1-c-f,t[6]=p+m,t[7]=0,t[8]=d+g,t[9]=p-m,t[10]=1-c-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},Dc.frustum=function(t,e,i,n,r,s,o){var a=1/(i-e),l=1/(r-n),c=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*l,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(r+n)*l,t[10]=(o+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*c,t[15]=0,t},Dc.perspectiveNO=jc,Dc.perspectiveZO=function(t,e,i,n,r){var s,o=1/Math.tan(e/2);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=r*(s=1/(n-r)),t[14]=r*n*s):(t[10]=-1,t[14]=-n),t},Dc.perspectiveFromFieldOfView=function(t,e,i,n){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+a),c=2/(r+s);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-a)*l*.5,t[9]=(r-s)*c*.5,t[10]=n/(i-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*i/(i-n),t[15]=0,t},Dc.orthoNO=Vc,Dc.orthoZO=function(t,e,i,n,r,s,o){var a=1/(e-i),l=1/(n-r),c=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=s*c,t[15]=1,t},Dc.lookAt=function(t,e,i,n){var r,s,o,a,l,c,h,u,d,p,f=e[0],m=e[1],g=e[2],_=n[0],y=n[1],v=n[2],b=i[0],x=i[1],w=i[2];return Math.abs(f-b)<Lc.EPSILON&&Math.abs(m-x)<Lc.EPSILON&&Math.abs(g-w)<Lc.EPSILON?Rc(t):(h=f-b,u=m-x,d=g-w,r=y*(d*=p=1/Math.hypot(h,u,d))-v*(u*=p),s=v*(h*=p)-_*d,o=_*u-y*h,(p=Math.hypot(r,s,o))?(r*=p=1/p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,l=d*r-h*o,c=h*s-u*r,(p=Math.hypot(a,l,c))?(a*=p=1/p,l*=p,c*=p):(a=0,l=0,c=0),t[0]=r,t[1]=a,t[2]=h,t[3]=0,t[4]=s,t[5]=l,t[6]=u,t[7]=0,t[8]=o,t[9]=c,t[10]=d,t[11]=0,t[12]=-(r*f+s*m+o*g),t[13]=-(a*f+l*m+c*g),t[14]=-(h*f+u*m+d*g),t[15]=1,t)},Dc.targetTo=function(t,e,i,n){var r=e[0],s=e[1],o=e[2],a=n[0],l=n[1],c=n[2],h=r-i[0],u=s-i[1],d=o-i[2],p=h*h+u*u+d*d;p>0&&(h*=p=1/Math.sqrt(p),u*=p,d*=p);var f=l*d-c*u,m=c*h-a*d,g=a*u-l*h;return(p=f*f+m*m+g*g)>0&&(f*=p=1/Math.sqrt(p),m*=p,g*=p),t[0]=f,t[1]=m,t[2]=g,t[3]=0,t[4]=u*g-d*m,t[5]=d*f-h*g,t[6]=h*m-u*f,t[7]=0,t[8]=h,t[9]=u,t[10]=d,t[11]=0,t[12]=r,t[13]=s,t[14]=o,t[15]=1,t},Dc.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},Dc.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},Dc.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t},Dc.subtract=Uc,Dc.multiplyScalar=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t},Dc.multiplyScalarAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t[4]=e[4]+i[4]*n,t[5]=e[5]+i[5]*n,t[6]=e[6]+i[6]*n,t[7]=e[7]+i[7]*n,t[8]=e[8]+i[8]*n,t[9]=e[9]+i[9]*n,t[10]=e[10]+i[10]*n,t[11]=e[11]+i[11]*n,t[12]=e[12]+i[12]*n,t[13]=e[13]+i[13]*n,t[14]=e[14]+i[14]*n,t[15]=e[15]+i[15]*n,t},Dc.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},Dc.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],_=t[15],y=e[0],v=e[1],b=e[2],x=e[3],w=e[4],E=e[5],S=e[6],T=e[7],M=e[8],A=e[9],C=e[10],k=e[11],P=e[12],I=e[13],D=e[14],O=e[15];return Math.abs(i-y)<=Lc.EPSILON*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(n-v)<=Lc.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=Lc.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(s-x)<=Lc.EPSILON*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-w)<=Lc.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-E)<=Lc.EPSILON*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(l-S)<=Lc.EPSILON*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-T)<=Lc.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-M)<=Lc.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(u-A)<=Lc.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(d-C)<=Lc.EPSILON*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-k)<=Lc.EPSILON*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(f-P)<=Lc.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-I)<=Lc.EPSILON*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(g-D)<=Lc.EPSILON*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(_-O)<=Lc.EPSILON*Math.max(1,Math.abs(_),Math.abs(O))},Dc.sub=Dc.mul=Dc.ortho=Dc.perspective=void 0;var Lc=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==Oc(t)&&"function"!=typeof t)return{default:t};var i=zc(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function zc(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(zc=function(t){return t?i:e})(t)}function Rc(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Fc(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],_=e[14],y=e[15],v=i[0],b=i[1],x=i[2],w=i[3];return t[0]=v*n+b*a+x*u+w*m,t[1]=v*r+b*l+x*d+w*g,t[2]=v*s+b*c+x*p+w*_,t[3]=v*o+b*h+x*f+w*y,t[4]=(v=i[4])*n+(b=i[5])*a+(x=i[6])*u+(w=i[7])*m,t[5]=v*r+b*l+x*d+w*g,t[6]=v*s+b*c+x*p+w*_,t[7]=v*o+b*h+x*f+w*y,t[8]=(v=i[8])*n+(b=i[9])*a+(x=i[10])*u+(w=i[11])*m,t[9]=v*r+b*l+x*d+w*g,t[10]=v*s+b*c+x*p+w*_,t[11]=v*o+b*h+x*f+w*y,t[12]=(v=i[12])*n+(b=i[13])*a+(x=i[14])*u+(w=i[15])*m,t[13]=v*r+b*l+x*d+w*g,t[14]=v*s+b*c+x*p+w*_,t[15]=v*o+b*h+x*f+w*y,t}function Bc(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=n+n,l=r+r,c=s+s,h=n*a,u=n*l,d=n*c,p=r*l,f=r*c,m=s*c,g=o*a,_=o*l,y=o*c;return t[0]=1-(p+m),t[1]=u+y,t[2]=d-_,t[3]=0,t[4]=u-y,t[5]=1-(h+m),t[6]=f+g,t[7]=0,t[8]=d+_,t[9]=f-g,t[10]=1-(h+p),t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t}function Nc(t,e){var i=e[4],n=e[5],r=e[6],s=e[8],o=e[9],a=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(i,n,r),t[2]=Math.hypot(s,o,a),t}function jc(t,e,i,n,r){var s,o=1/Math.tan(e/2);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+n)*(s=1/(n-r)),t[14]=2*r*n*s):(t[10]=-1,t[14]=-2*n),t}function Vc(t,e,i,n,r,s,o){var a=1/(e-i),l=1/(n-r),c=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(o+s)*c,t[15]=1,t}function Uc(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t}Dc.perspective=jc,Dc.ortho=Vc,Dc.mul=Fc,Dc.sub=Uc;var $c={},Hc={};function qc(t){return qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(t)}Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.create=Zc,Hc.clone=function(t){var e=new Wc.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},Hc.length=Yc,Hc.fromValues=function(t,e,i){var n=new Wc.ARRAY_TYPE(3);return n[0]=t,n[1]=e,n[2]=i,n},Hc.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},Hc.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},Hc.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t},Hc.subtract=Xc,Hc.multiply=Kc,Hc.divide=Qc,Hc.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},Hc.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},Hc.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t},Hc.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t},Hc.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},Hc.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},Hc.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t},Hc.distance=Jc,Hc.squaredDistance=th,Hc.squaredLength=eh,Hc.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},Hc.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},Hc.normalize=function(t,e){var i=e[0],n=e[1],r=e[2],s=i*i+n*n+r*r;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t},Hc.dot=ih,Hc.cross=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=i[0],a=i[1],l=i[2];return t[0]=r*l-s*a,t[1]=s*o-n*l,t[2]=n*a-r*o,t},Hc.lerp=function(t,e,i,n){var r=e[0],s=e[1],o=e[2];return t[0]=r+n*(i[0]-r),t[1]=s+n*(i[1]-s),t[2]=o+n*(i[2]-o),t},Hc.hermite=function(t,e,i,n,r,s){var o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,c=o*(s-1),h=o*(3-2*s);return t[0]=e[0]*a+i[0]*l+n[0]*c+r[0]*h,t[1]=e[1]*a+i[1]*l+n[1]*c+r[1]*h,t[2]=e[2]*a+i[2]*l+n[2]*c+r[2]*h,t},Hc.bezier=function(t,e,i,n,r,s){var o=1-s,a=o*o,l=s*s,c=a*o,h=3*s*a,u=3*l*o,d=l*s;return t[0]=e[0]*c+i[0]*h+n[0]*u+r[0]*d,t[1]=e[1]*c+i[1]*h+n[1]*u+r[1]*d,t[2]=e[2]*c+i[2]*h+n[2]*u+r[2]*d,t},Hc.random=function(t,e){e=e||1;var i=2*Wc.RANDOM()*Math.PI,n=2*Wc.RANDOM()-1,r=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(i)*r,t[1]=Math.sin(i)*r,t[2]=n*e,t},Hc.transformMat4=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=i[3]*n+i[7]*r+i[11]*s+i[15];return t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/(o=o||1),t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,t},Hc.transformMat3=function(t,e,i){var n=e[0],r=e[1],s=e[2];return t[0]=n*i[0]+r*i[3]+s*i[6],t[1]=n*i[1]+r*i[4]+s*i[7],t[2]=n*i[2]+r*i[5]+s*i[8],t},Hc.transformQuat=function(t,e,i){var n=i[0],r=i[1],s=i[2],o=e[0],a=e[1],l=e[2],c=r*l-s*a,h=s*o-n*l,u=n*a-r*o,d=r*u-s*h,p=s*c-n*u,f=n*h-r*c,m=2*i[3];return h*=m,u*=m,p*=2,f*=2,t[0]=o+(c*=m)+(d*=2),t[1]=a+h+p,t[2]=l+u+f,t},Hc.rotateX=function(t,e,i,n){var r=[],s=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],s[0]=r[0],s[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),s[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t},Hc.rotateY=function(t,e,i,n){var r=[],s=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],s[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),s[1]=r[1],s[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t},Hc.rotateZ=function(t,e,i,n){var r=[],s=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],s[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),s[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),s[2]=r[2],t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t},Hc.angle=function(t,e){var i=t[0],n=t[1],r=t[2],s=e[0],o=e[1],a=e[2],l=Math.sqrt(i*i+n*n+r*r)*Math.sqrt(s*s+o*o+a*a),c=l&&ih(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))},Hc.zero=function(t){return t[0]=0,t[1]=0,t[2]=0,t},Hc.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},Hc.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},Hc.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=e[0],o=e[1],a=e[2];return Math.abs(i-s)<=Wc.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-o)<=Wc.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Wc.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))},Hc.forEach=Hc.sqrLen=Hc.len=Hc.sqrDist=Hc.dist=Hc.div=Hc.mul=Hc.sub=void 0;var Wc=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==qc(t)&&"function"!=typeof t)return{default:t};var i=Gc(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function Gc(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(Gc=function(t){return t?i:e})(t)}function Zc(){var t=new Wc.ARRAY_TYPE(3);return Wc.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Yc(t){return Math.hypot(t[0],t[1],t[2])}function Xc(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Kc(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function Qc(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}function Jc(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])}function th(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return i*i+n*n+r*r}function eh(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n}function ih(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}Hc.sub=Xc,Hc.mul=Kc,Hc.div=Qc,Hc.dist=Jc,Hc.sqrDist=th,Hc.len=Yc,Hc.sqrLen=eh;var nh,rh=(nh=Zc(),function(t,e,i,n,r,s){var o,a;for(e||(e=3),i||(i=0),a=n?Math.min(n*e+i,t.length):t.length,o=i;o<a;o+=e)nh[0]=t[o],nh[1]=t[o+1],nh[2]=t[o+2],r(nh,nh,s),t[o]=nh[0],t[o+1]=nh[1],t[o+2]=nh[2];return t});Hc.forEach=rh;var sh={};function oh(t){return oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(t)}Object.defineProperty(sh,"__esModule",{value:!0}),sh.create=ch,sh.clone=function(t){var e=new ah.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},sh.fromValues=function(t,e,i,n){var r=new ah.ARRAY_TYPE(4);return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r},sh.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},sh.set=function(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t},sh.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t},sh.subtract=hh,sh.multiply=uh,sh.divide=dh,sh.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},sh.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},sh.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t},sh.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t},sh.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},sh.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},sh.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t},sh.distance=ph,sh.squaredDistance=fh,sh.length=mh,sh.squaredLength=gh,sh.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},sh.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},sh.normalize=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=i*i+n*n+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=i*o,t[1]=n*o,t[2]=r*o,t[3]=s*o,t},sh.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},sh.cross=function(t,e,i,n){var r=i[0]*n[1]-i[1]*n[0],s=i[0]*n[2]-i[2]*n[0],o=i[0]*n[3]-i[3]*n[0],a=i[1]*n[2]-i[2]*n[1],l=i[1]*n[3]-i[3]*n[1],c=i[2]*n[3]-i[3]*n[2],h=e[0],u=e[1],d=e[2],p=e[3];return t[0]=u*c-d*l+p*a,t[1]=-h*c+d*o-p*s,t[2]=h*l-u*o+p*r,t[3]=-h*a+u*s-d*r,t},sh.lerp=function(t,e,i,n){var r=e[0],s=e[1],o=e[2],a=e[3];return t[0]=r+n*(i[0]-r),t[1]=s+n*(i[1]-s),t[2]=o+n*(i[2]-o),t[3]=a+n*(i[3]-a),t},sh.random=function(t,e){var i,n,r,s,o,a;e=e||1;do{o=(i=2*ah.RANDOM()-1)*i+(n=2*ah.RANDOM()-1)*n}while(o>=1);do{a=(r=2*ah.RANDOM()-1)*r+(s=2*ah.RANDOM()-1)*s}while(a>=1);var l=Math.sqrt((1-o)/a);return t[0]=e*i,t[1]=e*n,t[2]=e*r*l,t[3]=e*s*l,t},sh.transformMat4=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*s+i[12]*o,t[1]=i[1]*n+i[5]*r+i[9]*s+i[13]*o,t[2]=i[2]*n+i[6]*r+i[10]*s+i[14]*o,t[3]=i[3]*n+i[7]*r+i[11]*s+i[15]*o,t},sh.transformQuat=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=i[0],a=i[1],l=i[2],c=i[3],h=c*n+a*s-l*r,u=c*r+l*n-o*s,d=c*s+o*r-a*n,p=-o*n-a*r-l*s;return t[0]=h*c+p*-o+u*-l-d*-a,t[1]=u*c+p*-a+d*-o-h*-l,t[2]=d*c+p*-l+h*-a-u*-o,t[3]=e[3],t},sh.zero=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},sh.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},sh.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},sh.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1],l=e[2],c=e[3];return Math.abs(i-o)<=ah.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-a)<=ah.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-l)<=ah.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-c)<=ah.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))},sh.forEach=sh.sqrLen=sh.len=sh.sqrDist=sh.dist=sh.div=sh.mul=sh.sub=void 0;var ah=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==oh(t)&&"function"!=typeof t)return{default:t};var i=lh(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function lh(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(lh=function(t){return t?i:e})(t)}function ch(){var t=new ah.ARRAY_TYPE(4);return ah.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function hh(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function uh(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}function dh(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t}function ph(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3])}function fh(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return i*i+n*n+r*r+s*s}function mh(t){return Math.hypot(t[0],t[1],t[2],t[3])}function gh(t){var e=t[0],i=t[1],n=t[2],r=t[3];return e*e+i*i+n*n+r*r}sh.sub=hh,sh.mul=uh,sh.div=dh,sh.dist=ph,sh.sqrDist=fh,sh.len=mh,sh.sqrLen=gh;var _h=function(){var t=ch();return function(e,i,n,r,s,o){var a,l;for(i||(i=4),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,a=n;a<l;a+=i)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],s(t,t,o),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();function yh(t){return yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yh(t)}sh.forEach=_h,Object.defineProperty($c,"__esModule",{value:!0}),$c.create=Th,$c.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},$c.setAxisAngle=Mh,$c.getAxisAngle=function(t,e){var i=2*Math.acos(e[3]),n=Math.sin(i/2);return n>vh.EPSILON?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),i},$c.getAngle=function(t,e){var i=Oh(t,e);return Math.acos(2*i*i-1)},$c.multiply=Ah,$c.rotateX=function(t,e,i){i*=.5;var n=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+o*a,t[1]=r*l+s*a,t[2]=s*l-r*a,t[3]=o*l-n*a,t},$c.rotateY=function(t,e,i){i*=.5;var n=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l-s*a,t[1]=r*l+o*a,t[2]=s*l+n*a,t[3]=o*l-r*a,t},$c.rotateZ=function(t,e,i){i*=.5;var n=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+r*a,t[1]=r*l-n*a,t[2]=s*l+o*a,t[3]=o*l-s*a,t},$c.calculateW=function(t,e){var i=e[0],n=e[1],r=e[2];return t[0]=i,t[1]=n,t[2]=r,t[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),t},$c.exp=Ch,$c.ln=kh,$c.pow=function(t,e,i){return kh(t,e),Dh(t,t,i),Ch(t,t),t},$c.slerp=Ph,$c.random=function(t){var e=vh.RANDOM(),i=vh.RANDOM(),n=vh.RANDOM(),r=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=r*Math.sin(2*Math.PI*i),t[1]=r*Math.cos(2*Math.PI*i),t[2]=s*Math.sin(2*Math.PI*n),t[3]=s*Math.cos(2*Math.PI*n),t},$c.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=i*i+n*n+r*r+s*s,a=o?1/o:0;return t[0]=-i*a,t[1]=-n*a,t[2]=-r*a,t[3]=s*a,t},$c.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},$c.fromMat3=Ih,$c.fromEuler=function(t,e,i,n){var r=.5*Math.PI/180;e*=r,i*=r,n*=r;var s=Math.sin(e),o=Math.cos(e),a=Math.sin(i),l=Math.cos(i),c=Math.sin(n),h=Math.cos(n);return t[0]=s*l*h-o*a*c,t[1]=o*a*h+s*l*c,t[2]=o*l*c-s*a*h,t[3]=o*l*h+s*a*c,t},$c.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},$c.setAxes=$c.sqlerp=$c.rotationTo=$c.equals=$c.exactEquals=$c.normalize=$c.sqrLen=$c.squaredLength=$c.len=$c.length=$c.lerp=$c.dot=$c.scale=$c.mul=$c.add=$c.set=$c.copy=$c.fromValues=$c.clone=void 0;var vh=Sh(cc),bh=Sh(Mc),xh=Sh(Hc),wh=Sh(sh);function Eh(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(Eh=function(t){return t?i:e})(t)}function Sh(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==yh(t)&&"function"!=typeof t)return{default:t};var i=Eh(e);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}function Th(){var t=new vh.ARRAY_TYPE(4);return vh.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Mh(t,e,i){i*=.5;var n=Math.sin(i);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(i),t}function Ah(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=i[0],l=i[1],c=i[2],h=i[3];return t[0]=n*h+o*a+r*c-s*l,t[1]=r*h+o*l+s*a-n*c,t[2]=s*h+o*c+n*l-r*a,t[3]=o*h-n*a-r*l-s*c,t}function Ch(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=Math.sqrt(i*i+n*n+r*r),a=Math.exp(s),l=o>0?a*Math.sin(o)/o:0;return t[0]=i*l,t[1]=n*l,t[2]=r*l,t[3]=a*Math.cos(o),t}function kh(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],o=Math.sqrt(i*i+n*n+r*r),a=o>0?Math.atan2(o,s)/o:0;return t[0]=i*a,t[1]=n*a,t[2]=r*a,t[3]=.5*Math.log(i*i+n*n+r*r+s*s),t}function Ph(t,e,i,n){var r,s,o,a,l,c=e[0],h=e[1],u=e[2],d=e[3],p=i[0],f=i[1],m=i[2],g=i[3];return(s=c*p+h*f+u*m+d*g)<0&&(s=-s,p=-p,f=-f,m=-m,g=-g),1-s>vh.EPSILON?(r=Math.acos(s),o=Math.sin(r),a=Math.sin((1-n)*r)/o,l=Math.sin(n*r)/o):(a=1-n,l=n),t[0]=a*c+l*p,t[1]=a*h+l*f,t[2]=a*u+l*m,t[3]=a*d+l*g,t}function Ih(t,e){var i,n=e[0]+e[4]+e[8];if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,t[0]=(e[5]-e[7])*(i=.5/i),t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),t[r]=.5*i,t[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),t[s]=(e[3*s+r]+e[3*r+s])*i,t[o]=(e[3*o+r]+e[3*r+o])*i}return t}$c.clone=wh.clone,$c.fromValues=wh.fromValues,$c.copy=wh.copy,$c.set=wh.set,$c.add=wh.add,$c.mul=Ah;var Dh=wh.scale;$c.scale=Dh;var Oh=wh.dot;$c.dot=Oh,$c.lerp=wh.lerp;var Lh=wh.length;$c.length=Lh,$c.len=Lh;var zh=wh.squaredLength;$c.squaredLength=zh,$c.sqrLen=zh;var Rh=wh.normalize;$c.normalize=Rh,$c.exactEquals=wh.exactEquals,$c.equals=wh.equals;var Fh,Bh,Nh,jh=(Fh=xh.create(),Bh=xh.fromValues(1,0,0),Nh=xh.fromValues(0,1,0),function(t,e,i){var n=xh.dot(e,i);return n<-.999999?(xh.cross(Fh,Bh,e),xh.len(Fh)<1e-6&&xh.cross(Fh,Nh,e),xh.normalize(Fh,Fh),Mh(t,Fh,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(xh.cross(Fh,e,i),t[0]=Fh[0],t[1]=Fh[1],t[2]=Fh[2],t[3]=1+n,Rh(t,t))});$c.rotationTo=jh;var Vh,Uh,$h=(Vh=Th(),Uh=Th(),function(t,e,i,n,r,s){return Ph(Vh,e,r,s),Ph(Uh,i,n,s),Ph(t,Vh,Uh,2*s*(1-s)),t});$c.sqlerp=$h;var Hh,qh=(Hh=bh.create(),function(t,e,i,n){return Hh[0]=i[0],Hh[3]=i[1],Hh[6]=i[2],Hh[1]=n[0],Hh[4]=n[1],Hh[7]=n[2],Hh[2]=-e[0],Hh[5]=-e[1],Hh[8]=-e[2],Rh(t,Ih(t,Hh))});$c.setAxes=qh;var Wh={};function Gh(t){return Gh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gh(t)}Object.defineProperty(Wh,"__esModule",{value:!0}),Wh.create=function(){var t=new Zh.ARRAY_TYPE(8);return Zh.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t},Wh.clone=function(t){var e=new Zh.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e},Wh.fromValues=function(t,e,i,n,r,s,o,a){var l=new Zh.ARRAY_TYPE(8);return l[0]=t,l[1]=e,l[2]=i,l[3]=n,l[4]=r,l[5]=s,l[6]=o,l[7]=a,l},Wh.fromRotationTranslationValues=function(t,e,i,n,r,s,o){var a=new Zh.ARRAY_TYPE(8);a[0]=t,a[1]=e,a[2]=i,a[3]=n;var l=.5*r,c=.5*s,h=.5*o;return a[4]=l*n+c*i-h*e,a[5]=c*n+h*t-l*i,a[6]=h*n+l*e-c*t,a[7]=-l*t-c*e-h*i,a},Wh.fromRotationTranslation=Jh,Wh.fromTranslation=function(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t},Wh.fromRotation=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},Wh.fromMat4=function(t,e){var i=Yh.create();Xh.getRotation(i,e);var n=new Zh.ARRAY_TYPE(3);return Xh.getTranslation(n,e),Jh(t,i,n),t},Wh.copy=tu,Wh.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},Wh.set=function(t,e,i,n,r,s,o,a,l){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t},Wh.getDual=function(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t},Wh.setDual=function(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t},Wh.getTranslation=function(t,e){var i=e[4],n=e[5],r=e[6],s=e[7],o=-e[0],a=-e[1],l=-e[2],c=e[3];return t[0]=2*(i*c+s*o+n*l-r*a),t[1]=2*(n*c+s*a+r*o-i*l),t[2]=2*(r*c+s*l+i*a-n*o),t},Wh.translate=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=.5*i[0],l=.5*i[1],c=.5*i[2],h=e[4],u=e[5],d=e[6],p=e[7];return t[0]=n,t[1]=r,t[2]=s,t[3]=o,t[4]=o*a+r*c-s*l+h,t[5]=o*l+s*a-n*c+u,t[6]=o*c+n*l-r*a+d,t[7]=-n*a-r*l-s*c+p,t},Wh.rotateX=function(t,e,i){var n=-e[0],r=-e[1],s=-e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=a*o+h*n+l*s-c*r,d=l*o+h*r+c*n-a*s,p=c*o+h*s+a*r-l*n,f=h*o-a*n-l*r-c*s;return Yh.rotateX(t,e,i),t[4]=u*(o=t[3])+f*(n=t[0])+d*(s=t[2])-p*(r=t[1]),t[5]=d*o+f*r+p*n-u*s,t[6]=p*o+f*s+u*r-d*n,t[7]=f*o-u*n-d*r-p*s,t},Wh.rotateY=function(t,e,i){var n=-e[0],r=-e[1],s=-e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=a*o+h*n+l*s-c*r,d=l*o+h*r+c*n-a*s,p=c*o+h*s+a*r-l*n,f=h*o-a*n-l*r-c*s;return Yh.rotateY(t,e,i),t[4]=u*(o=t[3])+f*(n=t[0])+d*(s=t[2])-p*(r=t[1]),t[5]=d*o+f*r+p*n-u*s,t[6]=p*o+f*s+u*r-d*n,t[7]=f*o-u*n-d*r-p*s,t},Wh.rotateZ=function(t,e,i){var n=-e[0],r=-e[1],s=-e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],u=a*o+h*n+l*s-c*r,d=l*o+h*r+c*n-a*s,p=c*o+h*s+a*r-l*n,f=h*o-a*n-l*r-c*s;return Yh.rotateZ(t,e,i),t[4]=u*(o=t[3])+f*(n=t[0])+d*(s=t[2])-p*(r=t[1]),t[5]=d*o+f*r+p*n-u*s,t[6]=p*o+f*s+u*r-d*n,t[7]=f*o-u*n-d*r-p*s,t},Wh.rotateByQuatAppend=function(t,e,i){var n=i[0],r=i[1],s=i[2],o=i[3],a=e[0],l=e[1],c=e[2],h=e[3];return t[0]=a*o+h*n+l*s-c*r,t[1]=l*o+h*r+c*n-a*s,t[2]=c*o+h*s+a*r-l*n,t[3]=h*o-a*n-l*r-c*s,t[4]=(a=e[4])*o+(h=e[7])*n+(l=e[5])*s-(c=e[6])*r,t[5]=l*o+h*r+c*n-a*s,t[6]=c*o+h*s+a*r-l*n,t[7]=h*o-a*n-l*r-c*s,t},Wh.rotateByQuatPrepend=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=i[0],l=i[1],c=i[2],h=i[3];return t[0]=n*h+o*a+r*c-s*l,t[1]=r*h+o*l+s*a-n*c,t[2]=s*h+o*c+n*l-r*a,t[3]=o*h-n*a-r*l-s*c,t[4]=n*(h=i[7])+o*(a=i[4])+r*(c=i[6])-s*(l=i[5]),t[5]=r*h+o*l+s*a-n*c,t[6]=s*h+o*c+n*l-r*a,t[7]=o*h-n*a-r*l-s*c,t},Wh.rotateAroundAxis=function(t,e,i,n){if(Math.abs(n)<Zh.EPSILON)return tu(t,e);var r=Math.hypot(i[0],i[1],i[2]);n*=.5;var s=Math.sin(n),o=s*i[0]/r,a=s*i[1]/r,l=s*i[2]/r,c=Math.cos(n),h=e[0],u=e[1],d=e[2],p=e[3];t[0]=h*c+p*o+u*l-d*a,t[1]=u*c+p*a+d*o-h*l,t[2]=d*c+p*l+h*a-u*o,t[3]=p*c-h*o-u*a-d*l;var f=e[4],m=e[5],g=e[6],_=e[7];return t[4]=f*c+_*o+m*l-g*a,t[5]=m*c+_*a+g*o-f*l,t[6]=g*c+_*l+f*a-m*o,t[7]=_*c-f*o-m*a-g*l,t},Wh.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t},Wh.multiply=eu,Wh.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t},Wh.lerp=function(t,e,i,n){var r=1-n;return iu(e,i)<0&&(n=-n),t[0]=e[0]*r+i[0]*n,t[1]=e[1]*r+i[1]*n,t[2]=e[2]*r+i[2]*n,t[3]=e[3]*r+i[3]*n,t[4]=e[4]*r+i[4]*n,t[5]=e[5]*r+i[5]*n,t[6]=e[6]*r+i[6]*n,t[7]=e[7]*r+i[7]*n,t},Wh.invert=function(t,e){var i=ru(e);return t[0]=-e[0]/i,t[1]=-e[1]/i,t[2]=-e[2]/i,t[3]=e[3]/i,t[4]=-e[4]/i,t[5]=-e[5]/i,t[6]=-e[6]/i,t[7]=e[7]/i,t},Wh.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=e[7],t},Wh.normalize=function(t,e){var i=ru(e);if(i>0){i=Math.sqrt(i);var n=e[0]/i,r=e[1]/i,s=e[2]/i,o=e[3]/i,a=e[4],l=e[5],c=e[6],h=e[7],u=n*a+r*l+s*c+o*h;t[0]=n,t[1]=r,t[2]=s,t[3]=o,t[4]=(a-n*u)/i,t[5]=(l-r*u)/i,t[6]=(c-s*u)/i,t[7]=(h-o*u)/i}return t},Wh.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},Wh.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},Wh.equals=function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=e[0],u=e[1],d=e[2],p=e[3],f=e[4],m=e[5],g=e[6],_=e[7];return Math.abs(i-h)<=Zh.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(n-u)<=Zh.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(r-d)<=Zh.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-p)<=Zh.EPSILON*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-f)<=Zh.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-m)<=Zh.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-g)<=Zh.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=Zh.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))},Wh.sqrLen=Wh.squaredLength=Wh.len=Wh.length=Wh.dot=Wh.mul=Wh.setReal=Wh.getReal=void 0;var Zh=Qh(cc),Yh=Qh($c),Xh=Qh(Dc);function Kh(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(Kh=function(t){return t?i:e})(t)}function Qh(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==Gh(t)&&"function"!=typeof t)return{default:t};var i=Kh(e);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}function Jh(t,e,i){var n=.5*i[0],r=.5*i[1],s=.5*i[2],o=e[0],a=e[1],l=e[2],c=e[3];return t[0]=o,t[1]=a,t[2]=l,t[3]=c,t[4]=n*c+r*l-s*a,t[5]=r*c+s*o-n*l,t[6]=s*c+n*a-r*o,t[7]=-n*o-r*a-s*l,t}function tu(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function eu(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3],a=i[4],l=i[5],c=i[6],h=i[7],u=e[4],d=e[5],p=e[6],f=e[7],m=i[0],g=i[1],_=i[2],y=i[3];return t[0]=n*y+o*m+r*_-s*g,t[1]=r*y+o*g+s*m-n*_,t[2]=s*y+o*_+n*g-r*m,t[3]=o*y-n*m-r*g-s*_,t[4]=n*h+o*a+r*c-s*l+u*y+f*m+d*_-p*g,t[5]=r*h+o*l+s*a-n*c+d*y+f*g+p*m-u*_,t[6]=s*h+o*c+n*l-r*a+p*y+f*_+u*g-d*m,t[7]=o*h-n*a-r*l-s*c+f*y-u*m-d*g-p*_,t}Wh.getReal=Yh.copy,Wh.setReal=Yh.copy,Wh.mul=eu;var iu=Yh.dot;Wh.dot=iu;var nu=Yh.length;Wh.length=nu,Wh.len=nu;var ru=Yh.squaredLength;Wh.squaredLength=ru,Wh.sqrLen=ru;var su={};function ou(t){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(t)}Object.defineProperty(su,"__esModule",{value:!0}),su.create=cu,su.clone=function(t){var e=new au.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},su.fromValues=function(t,e){var i=new au.ARRAY_TYPE(2);return i[0]=t,i[1]=e,i},su.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},su.set=function(t,e,i){return t[0]=e,t[1]=i,t},su.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},su.subtract=hu,su.multiply=uu,su.divide=du,su.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},su.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},su.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},su.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},su.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},su.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},su.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t},su.distance=pu,su.squaredDistance=fu,su.length=mu,su.squaredLength=gu,su.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},su.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},su.normalize=function(t,e){var i=e[0],n=e[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t},su.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},su.cross=function(t,e,i){var n=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=n,t},su.lerp=function(t,e,i,n){var r=e[0],s=e[1];return t[0]=r+n*(i[0]-r),t[1]=s+n*(i[1]-s),t},su.random=function(t,e){e=e||1;var i=2*au.RANDOM()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t},su.transformMat2=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t},su.transformMat2d=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t},su.transformMat3=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[3]*r+i[6],t[1]=i[1]*n+i[4]*r+i[7],t},su.transformMat4=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t},su.rotate=function(t,e,i,n){var r=e[0]-i[0],s=e[1]-i[1],o=Math.sin(n),a=Math.cos(n);return t[0]=r*a-s*o+i[0],t[1]=r*o+s*a+i[1],t},su.angle=function(t,e){var i=t[0],n=t[1],r=e[0],s=e[1],o=Math.sqrt(i*i+n*n)*Math.sqrt(r*r+s*s);return Math.acos(Math.min(Math.max(o&&(i*r+n*s)/o,-1),1))},su.zero=function(t){return t[0]=0,t[1]=0,t},su.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},su.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},su.equals=function(t,e){var i=t[0],n=t[1],r=e[0],s=e[1];return Math.abs(i-r)<=au.EPSILON*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(n-s)<=au.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))},su.forEach=su.sqrLen=su.sqrDist=su.dist=su.div=su.mul=su.sub=su.len=void 0;var au=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==ou(t)&&"function"!=typeof t)return{default:t};var i=lu(void 0);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}(cc);function lu(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(lu=function(t){return t?i:e})(t)}function cu(){var t=new au.ARRAY_TYPE(2);return au.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function hu(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function uu(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}function du(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}function pu(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}function fu(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function mu(t){return Math.hypot(t[0],t[1])}function gu(t){var e=t[0],i=t[1];return e*e+i*i}su.len=mu,su.sub=hu,su.mul=uu,su.div=du,su.dist=pu,su.sqrDist=fu,su.sqrLen=gu;var _u=function(){var t=cu();return function(e,i,n,r,s,o){var a,l;for(i||(i=2),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,a=n;a<l;a+=i)t[0]=e[a],t[1]=e[a+1],s(t,t,o),e[a]=t[0],e[a+1]=t[1];return e}}();function yu(t){return yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(t)}su.forEach=_u,Object.defineProperty(lc,"__esModule",{value:!0});var vu=lc.vec4=Ou=lc.vec3=lc.vec2=lc.quat2=ku=lc.quat=Au=lc.mat4=Tu=lc.mat3=lc.mat2d=wu=lc.mat2=lc.glMatrix=void 0,bu=Ru(cc);lc.glMatrix=bu;var xu=Ru(fc),wu=lc.mat2=xu,Eu=Ru(bc);lc.mat2d=Eu;var Su=Ru(Mc),Tu=lc.mat3=Su,Mu=Ru(Dc),Au=lc.mat4=Mu,Cu=Ru($c),ku=lc.quat=Cu,Pu=Ru(Wh);lc.quat2=Pu;var Iu=Ru(su);lc.vec2=Iu;var Du=Ru(Hc),Ou=lc.vec3=Du,Lu=Ru(sh);function zu(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(zu=function(t){return t?i:e})(t)}function Ru(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==yu(t)&&"function"!=typeof t)return{default:t};var i=zu(e);if(i&&i.has(t))return i.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var o=r?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,i&&i.set(t,n),n}vu=lc.vec4=Lu;const Fu=ka([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Bu}=Fu,Nu=ka([{name:"a_pos_3",components:3,type:"Int16"}]);var ju=ka([{name:"a_pos",type:"Int16",components:2}]),Vu={};!function(t,e){!function(t){function e(t,e,n){var r=i(256*t,256*(e=Math.pow(2,n)-e-1),n),s=i(256*(t+1),256*(e+1),n);return r[0]+","+r[1]+","+s[0]+","+s[1]}function i(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=function(t,i,n,r,s,o){return o=o||{},t+"?"+["bbox="+e(n,r,s),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+i].join("&")},t.getTileBBox=e,t.getMercCoords=i,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,Vu);var Uu=Vu;class $u{constructor(t,e,i){this.z=t,this.x=e,this.y=i,this.key=Wu(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e){const i=Uu.getTileBBox(this.x,this.y,this.z),n=function(t,e,i){let n,r="";for(let s=t;s>0;s--)n=1<<s-1,r+=(e&n?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Hu{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Wu(t,e.z,e.z,e.x,e.y)}}class qu{constructor(t,e,i,n,r){this.overscaledZ=t,this.wrap=e,this.canonical=new $u(i,+n,+r),this.key=0===e&&t===i?this.canonical.key:Wu(e,t,i,n,r)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){const e=this.canonical.z-t;return t>this.canonical.z?new qu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e=!0){if(this.overscaledZ===t&&e)return this.key;if(t>this.canonical.z)return Wu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-t;return Wu(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.z<this.canonical.z&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new qu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new qu(e,this.wrap,e,i,n),new qu(e,this.wrap,e,i+1,n),new qu(e,this.wrap,e,i,n+1),new qu(e,this.wrap,e,i+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new qu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new qu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Hu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function Wu(t,e,i,n,r){const s=1<<Math.min(i,22);let o=s*(r%s)+n%s;return t&&i<22&&(o+=s*s*((t<0?-2*t-1:2*t)%(1<<2*(22-i)))),16*(32*o+i)+(e-i)}const Gu=[t=>{let e=t.canonical.x-1,i=t.wrap;return e<0&&(e=(1<<t.canonical.z)-1,i--),new qu(t.overscaledZ,i,t.canonical.z,e,t.canonical.y)},t=>{let e=t.canonical.x+1,i=t.wrap;return e===1<<t.canonical.z&&(e=0,i++),new qu(t.overscaledZ,i,t.canonical.z,e,t.canonical.y)},t=>new qu(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,(0===t.canonical.y?1<<t.canonical.z:t.canonical.y)-1),t=>new qu(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y===(1<<t.canonical.z)-1?0:t.canonical.y+1)];Lo($u,"CanonicalTileID"),Lo(qu,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});class Zu{constructor(t,e){this.pos=t,this.dir=e}intersectsPlane(t,e,i){const n=Ou.dot(e,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((t[0]-this.pos[0])*e[0]+(t[1]-this.pos[1])*e[1]+(t[2]-this.pos[2])*e[2])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,i[2]=this.pos[2]+this.dir[2]*r,!0}closestPointOnSphere(t,e,i){if(Ou.equals(this.pos,t)||0===e)return i[0]=i[1]=i[2]=0,!1;const[n,r,s]=this.dir,o=this.pos[0]-t[0],a=this.pos[1]-t[1],l=this.pos[2]-t[2],c=n*n+r*r+s*s,h=2*(o*n+a*r+l*s),u=h*h-4*c*(o*o+a*a+l*l-e*e);if(u<0){const t=Math.max(-h/2,0),c=o+n*t,u=a+r*t,d=l+s*t,p=Math.hypot(c,u,d);return i[0]=c*e/p,i[1]=u*e/p,i[2]=d*e/p,!1}{const t=(-h-Math.sqrt(u))/(2*c);if(t<0){const t=Math.hypot(o,a,l);return i[0]=o*e/t,i[1]=a*e/t,i[2]=l*e/t,!1}return i[0]=o+n*t,i[1]=a+r*t,i[2]=l+s*t,!0}}}class Yu{constructor(t,e,i,n,r){this.TL=t,this.TR=e,this.BR=i,this.BL=n,this.horizon=r}static fromInvProjectionMatrix(t,e,i){const n=[-1,1,1],r=[1,1,1],s=[1,-1,1],o=[-1,-1,1],a=Ou.transformMat4(n,n,t),l=Ou.transformMat4(r,r,t),c=Ou.transformMat4(s,s,t),h=Ou.transformMat4(o,o,t);return new Yu(a,l,c,h,e/i)}}function Xu(t,e,i){let n=1/0,r=-1/0;const s=[];for(const o of t){Ou.sub(s,o,e);const t=Ou.dot(s,i);n=Math.min(n,t),r=Math.max(r,t)}return[n,r]}function Ku(t,e){let i=!0;for(let n=0;n<t.planes.length;n++){const r=t.planes[n];let s=0;for(let t=0;t<e.length;t++)s+=Ou.dot(r,e[t])+r[3]>=0;if(0===s)return 0;s!==e.length&&(i=!1)}return i?2:1}function Qu(t,e){for(const i of t.projections){const n=Xu(e,t.points[0],i.axis);if(i.projection[1]<n[0]||i.projection[0]>n[1])return 0}return 1}function Ju(t,e){let i=0;const n=[0,0,0,0];for(let r=0;r<t.length;r++)n[0]=t[r][0],n[1]=t[r][1],n[2]=t[r][2],n[3]=1,vu.dot(n,e)>=0&&i++;return i}class td{constructor(t,e){this.points=t||new Array(8).fill([0,0,0]),this.planes=e||new Array(6).fill([0,0,0,0]),this.bounds=ed.fromPoints(this.points),this.projections=[],this.frustumEdges=[Ou.sub([],this.points[2],this.points[3]),Ou.sub([],this.points[0],this.points[3]),Ou.sub([],this.points[4],this.points[0]),Ou.sub([],this.points[5],this.points[1]),Ou.sub([],this.points[6],this.points[2]),Ou.sub([],this.points[7],this.points[3])];for(const t of this.frustumEdges){const e=[0,-t[2],t[1]],i=[t[2],0,-t[0]];this.projections.push({axis:e,projection:Xu(this.points,this.points[0],e)}),this.projections.push({axis:i,projection:Xu(this.points,this.points[0],i)})}}static fromInvProjectionMatrix(t,e,i,n){const r=Math.pow(2,i),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((i=>{const s=vu.transformMat4([],i,t),o=1/s[3]/e*r;return vu.mul(s,s,[o,o,n?1/s[3]:o,o])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=Ou.sub([],s[t[0]],s[t[1]]),i=Ou.sub([],s[t[2]],s[t[1]]),n=Ou.normalize([],Ou.cross([],e,i)),r=-Ou.dot(n,s[t[1]]);return n.concat(r)})),a=[];for(let t=0;t<s.length;t++)a.push([s[t][0],s[t][1],s[t][2]]);return new td(a,o)}intersectsPrecise(t,e,i){for(let i=0;i<e.length;i++)if(!Ju(t,e[i]))return 0;for(let e=0;e<this.planes.length;e++)if(!Ju(t,this.planes[e]))return 0;for(const e of i)for(const i of this.frustumEdges){const n=Ou.cross([],e,i),r=Ou.length(n);if(0===r)continue;Ou.scale(n,n,1/r);const s=Xu(this.points,this.points[0],n),o=Xu(t,this.points[0],n);if(s[0]>o[1]||o[0]>s[1])return 0}return 1}}class ed{static fromPoints(t){const e=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of t)Ou.min(e,e,n),Ou.max(i,i,n);return new ed(e,i)}static fromTileIdAndHeight(t,e,i){const n=1<<t.canonical.z,r=t.canonical.x,s=t.canonical.y;return new ed([r/n,s/n,e],[(r+1)/n,(s+1)/n,i])}static applyTransform(t,e){const i=t.getCorners();for(let t=0;t<i.length;++t)Ou.transformMat4(i[t],i[t],e);return ed.fromPoints(i)}static projectAabbCorners(t,e){const i=t.getCorners();for(let t=0;t<i.length;++t)Ou.transformMat4(i[t],i[t],e);return i}constructor(t,e){this.min=t,this.max=e,this.center=Ou.scale([],Ou.add([],this.min,this.max),.5)}quadrant(t){const e=[t%2==0,t<2],i=Ou.clone(this.min),n=Ou.clone(this.max);for(let t=0;t<e.length;t++)i[t]=e[t]?this.min[t]:this.center[t],n[t]=e[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new ed(i,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}distanceZ(t){return Math.max(Math.min(this.max[2],t[2]),this.min[2])-t[2]}getCorners(){const t=this.min,e=this.max;return[[t[0],t[1],t[2]],[e[0],t[1],t[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],e[2]],[t[0],e[1],e[2]]]}intersects(t){return this.intersectsAabb(t.bounds)?Ku(t,this.getCorners()):0}intersectsFlat(t){return this.intersectsAabb(t.bounds)?Ku(t,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(t,e){return e||this.intersects(t)?Qu(t,this.getCorners()):0}intersectsPreciseFlat(t,e){return e||this.intersectsFlat(t)?Qu(t,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(t){for(let e=0;e<3;++e)if(this.min[e]>t.max[e]||t.min[e]>this.max[e])return!1;return!0}intersectsAabbXY(t){return!(this.min[0]>t.max[0]||t.min[0]>this.max[0]||this.min[1]>t.max[1]||t.min[1]>this.max[1])}encapsulate(t){for(let e=0;e<3;e++)this.min[e]=Math.min(this.min[e],t.min[e]),this.max[e]=Math.max(this.max[e],t.max[e])}encapsulatePoint(t){for(let e=0;e<3;e++)this.min[e]=Math.min(this.min[e],t[e]),this.max[e]=Math.max(this.max[e],t[e])}closestPoint(t){return[Math.max(Math.min(this.max[0],t[0]),this.min[0]),Math.max(Math.min(this.max[1],t[1]),this.min[1]),Math.max(Math.min(this.max[2],t[2]),this.min[2])]}}Lo(ed,"Aabb");const id=5,nd=6,rd=un/Math.PI/2,sd=16383,od=64,ad=[od,32,16],ld=-rd,cd=rd,hd=[new ed([ld,ld,ld],[cd,cd,cd]),new ed([ld,ld,ld],[0,0,cd]),new ed([0,ld,ld],[cd,0,cd]),new ed([ld,0,ld],[0,cd,cd]),new ed([0,0,ld],[cd,cd,cd])];function ud(t){return t*rd/qd}function dd(t,e,i,n=!0){const r=Ou.scale([],t._camera.position,t.worldSize),s=[e,i,1,1];vu.transformMat4(s,s,t.pixelMatrixInverse),vu.scale(s,s,1/s[3]);const o=Ou.sub([],s,r),a=Ou.normalize([],o),l=t.globeMatrix,c=[l[12],l[13],l[14]],h=Ou.sub([],c,r),u=Ou.length(h),d=Ou.normalize([],h),p=t.worldSize/(2*Math.PI),f=Ou.dot(d,a),m=Math.asin(p/u);if(m<Math.acos(f)){if(!n)return null;const t=[],e=[];Ou.scale(t,a,u/f),Ou.normalize(e,Ou.sub(e,t,h)),Ou.normalize(a,Ou.add(a,h,Ou.scale(a,e,Math.tan(m)*u)))}const g=[];new Zu(r,a).closestPointOnSphere(c,p,g);const _=Ou.normalize([],st(l,0)),y=Ou.normalize([],st(l,1)),v=Ou.normalize([],st(l,2)),b=Ou.dot(_,g),x=Ou.dot(y,g),w=Ou.dot(v,g),E=S(Math.asin(-x/p));let T=S(Math.atan2(b,w));T=t.center.lng+function(t,e){const i=(e-t+180)%360-180;return i<-180?i+360:i}(t.center.lng,T);const M=Qd(T),A=I(Jd(E),0,1);return new cp(M,A)}class pd{constructor(t,e,i){this.a=Ou.sub([],t,i),this.b=Ou.sub([],e,i),this.center=i;const n=Ou.normalize([],this.a),r=Ou.normalize([],this.b);this.angle=Math.acos(Ou.dot(n,r))}}function fd(t,e){if(0===t.angle)return null;let i;return i=0===t.a[e]?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),i<0||i>1?null:function(t,e,i,n){const r=Math.sin(i);return t*(Math.sin((1-n)*i)/r)+e*(Math.sin(n*i)/r)}(t.a[e],t.b[e],t.angle,I(i,0,1))+t.center[e]}function md(t){if(t.z<=1)return hd[t.z+2*t.y+t.x];const e=xd(bd(t));return ed.fromPoints(e)}function gd(t,e,i){return Ou.scale(t,t,1-i),Ou.scaleAndAdd(t,t,e,i)}function _d(t,e){const i=Od(e.zoom);if(0===i)return md(t);const n=bd(t),r=xd(n),s=Qd(n.getWest())*e.worldSize,o=Qd(n.getEast())*e.worldSize,a=Jd(n.getNorth())*e.worldSize,l=Jd(n.getSouth())*e.worldSize,c=[s,a,0],h=[o,a,0],u=[s,l,0],d=[o,l,0],p=Au.invert([],e.globeMatrix);return Ou.transformMat4(c,c,p),Ou.transformMat4(h,h,p),Ou.transformMat4(u,u,p),Ou.transformMat4(d,d,p),r[0]=gd(r[0],u,i),r[1]=gd(r[1],d,i),r[2]=gd(r[2],h,i),r[3]=gd(r[3],c,i),ed.fromPoints(r)}function yd(t,e,i){for(const n of t)Ou.transformMat4(n,n,e),Ou.scale(n,n,i)}function vd(t,e,i,n){const r=e/t.worldSize,s=t.globeMatrix;if(i.z<=1){const t=md(i).getCorners();return yd(t,s,r),ed.fromPoints(t)}const o=bd(i,n),a=xd(o);yd(a,s,r);const l=Number.MAX_VALUE,c=[-l,-l,-l],h=[l,l,l];if(o.contains(t.center)){for(const t of a)Ou.min(h,h,t),Ou.max(c,c,t);c[2]=0;const e=t.point,i=[e.x*r,e.y*r,0];return Ou.min(h,h,i),Ou.max(c,c,i),new ed(h,c)}const u=[s[12]*r,s[13]*r,s[14]*r],d=o.getCenter(),p=I(t.center.lat,-rp,rp),f=I(d.lat,-rp,rp),m=Qd(t.center.lng),g=Jd(p);let _=m-Qd(d.lng);const y=g-Jd(f);_>.5?_-=1:_<-.5&&(_+=1);let v=0;if(Math.abs(_)>Math.abs(y))v=_>=0?1:3;else{v=y>=0?0:2;const t=[s[4]*r,s[5]*r,s[6]*r],e=-Math.sin(E(y>=0?o.getSouth():o.getNorth()))*rd;Ou.scaleAndAdd(u,u,t,e)}const b=a[v],x=a[(v+1)%4],w=new pd(b,x,u),S=[fd(w,0)||b[0],fd(w,1)||b[1],fd(w,2)||b[2]],T=Od(t.zoom);if(T>0){const n=function({x:t,y:e,z:i},n,r,s,o){const a=1/(1<<i);let l=t*a,c=l+a,h=e*a,u=h+a,d=0;const p=(l+c)/2-s;return p>.5?d=-1:p<-.5&&(d=1),l=((l+d)*n-(s*=n))*r+s,c=((c+d)*n-s)*r+s,h=(h*n-(o*=n))*r+o,u=(u*n-o)*r+o,[[l,u,0],[c,u,0],[c,h,0],[l,h,0]]}(i,e,t._pixelsPerMercatorPixel,m,g);for(let t=0;t<a.length;t++)gd(a[t],n[t],T);const r=Ou.add([],n[v],n[(v+1)%4]);Ou.scale(r,r,.5),gd(S,r,T)}for(const t of a)Ou.min(h,h,t),Ou.max(c,c,t);return h[2]=Math.min(b[2],x[2]),Ou.min(h,h,S),Ou.max(c,c,S),new ed(h,c)}function bd({x:t,y:e,z:i},n=!1){const r=1/(1<<i),s=new Zd(ep(t*r),e===(1<<i)-1&&n?-90:ip((e+1)*r)),o=new Zd(ep((t+1)*r),0===e&&n?90:ip(e*r));return new ac(s,o)}function xd(t){const e=E(t.getNorth()),i=E(t.getSouth()),n=Math.cos(e),r=Math.cos(i),s=Math.sin(e),o=Math.sin(i),a=t.getWest(),l=t.getEast();return[wd(r,o,a),wd(r,o,l),wd(n,s,l),wd(n,s,a)]}function wd(t,e,i,n=rd){return i=E(i),[t*Math.sin(i)*n,-e*n,t*Math.cos(i)*n]}function Ed(t,e,i){return wd(Math.cos(E(t)),Math.sin(E(t)),e,i)}function Sd(t,e,i,n){const r=1<<i.z,s=(t/un+i.x)/r;return Ed(ip((e/un+i.y)/r),ep(s),n)}function Td({min:t,max:e}){return sd/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const Md=new Float64Array(16);function Ad(t){const e=Td(t),i=Au.fromScaling(Md,[e,e,e]);return Au.translate(i,i,Ou.negate([],t.min))}function Cd(t){const e=Au.fromTranslation(Md,t.min),i=1/Td(t);return Au.scale(e,e,[i,i,i])}function kd(t){const e=un/(2*Math.PI);return t/(2*Math.PI)/e}function Pd(t,e){return un/(512*Math.pow(2,t))*Td(md(e))}function Id(t,e,i,n,r){const s=kd(i),o=[t,e,-i/(2*Math.PI)],a=Au.identity(new Float64Array(16));return Au.translate(a,a,o),Au.scale(a,a,[s,s,s]),Au.rotateX(a,a,E(-r)),Au.rotateY(a,a,E(-n)),a}function Dd(t){const e=t.pixelsPerMeter,i=e/tp(1,t.center.lat),n=Au.identity(new Float64Array(16));return Au.translate(n,n,[t.point.x,t.point.y,0]),Au.scale(n,n,[i,i,e]),Float32Array.from(n)}function Od(t){return D(id,nd,t)}function Ld(t,e,i){const n=Au.identity(new Float64Array(16)),r=(e/(1<<t)-.5)*Math.PI*2;return Au.rotateY(n,i.globeMatrix,r),Float32Array.from(n)}function zd(t,e,i){const n=Od(i.zoom),r=t.style.map._antialias,s=e.options.extStandardDerivativesForceOff||t.terrain&&t.terrain.exaggeration()>0;return 0===n&&!r&&!s}function Rd(t,e,i,n){const r=e.getNorth(),s=e.getSouth(),o=e.getWest(),a=e.getEast(),l=1<<t.z,c=a-o,h=r-s,u=c/od,d=-h/ad[i],p=[0,u,0,d,0,0,r,o,0];if(t.z>0){const t=180/n;Tu.multiply(p,p,[t/c+1,0,0,0,t/h+1,0,-.5*t/u,.5*t/d,1])}return p[2]=l,p[5]=t.x,p[8]=t.y,p}function Fd(t){const e=rp-5;t=I(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(E(t))),3);return Math.round(i*(ad.length-1))}function Bd(t){const e=[0,0,0],i=Au.identity(new Float64Array(16));return Au.multiply(i,t.pixelMatrix,t.globeMatrix),Ou.transformMat4(e,e,i),new v(e[0],e[1])}function Nd(t,e){const i=Ed(e.lat,e.lng),n=function(t){const e=Ed(t._center.lat,t._center.lng),i=Ou.fromValues(0,1,0);let n=Ou.cross([],i,e);const r=Au.fromRotation([],-t.angle,e);n=Ou.transformMat4(n,n,r),Au.fromRotation(r,-t._pitch,n);const s=Ou.normalize([],e);return Ou.scale(s,s,ud(t.cameraToCenterDistance/t.pixelsPerMeter)),Ou.transformMat4(s,s,r),Ou.add([],e,s)}(t),r=Ou.subtract([],n,i);return Ou.angle(r,i)}function jd(t,e){return Nd(t,e)>Math.PI/2*1.01}const Vd=E(85),Ud=Math.cos(Vd),$d=Math.sin(Vd);class Hd{constructor(t){this._createGrid(t),this._createPoles(t)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy()}_fillGridMeshWithLods(t,e){const i=new Ia,n=new Za,r=[],s=t+1+2,o=e[0]+1,a=e[0]+1+(1+e.length),l=(t,e,i)=>{let n=t===s-1?t-2:0===t?t:t-1;return n+=i?24575:0,[n,e]};for(let t=0;t<s;++t)i.emplaceBack(...l(t,0,!0));for(let t=0;t<o;++t)for(let e=0;e<s;++e)i.emplaceBack(...l(e,t,(0===e||e===s-1)&&!0));for(let t=0;t<e.length;++t){const n=e[t];for(let t=0;t<s;++t)i.emplaceBack(...l(t,n,!0))}for(let t=0;t<e.length;++t){const o=n.length,l=e[t]+1+2,c=new Za;for(let i=0;i<l-1;i++){const r=i===l-2,o=r?s*(a-e.length+t-i):s;for(let t=0;t<s-1;t++){const e=i*s+t;0===i||r||0===t||t===s-2?(c.emplaceBack(e+1,e,e+o),c.emplaceBack(e+o,e+o+1,e+1)):(n.emplaceBack(e+1,e,e+o),n.emplaceBack(e+o,e+o+1,e+1))}}const h=bl.simpleSegment(0,o,i.length,n.length-o);for(let t=0;t<c.uint16.length;t+=3)n.emplaceBack(c.uint16[t],c.uint16[t+1],c.uint16[t+2]);const u=bl.simpleSegment(0,o,i.length,n.length-o);r.push({withoutSkirts:h,withSkirts:u})}return{vertices:i,indices:n,segments:r}}_createGrid(t){const e=this._fillGridMeshWithLods(od,ad);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,ju.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0)}_createPoles(t){const e=new Za;for(let t=0;t<=od;t++)e.emplaceBack(0,t+1,t+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const i=new Qa,n=new Qa,r=new Qa,s=new Qa;this._poleSegments=[];for(let t=0,e=0;t<id;t++){const o=360/(1<<t);i.emplaceBack(0,-rd,0,.5,0),n.emplaceBack(0,-rd,0,.5,1),r.emplaceBack(0,-rd,0,.5,.5),s.emplaceBack(0,-rd,0,.5,.5);for(let t=0;t<=od;t++){let e=t/od,a=0;const l=Jn(0,o,e),[c,h,u]=wd(Ud,$d,l,rd);i.emplaceBack(c,h,u,e,a),n.emplaceBack(c,h,u,e,1-a);const d=E(l);e=.5+.5*Math.sin(d),a=.5+.5*Math.cos(d),r.emplaceBack(c,h,u,e,a),s.emplaceBack(c,h,u,e,1-a)}this._poleSegments.push(bl.simpleSegment(e,0,66,64)),e+=66}this._poleNorthVertexBuffer=t.createVertexBuffer(i,Bu,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(n,Bu,!1),this._texturedPoleNorthVertexBuffer=t.createVertexBuffer(r,Bu,!1),this._texturedPoleSouthVertexBuffer=t.createVertexBuffer(s,Bu,!1)}getGridBuffers(t,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t,e){return[e?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,e?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}}const qd=6371008.8,Wd=2*Math.PI*qd;class Gd{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Gd(O(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,n=t.lat*e,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return qd*Math.acos(Math.min(r,1))}toBounds(t=0){const e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new ac(new Gd(this.lng-i,this.lat-e),new Gd(this.lng+i,this.lat+e))}toEcef(t){const e=ud(t);return Ed(this.lat,this.lng,rd+e)}static convert(t){if(t instanceof Gd)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Gd(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Gd(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var Zd=Gd;const Yd=0,Xd=25.5;function Kd(t){return Wd*Math.cos(t*Math.PI/180)}function Qd(t){return(180+t)/360}function Jd(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function tp(t,e){return t/Kd(e)}function ep(t){return 360*t-180}function ip(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function np(t,e){return t*Kd(ip(e))}const rp=85.051129;function sp(t){return Math.cos(E(I(t,-rp,rp)))}function op(t,e){const i=I(e,Yd,Xd),n=Math.pow(2,i);return sp(t)*Wd/(512*n)}function ap(t){return 1/Math.cos(t*Math.PI/180)}function lp(t,e=0){const i=Math.exp(Math.PI*(1-(t.y+e/un)/(1<<t.z)*2));return 80150034*i/(i*i+1)/un/(1<<t.z)}class cp{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=Zd.convert(t);return new cp(Qd(i.lng),Jd(i.lat),tp(e,i.lat))}toLngLat(){return new Zd(ep(this.x),ip(this.y))}toAltitude(){return np(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Wd*ap(ip(this.y))}}function hp(t,e,i,n,r,s,o,a,l){const c=(e+n)/2,h=(i+r)/2,u=new v(c,h);a(u),function(t,e,i,n,r,s){const o=i-r,a=n-s;return Math.abs((n-e)*o-(i-t)*a)/Math.hypot(o,a)}(u.x,u.y,s.x,s.y,o.x,o.y)>=l?(hp(t,e,i,c,h,s,u,a,l),hp(t,c,h,n,r,u,o,a,l)):t.push(o)}function up(t,e,i){let n=t[0],r=n.x,s=n.y;e(n);const o=[n];for(let a=1;a<t.length;a++){const l=t[a],{x:c,y:h}=l;e(l),hp(o,r,s,c,h,n,l,e,i),r=c,s=h,n=l}return o}function dp(t,e,i,n){if(n(e,i)){const r=e.add(i)._mult(.5);dp(t,e,r,n),dp(t,r,i,n)}else t.push(i)}function pp(t,e){let i=t[0];const n=[i];for(let r=1;r<t.length;r++){const s=t[r];dp(n,i,s,e),i=s}return n}const fp=Math.pow(2,14)-1,mp=-fp-1;function gp(t,e){const i=Math.round(t.x*e),n=Math.round(t.y*e);return t.x=I(i,mp,fp),t.y=I(n,mp,fp),(i<t.x||i>t.x+1||n<t.y||n>t.y+1)&&Y("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function _p(t,e,i){const n=t.loadGeometry(),r=t.extent,s=un/r;if(e&&i&&i.projection.isReprojectedInTileSpace){const s=1<<e.z,{scale:o,x:a,y:l,projection:c}=i,h=t=>{const i=ep((e.x+t.x/r)/s),n=ip((e.y+t.y/r)/s),h=c.project(i,n);t.x=(h.x*o-a)*r,t.y=(h.y*o-l)*r};for(let e=0;e<n.length;e++)if(1!==t.type)n[e]=up(n[e],h,1);else{const t=[];for(const i of n[e])i.x<0||i.x>=r||i.y<0||i.y>=r||(h(i),t.push(i));n[e]=t}}for(const t of n)for(const e of t)gp(e,s);return n}function yp(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?_p(t):[]}}function vp(t,e,i,n,r){t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)}function bp(t,e,i){const n=16384;t.emplaceBack(e.x,e.y,e.z,i[0]*n,i[1]*n,i[2]*n)}class xp{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new Ia,this.indexArray=new Za,this.segments=new bl,this.programConfigurations=new ec(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){const r=this.layers[0],s=[];let o=null;"circle"===r.type&&(o=r.layout.get("circle-sort-key"));for(const{feature:e,id:r,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=yp(e,t);if(!this.layers[0]._featureFilter.filter(new oa(this.zoom),c,i))continue;const h=o?o.evaluate(c,{},i):void 0,u={id:r,properties:e.properties,type:e.type,sourceLayerIndex:l,index:a,geometry:t?c.geometry:_p(e,i,n),patterns:{},sortKey:h};s.push(u)}o&&s.sort(((t,e)=>t.sortKey-e.sortKey));let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new Na,a=n.projection);for(const n of s){const{geometry:r,index:s,sourceLayerIndex:o}=n,l=t[s].feature;this.addFeature(n,r,s,e.availableImages,i,a,e.brightness),e.featureIndex.insert(l,r,s,o,this.index)}}update(t,e,i,n,r){const s=0!==Object.keys(t).length;s&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(t,e,s?this.stateDependentLayers:this.layers,i,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yl.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,vl.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,e,i,n,r,s,o){for(const i of e)for(const e of i){const i=e.x,n=e.y;if(i<0||i>=un||n<0||n>=un)continue;if(s){const t=s.projectTilePoint(i,n,r),e=s.upVector(r,i,n),o=this.globeExtVertexArray;bp(o,t,e),bp(o,t,e),bp(o,t,e),bp(o,t,e)}const o=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=o.vertexLength;vp(this.layoutVertexArray,i,n,-1,-1),vp(this.layoutVertexArray,i,n,1,-1),vp(this.layoutVertexArray,i,n,1,1),vp(this.layoutVertexArray,i,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),o.vertexLength+=4,o.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},n,r,o)}}function wp(t,e){for(let i=0;i<t.length;i++)if(Ip(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(Ip(t,e[i]))return!0;return!!Mp(t,e)}function Ep(t,e,i){return!!Ip(t,e)||!!Cp(e,t,i)}function Sp(t,e){if(1===t.length)return Pp(e,t[0]);for(let i=0;i<e.length;i++){const n=e[i];for(let e=0;e<n.length;e++)if(Ip(t,n[e]))return!0}for(let i=0;i<t.length;i++)if(Pp(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(Mp(t,e[i]))return!0;return!1}function Tp(t,e,i){if(t.length>1){if(Mp(t,e))return!0;for(let n=0;n<e.length;n++)if(Cp(e[n],t,i))return!0}for(let n=0;n<t.length;n++)if(Cp(t[n],e,i))return!0;return!1}function Mp(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1];for(let t=0;t<e.length-1;t++)if(Ap(n,r,e[t],e[t+1]))return!0}return!1}function Ap(t,e,i,n){return X(t,i,n)!==X(e,i,n)&&X(t,e,i)!==X(t,e,n)}function Cp(t,e,i){const n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++)if(kp(t,e[i-1],e[i])<n)return!0;return!1}function kp(t,e,i){const n=e.distSqr(i);if(0===n)return t.distSqr(e);const r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(r<0?e:r>1?i:i.sub(e)._mult(r)._add(e))}function Pp(t,e){let i,n,r,s=!1;for(let o=0;o<t.length;o++){i=t[o];for(let t=0,o=i.length-1;t<i.length;o=t++)n=i[t],r=i[o],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(s=!s)}return s}function Ip(t,e){let i=!1;for(let n=0,r=t.length-1;n<t.length;r=n++){const s=t[n],o=t[r];s.y>e.y!=o.y>e.y&&e.x<(o.x-s.x)*(e.y-s.y)/(o.y-s.y)+s.x&&(i=!i)}return i}function Dp(t,e,i,n,r){for(const s of t)if(e<=s.x&&i<=s.y&&n>=s.x&&r>=s.y)return!0;const s=[new v(e,i),new v(e,r),new v(n,r),new v(n,i)];if(t.length>2)for(const e of s)if(Ip(t,e))return!0;for(let e=0;e<t.length-1;e++)if(Op(t[e],t[e+1],s))return!0;return!1}function Op(t,e,i){const n=i[0],r=i[2];if(t.x<n.x&&e.x<n.x||t.x>r.x&&e.x>r.x||t.y<n.y&&e.y<n.y||t.y>r.y&&e.y>r.y)return!1;const s=X(t,e,i[0]);return s!==X(t,e,i[1])||s!==X(t,e,i[2])||s!==X(t,e,i[3])}function Lp(t,e,i,n,r,s){let o=e.y-t.y,a=t.x-e.x;if(s=s||0){const t=o*o+a*a;if(0===t)return!0;const e=Math.sqrt(t);o/=e,a/=e}return!((i.x-t.x)*o+(i.y-t.y)*a-s<0||(n.x-t.x)*o+(n.y-t.y)*a-s<0||(r.x-t.x)*o+(r.y-t.y)*a-s<0)}function zp(t,e,i,n,r,s,o){return!(Lp(t,e,n,r,s,o)||Lp(e,i,n,r,s,o)||Lp(i,t,n,r,s,o)||Lp(n,r,t,e,i,o)||Lp(r,s,t,e,i,o)||Lp(s,n,t,e,i,o))}function Rp(t,e,i){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Fp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Bp(t,e,i,n,r){if(!e[0]&&!e[1])return t;const s=v.convert(e)._mult(r);"viewport"===i&&s._rotate(-n);const o=[];for(let e=0;e<t.length;e++)o.push(t[e].sub(s));return o}function Np(t,e,i,n){const r=v.convert(t)._mult(n);return"viewport"===e&&r._rotate(-i),r}Lo(xp,"CircleBucket",{omit:["layers"]});const jp=new ya({"circle-sort-key":new ga(De.layout_circle["circle-sort-key"]),visibility:new ma(De.layout_circle.visibility)});var Vp={paint:new ya({"circle-radius":new ga(De.paint_circle["circle-radius"]),"circle-color":new ga(De.paint_circle["circle-color"]),"circle-blur":new ga(De.paint_circle["circle-blur"]),"circle-opacity":new ga(De.paint_circle["circle-opacity"]),"circle-translate":new ma(De.paint_circle["circle-translate"]),"circle-translate-anchor":new ma(De.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ma(De.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ma(De.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ga(De.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ga(De.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ga(De.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new ma(De.paint_circle["circle-emissive-strength"])}),layout:jp};const Up=Au.create(),$p=(t,e,i,n,r,s)=>{const o=t.transform,a="globe"===o.projection.name;let l;if("map"===s.paint.get("circle-pitch-alignment"))if(a){const t=Pd(o.zoom,e.canonical)*o._pixelsPerMercatorPixel;l=Float32Array.from([t,0,0,t])}else l=o.calculatePixelsToTileUnitsMatrix(i);else l=new Float32Array([o.pixelsToGLUnits[0],0,0,o.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:t.transform.getCameraToCenterDistance(o.projection),u_matrix:t.translatePosMatrix(e.projMatrix,i,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_device_pixel_ratio:pe.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Up,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:s.paint.get("circle-emissive-strength")};if(a){c.u_inv_rot_matrix=n,c.u_merc_center=r,c.u_tile_id=[e.canonical.x,e.canonical.y,1<<e.canonical.z],c.u_zoom_transition=Od(o.zoom);const t=r[0]*un,i=r[1]*un;c.u_up_dir=o.projection.upVector(new $u(0,0,0),t,i)}return c},Hp=t=>{const e=[];return"map"===t.paint.get("circle-pitch-alignment")&&e.push("PITCH_WITH_MAP"),"map"===t.paint.get("circle-pitch-scale")&&e.push("SCALE_WITH_MAP"),e};function qp(t,e,i,n,r,s,o,a,l){if(s&&t.queryGeometry.isAboveHorizon)return!1;s&&(l*=t.pixelToTileUnitsFactor);const c=t.tileID.canonical,h=i.projection.upVectorScale(c,i.center.lat,i.worldSize).metersToTile;for(const u of e)for(const e of u){const u=e.add(a),d=r&&i.elevation?i.elevation.exaggeration()*r.getElevationAt(u.x,u.y,!0):0,p=i.projection.projectTilePoint(u.x,u.y,c);if(d>0){const t=i.projection.upVector(c,u.x,u.y);p.x+=t[0]*h*d,p.y+=t[1]*h*d,p.z+=t[2]*h*d}const f=s?u:Wp(p.x,p.y,p.z,n),m=s?t.tilespaceRays.map((t=>Yp(t,d))):t.queryGeometry.screenGeometry,g=vu.transformMat4([],[p.x,p.y,p.z,1],n);if(!o&&s?l*=g[3]/i.cameraToCenterDistance:o&&!s&&(l*=i.cameraToCenterDistance/g[3]),s){const t=ip((e.y/un+c.y)/(1<<c.z));l/=i.projection.pixelsPerMeter(t,1)/tp(1,t)}if(Ep(m,f,l))return!0}return!1}function Wp(t,e,i,n){const r=vu.transformMat4([],[t,e,i,1],n);return new v(r[0]/r[3],r[1]/r[3])}const Gp=Ou.fromValues(0,0,0),Zp=Ou.fromValues(0,0,1);function Yp(t,e){const i=Ou.create();return Gp[2]=e,t.intersectsPlane(Gp,Zp,i),new v(i[0],i[1])}class Xp extends xp{}function Kp(t,{width:e,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==e*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=r,t}function Qp(t,e,i){const{width:n,height:r}=e;n===t.width&&r===t.height||(Jp(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,r)},i),t.width=n,t.height=r,t.data=e.data)}function Jp(t,e,i,n,r,s){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,a=e.data;for(let l=0;l<r.height;l++){const c=((i.y+l)*t.width+i.x)*s,h=((n.y+l)*e.width+n.x)*s;for(let t=0;t<r.width*s;t++)a[h+t]=o[c+t]}return e}Lo(Xp,"HeatmapBucket",{omit:["layers"]});class tf{constructor(t,e){Kp(this,t,1,e)}resize(t){Qp(this,new tf(t),1)}clone(){return new tf({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Jp(t,e,i,n,r,1)}}class ef{constructor(t,e){Kp(this,t,4,e)}resize(t){Qp(this,new ef(t),4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ef({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Jp(t,e,i,n,r,4)}}class nf{constructor(t,e){this.width=t.width,this.height=t.height,this.data=e instanceof Uint8Array?new Float32Array(e.buffer):e}}Lo(tf,"AlphaImage"),Lo(ef,"RGBAImage");const rf=new ya({visibility:new ma(De.layout_heatmap.visibility)});var sf={paint:new ya({"heatmap-radius":new ga(De.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ga(De.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ma(De.paint_heatmap["heatmap-intensity"]),"heatmap-color":new _a(De.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ma(De.paint_heatmap["heatmap-opacity"])}),layout:rf};function of(t){const e={},i=t.resolution||256,n=t.clips?t.clips.length:1,r=t.image||new ef({width:i,height:n}),s=(i,n,s)=>{e[t.evaluationKey]=s;const o=t.expression.evaluate(e);o&&(r.data[i+n+0]=Math.floor(255*o.r/o.a),r.data[i+n+1]=Math.floor(255*o.g/o.a),r.data[i+n+2]=Math.floor(255*o.b/o.a),r.data[i+n+3]=Math.floor(255*o.a))};if(t.clips)for(let e=0,r=0;e<n;++e,r+=4*i)for(let n=0,o=0;n<i;n++,o+=4){const a=n/(i-1),{start:l,end:c}=t.clips[e];s(r,o,l*(1-a)+c*a)}else for(let t=0,e=0;t<i;t++,e+=4)s(0,e,t/(i-1));return r}const af=new ya({visibility:new ma(De.layout_hillshade.visibility)});var lf={paint:new ya({"hillshade-illumination-direction":new ma(De.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ma(De.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ma(De.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ma(De.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ma(De.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ma(De.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new ma(De.paint_hillshade["hillshade-emissive-strength"])}),layout:af};const cf=ka([{name:"a_pos",components:2,type:"Int16"}],4),{members:hf}=cf;var uf={exports:{}};function df(t,e,i){i=i||2;var n,r,s,o,a,l,c,h=e&&e.length,u=h?e[0]*i:t.length,d=pf(t,0,u,i,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=function(t,e,i,n){var r,s,o,a=[];for(r=0,s=e.length;r<s;r++)(o=pf(t,e[r]*n,r<s-1?e[r+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),a.push(Sf(o));for(a.sort(bf),r=0;r<a.length;r++)i=xf(a[r],i);return i}(t,e,d,i)),t.length>80*i){n=s=t[0],r=o=t[1];for(var f=i;f<u;f+=i)(a=t[f])<n&&(n=a),(l=t[f+1])<r&&(r=l),a>s&&(s=a),l>o&&(o=l);c=0!==(c=Math.max(s-n,o-r))?32767/c:0}return mf(d,p,i,n,r,c,0),p}function pf(t,e,i,n,r){var s,o;if(r===Ff(t,e,i,n)>0)for(s=e;s<i;s+=n)o=Lf(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=Lf(s,t[s],t[s+1],o);return o&&Cf(o,o.next)&&(zf(o),o=o.next),o}function ff(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Cf(n,n.next)&&0!==Af(n.prev,n,n.next))n=n.next;else{if(zf(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function mf(t,e,i,n,r,s,o){if(t){!o&&s&&function(t,e,i,n){var r=t;do{0===r.z&&(r.z=Ef(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,s,o,a,l,c=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,c*=2}while(o>1)}(r)}(t,n,r,s);for(var a,l,c=t;t.prev!==t.next;)if(a=t.prev,l=t.next,s?_f(t,n,r,s):gf(t))e.push(a.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),zf(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?mf(t=yf(ff(t),e,i),e,i,n,r,s,2):2===o&&vf(t,e,i,n,r,s):mf(ff(t),e,i,n,r,s,1);break}}}function gf(t){var e=t.prev,i=t,n=t.next;if(Af(e,i,n)>=0)return!1;for(var r=e.x,s=i.x,o=n.x,a=e.y,l=i.y,c=n.y,h=r<s?r<o?r:o:s<o?s:o,u=a<l?a<c?a:c:l<c?l:c,d=r>s?r>o?r:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c,f=n.next;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Tf(r,a,s,l,o,c,f.x,f.y)&&Af(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _f(t,e,i,n){var r=t.prev,s=t,o=t.next;if(Af(r,s,o)>=0)return!1;for(var a=r.x,l=s.x,c=o.x,h=r.y,u=s.y,d=o.y,p=a<l?a<c?a:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=a>l?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,_=Ef(p,f,e,i,n),y=Ef(m,g,e,i,n),v=t.prevZ,b=t.nextZ;v&&v.z>=_&&b&&b.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==r&&v!==o&&Tf(a,h,l,u,c,d,v.x,v.y)&&Af(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==r&&b!==o&&Tf(a,h,l,u,c,d,b.x,b.y)&&Af(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;v&&v.z>=_;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==r&&v!==o&&Tf(a,h,l,u,c,d,v.x,v.y)&&Af(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=y;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==r&&b!==o&&Tf(a,h,l,u,c,d,b.x,b.y)&&Af(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function yf(t,e,i){var n=t;do{var r=n.prev,s=n.next.next;!Cf(r,s)&&kf(r,n,n.next,s)&&Df(r,s)&&Df(s,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),zf(n),zf(n.next),n=t=s),n=n.next}while(n!==t);return ff(n)}function vf(t,e,i,n,r,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Mf(o,a)){var l=Of(o,a);return o=ff(o,o.next),l=ff(l,l.next),mf(o,e,i,n,r,s,0),void mf(l,e,i,n,r,s,0)}a=a.next}o=o.next}while(o!==t)}function bf(t,e){return t.x-e.x}function xf(t,e){var i=function(t,e){var i,n=e,r=t.x,s=t.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o&&(o=a,i=n.x<n.next.x?n:n.next,a===r))return i}n=n.next}while(n!==e);if(!i)return null;var l,c=i,h=i.x,u=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=h&&r!==n.x&&Tf(s<u?r:o,s,h,u,s<u?o:r,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(r-n.x),Df(n,t)&&(l<d||l===d&&(n.x>i.x||n.x===i.x&&wf(i,n)))&&(i=n,d=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var n=Of(i,t);return ff(n,n.next),ff(i,i.next)}function wf(t,e){return Af(t.prev,t,e.prev)<0&&Af(e.next,t,t.next)<0}function Ef(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Sf(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Tf(t,e,i,n,r,s,o,a){return(r-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(n-a)>=(i-o)*(e-a)&&(i-o)*(s-a)>=(r-o)*(n-a)}function Mf(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&kf(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Df(t,e)&&Df(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(Af(t.prev,t,e.prev)||Af(t,e.prev,e))||Cf(t,e)&&Af(t.prev,t,t.next)>0&&Af(e.prev,e,e.next)>0)}function Af(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Cf(t,e){return t.x===e.x&&t.y===e.y}function kf(t,e,i,n){var r=If(Af(t,e,i)),s=If(Af(t,e,n)),o=If(Af(i,n,t)),a=If(Af(i,n,e));return r!==s&&o!==a||!(0!==r||!Pf(t,i,e))||!(0!==s||!Pf(t,n,e))||!(0!==o||!Pf(i,t,n))||!(0!==a||!Pf(i,e,n))}function Pf(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function If(t){return t>0?1:t<0?-1:0}function Df(t,e){return Af(t.prev,t,t.next)<0?Af(t,e,t.next)>=0&&Af(t,t.prev,e)>=0:Af(t,e,t.prev)<0||Af(t,t.next,e)<0}function Of(t,e){var i=new Rf(t.i,t.x,t.y),n=new Rf(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Lf(t,e,i,n){var r=new Rf(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function zf(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Rf(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ff(t,e,i,n){for(var r=0,s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}uf.exports=df,uf.exports.default=df,df.deviation=function(t,e,i,n){var r=e&&e.length,s=Math.abs(Ff(t,0,r?e[0]*i:t.length,i));if(r)for(var o=0,a=e.length;o<a;o++)s-=Math.abs(Ff(t,e[o]*i,o<a-1?e[o+1]*i:t.length,i));var l=0;for(o=0;o<n.length;o+=3){var c=n[o]*i,h=n[o+1]*i,u=n[o+2]*i;l+=Math.abs((t[c]-t[u])*(t[h+1]-t[c+1])-(t[c]-t[h])*(t[u+1]-t[c+1]))}return 0===s&&0===l?0:Math.abs((l-s)/s)},df.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[r][s][o]);r>0&&i.holes.push(n+=t[r-1].length)}return i};var Bf=p(uf.exports);function Nf(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,s;for(let e=0;e<i;e++){const i=K(t[e]);0!==i&&(t[e].area=Math.abs(i),void 0===s&&(s=i<0),s===i<0?(r&&n.push(r),r=[t[e]]):r.push(t[e]))}if(r&&n.push(r),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(Ni(n[t],e,1,n[t].length-1,jf),n[t]=n[t].slice(0,e));return n}function jf(t,e){return e.area-t.area}function Vf(t,e,i){const n=i.patternDependencies;let r=!1;for(const i of e){const e=i.paint.get(`${t}-pattern`);e.isConstant()||(r=!0);const s=e.constantOr(null);s&&(r=!0,n[s]=!0)}return r}function Uf(t,e,i,n,r){const s=r.patternDependencies;for(const o of e){const e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n},i,{},r.availableImages);t=t&&t.name?t.name:t,s[t]=!0,i.patterns[o.id]=t}}return i}class $f{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ia,this.indexArray=new Za,this.indexArray2=new $a,this.programConfigurations=new ec(t.layers,t.zoom),this.segments=new bl,this.segments2=new bl,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.projection=t.projection}populate(t,e,i,n){this.hasPattern=Vf("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),s=[];for(const{feature:o,id:a,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,h=yp(o,t);if(!this.layers[0]._featureFilter.filter(new oa(this.zoom),h,i))continue;const u=r?r.evaluate(h,{},i,e.availableImages):void 0,d={id:a,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?h.geometry:_p(o,i,n),patterns:{},sortKey:u};s.push(d)}r&&s.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of s){const{geometry:r,index:s,sourceLayerIndex:o}=n;if(this.hasPattern){const t=Uf("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,s,i,{},e.availableImages,e.brightness);e.featureIndex.insert(t[s].feature,r,s,o,this.index)}}update(t,e,i,n,r){const s=0!==Object.keys(t).length;s&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(t,e,s?this.stateDependentLayers:this.layers,i,n,r)}addFeatures(t,e,i,n,r,s){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i,n,s)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hf),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,n,r,s=[],o){for(const t of Nf(e,500)){let e=0;for(const i of t)e+=i.length;const i=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=i.vertexLength,r=[],s=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&s.push(r.length/2);const i=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=i.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),r.push(e[0].x),r.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(n+t-1,n+t),r.push(e[t].x),r.push(e[t].y);i.vertexLength+=e.length,i.primitiveLength+=e.length}const o=Bf(r,s);for(let t=0;t<o.length;t+=3)this.indexArray.emplaceBack(n+o[t],n+o[t+1],n+o[t+2]);i.vertexLength+=e,i.primitiveLength+=o.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,s,n,o)}}Lo($f,"FillBucket",{omit:["layers","patternFeatures"]});const Hf=new ya({"fill-sort-key":new ga(De.layout_fill["fill-sort-key"]),visibility:new ma(De.layout_fill.visibility)});var qf={paint:new ya({"fill-antialias":new ma(De.paint_fill["fill-antialias"]),"fill-opacity":new ga(De.paint_fill["fill-opacity"]),"fill-color":new ga(De.paint_fill["fill-color"]),"fill-outline-color":new ga(De.paint_fill["fill-outline-color"]),"fill-translate":new ma(De.paint_fill["fill-translate"]),"fill-translate-anchor":new ma(De.paint_fill["fill-translate-anchor"]),"fill-pattern":new ga(De.paint_fill["fill-pattern"]),"fill-emissive-strength":new ma(De.paint_fill["fill-emissive-strength"])}),layout:Hf};const Wf=ka([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Gf=ka([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Zf=ka([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Yf=ka([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),Xf=ka([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Kf}=Wf;var Qf={},Jf=_,tm=em;function em(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(im,this,e)}function im(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function nm(t){for(var e,i,n=0,r=0,s=t.length,o=s-1;r<s;o=r++)n+=((i=t[o]).x-(e=t[r]).x)*(e.y+i.y);return n}em.types=["Unknown","Point","LineString","Polygon"],em.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,r=0,s=0,o=0,a=[];t.pos<i;){if(r<=0){var l=t.readVarint();n=7&l,r=l>>3}if(r--,1===n||2===n)s+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&a.push(e),e=[]),e.push(new Jf(s,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&a.push(e),a},em.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var h=t.readVarint();i=7&h,n=h>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<o&&(o=r),r>a&&(a=r),(s+=t.readSVarint())<l&&(l=s),s>c&&(c=s);else if(7!==i)throw new Error("unknown command "+i)}return[o,l,a,c]},em.prototype.toGeoJSON=function(t,e,i){var n,r,s=this.extent*Math.pow(2,i),o=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=em.types[this.type];function h(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+o)/s-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+a)/s)*Math.PI/180))-90]}}switch(this.type){case 1:var u=[];for(n=0;n<l.length;n++)u[n]=l[n][0];h(l=u);break;case 2:for(n=0;n<l.length;n++)h(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],s=0;s<e;s++){var o=nm(t[s]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(i&&r.push(i),i=[t[s]]):i.push(t[s]))}return i&&r.push(i),r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)h(l[n][r])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var rm=tm,sm=om;function om(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(am,this,e),this.length=this._features.length}function am(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}om.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new rm(this._pbf,e,this.extent,this._keys,this._values)};var lm=sm;function cm(t,e,i){if(3===t){var n=new lm(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var hm=Qf.VectorTile=function(t,e){this.layers=t.readFields(cm,{},e)},um=Qf.VectorTileFeature=tm;function dm(t,e,i,n){const r=[],s=0===n?(t,e,i,n,r,s)=>{t.push(new v(s,i+(s-e)/(n-e)*(r-i)))}:(t,e,i,n,r,s)=>{t.push(new v(e+(s-i)/(r-i)*(n-e),s))};for(const o of t){const t=[];for(const r of o){if(r.length<=2)continue;const o=[];for(let t=0;t<r.length-1;t++){const a=r[t].x,l=r[t].y,c=r[t+1].x,h=r[t+1].y,u=0===n?a:l,d=0===n?c:h;u<e?d>e&&s(o,a,l,c,h,e):u>i?d<i&&s(o,a,l,c,h,i):o.push(r[t]),d<e&&u>=e&&s(o,a,l,c,h,e),d>i&&u<=i&&s(o,a,l,c,h,i)}let a=r[r.length-1];const l=0===n?a.x:a.y;l>=e&&l<=i&&o.push(a),o.length&&(a=o[o.length-1],o[0].x===a.x&&o[0].y===a.y||o.push(o[0]),t.push(o))}t.length&&r.push(t)}return r}Qf.VectorTileLayer=sm;class pm{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){return this._numberToString[t]}}var fm={read:function(t,e,i,n,r){var s,o,a=8*r-n-1,l=(1<<a)-1,c=l>>1,h=-7,u=i?r-1:0,d=i?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=c}return(p?-1:1)*o*Math.pow(2,s-n)},write:function(t,e,i,n,r,s){var o,a,l,c=8*s-r-1,h=(1<<c)-1,u=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[i+p]=255&a,p+=f,a/=256,r-=8);for(o=o<<r|a,c+=r;c>0;t[i+p]=255&o,p+=f,o/=256,c-=8);t[i+p-f]|=128*m}},mm=_m,gm=fm;function _m(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_m.Varint=0,_m.Fixed64=1,_m.Bytes=2,_m.Fixed32=5;var ym=4294967296,vm=1/ym,bm="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function xm(t){return t.type===_m.Bytes?t.readVarint()+t.pos:t.pos+1}function wm(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Em(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Sm(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Tm(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Mm(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Am(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Cm(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function km(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Pm(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Im(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Dm(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Om(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Lm(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function zm(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}_m.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,s=this.pos;this.type=7&n,t(r,e,this),this.pos===s&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Om(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=zm(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Om(this.buf,this.pos)+Om(this.buf,this.pos+4)*ym;return this.pos+=8,t},readSFixed64:function(){var t=Om(this.buf,this.pos)+zm(this.buf,this.pos+4)*ym;return this.pos+=8,t},readFloat:function(){var t=gm.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=gm.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,s=i.buf;if(n=(112&(r=s[i.pos++]))>>4,r<128)return wm(t,n,e);if(n|=(127&(r=s[i.pos++]))<<3,r<128)return wm(t,n,e);if(n|=(127&(r=s[i.pos++]))<<10,r<128)return wm(t,n,e);if(n|=(127&(r=s[i.pos++]))<<17,r<128)return wm(t,n,e);if(n|=(127&(r=s[i.pos++]))<<24,r<128)return wm(t,n,e);if(n|=(1&(r=s[i.pos++]))<<31,r<128)return wm(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&bm?function(t,e,i){return bm.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var n="",r=e;r<i;){var s,o,a,l=t[r],c=null,h=l>239?4:l>223?3:l>191?2:1;if(r+h>i)break;1===h?l<128&&(c=l):2===h?128==(192&(s=t[r+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===h?(o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&s)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&((c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),r+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==_m.Bytes)return t.push(this.readVarint(e));var i=xm(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==_m.Bytes)return t.push(this.readSVarint());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==_m.Bytes)return t.push(this.readBoolean());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==_m.Bytes)return t.push(this.readFloat());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==_m.Bytes)return t.push(this.readDouble());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==_m.Bytes)return t.push(this.readFixed32());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==_m.Bytes)return t.push(this.readSFixed32());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==_m.Bytes)return t.push(this.readFixed64());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==_m.Bytes)return t.push(this.readSFixed64());var e=xm(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===_m.Varint)for(;this.buf[this.pos++]>127;);else if(e===_m.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_m.Fixed32)this.pos+=4;else{if(e!==_m.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Lm(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Lm(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Lm(this.buf,-1&t,this.pos),Lm(this.buf,Math.floor(t*vm),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Lm(this.buf,-1&t,this.pos),Lm(this.buf,Math.floor(t*vm),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,s=0;s<e.length;s++){if((n=e.charCodeAt(s))>55295&&n<57344){if(!r){n>56319||s+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Em(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),gm.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),gm.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Em(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,_m.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Sm,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Tm,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Cm,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Mm,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Am,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,km,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Pm,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Im,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Dm,e)},writeBytesField:function(t,e){this.writeTag(t,_m.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_m.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_m.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_m.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_m.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_m.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_m.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_m.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_m.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_m.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Rm=p(mm);const Fm=["tile","layer","source","sourceLayer","state"];class Bm{constructor(t,e,i,n,r){this.type="Feature",this._vectorTileFeature=t,this._z=e,this._x=i,this._y=n,this.properties=t.properties,this.id=r}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(t.id=this.id);for(const e of Fm)void 0!==this[e]&&(t[e]=this[e]);return t}}class Nm{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,e,i){const n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},R(this.stateChanges[t][n],i),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])i[e]||(this.deletedStates[t][n][e]=null)}else for(const e in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(i in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][i]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,e){const i=String(e),n=R({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const i=this.deletedStates[t][e];if(null===i)return{};for(const t in i)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,e){const i={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const e={};for(const i in this.stateChanges[t])this.state[t][i]||(this.state[t][i]={}),R(this.state[t][i],this.stateChanges[t][i]),e[i]=this.state[t][i];i[t]=e}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const e={};if(null===this.deletedStates[t])for(const i in this.state[t])e[i]={},this.state[t][i]={};else for(const i in this.deletedStates[t]){if(null===this.deletedStates[t][i])this.state[t][i]={};else if(this.state[t][i])for(const e of Object.keys(this.deletedStates[t][i]))delete this.state[t][i][e];e[i]=this.state[t][i]}i[t]=i[t]||{},R(i[t],e)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(const n in t)t[n].setFeatureState(i,e)}}class jm{constructor(t){this.size=t,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(t,e){const i=this.toIdx(t,e);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(t,e){return this.leaves[this.toIdx(t,e)]}toIdx(t,e){return e*this.size+t}}function Vm(t,e,i,n){let r=0,s=Number.MAX_VALUE;for(let o=0;o<3;o++)if(Math.abs(n[o])<1e-15){if(i[o]<t[o]||i[o]>e[o])return null}else{const a=1/n[o];let l=(t[o]-i[o])*a,c=(e[o]-i[o])*a;if(l>c){const t=l;l=c,c=t}if(l>r&&(r=l),c<s&&(s=c),r>s)return null}return r}function Um(t,e,i,n,r,s,o,a,l,c,h){const u=n-t,d=r-e,p=s-i,f=o-t,m=a-e,g=l-i,_=h[1]*g-h[2]*m,y=h[2]*f-h[0]*g,v=h[0]*m-h[1]*f,b=u*_+d*y+p*v;if(Math.abs(b)<1e-15)return null;const x=1/b,w=c[0]-t,E=c[1]-e,S=c[2]-i,T=(w*_+E*y+S*v)*x;if(T<0||T>1)return null;const M=E*p-S*d,A=S*u-w*p,C=w*d-E*u,k=(h[0]*M+h[1]*A+h[2]*C)*x;return k<0||T+k>1?null:(f*M+m*A+g*C)*x}function $m(t,e,i){return(t-e)/(i-e)}function Hm(t,e,i,n,r,s,o,a,l){const c=1<<i,h=s-n,u=o-r,d=(t+1)/c*h+n,p=(e+0)/c*u+r,f=(e+1)/c*u+r;a[0]=(t+0)/c*h+n,a[1]=p,l[0]=d,l[1]=f}class qm{constructor(t){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=t,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const e=function(t){const e=Math.ceil(Math.log2(t.dim/8)),i=[];let n=Math.ceil(Math.pow(2,e));const r=1/n,s=(t,e,i,n,r)=>{const s=n?1:0,o=(t+1)*i-s,a=e*i,l=(e+1)*i-s;r[0]=t*i,r[1]=a,r[2]=o,r[3]=l};let o=new jm(n);const a=[];for(let e=0;e<n*n;e++){s(e%n,Math.floor(e/n),r,!1,a);const i=Gm(a[0],a[1],t),l=Gm(a[2],a[1],t),c=Gm(a[2],a[3],t),h=Gm(a[0],a[3],t);o.minimums.push(Math.min(i,l,c,h)),o.maximums.push(Math.max(i,l,c,h)),o.leaves.push(1)}for(i.push(o),n/=2;n>=1;n/=2){const t=i[i.length-1];o=new jm(n);for(let e=0;e<n*n;e++){s(e%n,Math.floor(e/n),2,!0,a);const i=t.getElevation(a[0],a[1]),r=t.getElevation(a[2],a[1]),l=t.getElevation(a[2],a[3]),c=t.getElevation(a[0],a[3]),h=t.isLeaf(a[0],a[1]),u=t.isLeaf(a[2],a[1]),d=t.isLeaf(a[2],a[3]),p=t.isLeaf(a[0],a[3]),f=Math.min(i.min,r.min,l.min,c.min),m=Math.max(i.max,r.max,l.max,c.max),g=h&&u&&d&&p;o.maximums.push(m),o.minimums.push(f),o.leaves.push(m-f<=5&&g?1:0)}i.push(o)}return i}(this.dem),i=e.length-1,n=e[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(e,0,0,i,0)}raycastRoot(t,e,i,n,r,s,o=1){return Vm([t,e,-100],[i,n,this.maximums[0]*o],r,s)}raycast(t,e,i,n,r,s,o=1){if(!this.nodeCount)return null;const a=this.raycastRoot(t,e,i,n,r,s,o);if(null==a)return null;const l=[],c=[],h=[],u=[],d=[{idx:0,t:a,nodex:0,nodey:0,depth:0}];for(;d.length>0;){const{idx:a,t:p,nodex:f,nodey:m,depth:g}=d.pop();if(this.leaves[a]){Hm(f,m,g,t,e,i,n,h,u);const a=1<<g,l=(f+0)/a,c=(f+1)/a,d=(m+0)/a,_=(m+1)/a,y=Gm(l,d,this.dem)*o,v=Gm(c,d,this.dem)*o,b=Gm(c,_,this.dem)*o,x=Gm(l,_,this.dem)*o,w=Um(h[0],h[1],y,u[0],h[1],v,u[0],u[1],b,r,s),E=Um(u[0],u[1],b,h[0],u[1],x,h[0],h[1],y,r,s),S=Math.min(null!==w?w:Number.MAX_VALUE,null!==E?E:Number.MAX_VALUE);if(S!==Number.MAX_VALUE)return S;{const t=Ou.scaleAndAdd([],r,s,p);if(Wm(y,v,x,b,$m(t[0],h[0],u[0]),$m(t[1],h[1],u[1]))>=t[2])return p}continue}let _=0;for(let d=0;d<this._siblingOffset.length;d++){Hm((f<<1)+this._siblingOffset[d][0],(m<<1)+this._siblingOffset[d][1],g+1,t,e,i,n,h,u),h[2]=-100,u[2]=this.maximums[this.childOffsets[a]+d]*o;const p=Vm(h,u,r,s);if(null!=p){const t=p;l[d]=t;let e=!1;for(let i=0;i<_&&!e;i++)t>=l[c[i]]&&(c.splice(i,0,d),e=!0);e||(c[_]=d),_++}}for(let t=0;t<_;t++){const e=c[t];d.push({idx:this.childOffsets[a]+e,t:l[e],nodex:(f<<1)+this._siblingOffset[e][0],nodey:(m<<1)+this._siblingOffset[e][1],depth:g+1})}}return null}_addNode(t,e,i){return this.minimums.push(t),this.maximums.push(e),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(t,e,i,n,r){if(1===t[n].isLeaf(e,i))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const s=n-1,o=t[s];let a=0,l=0;for(let t=0;t<this._siblingOffset.length;t++){const n=2*e+this._siblingOffset[t][0],r=2*i+this._siblingOffset[t][1],s=o.getElevation(n,r),c=o.isLeaf(n,r),h=this._addNode(s.min,s.max,c);c&&(a|=1<<t),l||(l=h)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(t,2*e+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],s,l+n)}}function Wm(t,e,i,n,r,s){return Jn(Jn(t,i,s),Jn(e,n,s),r)}function Gm(t,e,i){const n=i.dim,r=I(t*n-.5,0,n-1),s=I(e*n-.5,0,n-1),o=Math.floor(r),a=Math.floor(s),l=Math.min(o+1,n-1),c=Math.min(a+1,n-1);return Wm(i.get(o,a),i.get(l,a),i.get(o,c),i.get(l,c),r-o,s-a)}const Zm={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Ym(t,e,i){return(256*t*256+256*e+i)/10-1e4}function Xm(t,e,i){return 256*t+e+i/256-32768}class Km{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(t,e,i,n=!1){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return Y(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=e.height;const r=this.dim=e.height-2,s=new Uint32Array(e.data.buffer);if(this.pixels=new Uint8Array(e.data.buffer),this.floatView=new Float32Array(e.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let t=0;t<r;t++)s[this._idx(-1,t)]=s[this._idx(0,t)],s[this._idx(r,t)]=s[this._idx(r-1,t)],s[this._idx(t,-1)]=s[this._idx(t,0)],s[this._idx(t,r)]=s[this._idx(t,r-1)];s[this._idx(-1,-1)]=s[this._idx(0,0)],s[this._idx(r,-1)]=s[this._idx(r-1,0)],s[this._idx(-1,r)]=s[this._idx(0,r-1)],s[this._idx(r,r)]=s[this._idx(r-1,r-1)]}const o="terrarium"===i?Xm:Ym;for(let t=0;t<s.length;++t){const e=4*t;this.floatView[t]=o(this.pixels[e],this.pixels[e+1],this.pixels[e+2])}this._timestamp=pe.now()}_buildQuadTree(){this._tree=new qm(this)}get(t,e,i=!1){i&&(t=I(t,-1,this.dim),e=I(e,-1,this.dim));const n=this._idx(t,e);return this.floatView[n]}set(t,e,i){const n=this._idx(t,e),r=this.floatView[n];return this.floatView[n]=i,i-r}static getUnpackVector(t){return Zm[t]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}static pack(t,e){const i=[0,0,0,0],n=Km.getUnpackVector(e);let r=Math.floor((t+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new nf({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,r=e*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(e){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:s=o-1;break;case 1:o=s+1}const a=-e*this.dim,l=-i*this.dim;for(let e=s;e<o;e++)for(let i=n;i<r;i++){const n=4*this._idx(i,e),r=4*this._idx(i+a,e+l);this.pixels[n+0]=t.pixels[r+0],this.pixels[n+1]=t.pixels[r+1],this.pixels[n+2]=t.pixels[r+2],this.pixels[n+3]=t.pixels[r+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Lo(Km,"DEMData"),Lo(qm,"DemMinMaxQuadTree",{omit:["dem"]});class Qm{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,n=1<<i,r=Math.floor(t.x),s=Math.floor((t.x-r)*n),o=Math.floor(t.y*n),a=this.findDEMTileFor(new qu(i,r,i,s,o));return!(!a||!a.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){if(this.isUsingMockSource())return null;null==e&&(e=null);const n=this._source();if(!n)return e;if(t.y<0||t.y>1)return e;const r=n.getSource().maxzoom,s=1<<r,o=Math.floor(t.x),a=t.x-o,l=new qu(r,o,r,Math.floor(a*s),Math.floor(t.y*s)),c=this.findDEMTileFor(l);if(!c||!c.dem)return e;const h=c.dem,u=1<<c.tileID.canonical.z,d=(a*u-c.tileID.canonical.x)*h.dim,p=(t.y*u-c.tileID.canonical.y)*h.dim,f=Math.floor(d),m=Math.floor(p);return(i?this.exaggeration():1)*Jn(Jn(h.get(f,m),h.get(f,m+1),p-m),Jn(h.get(f+1,m),h.get(f+1,m+1),p-m),d-f)}getAtTileOffset(t,e,i){const n=1<<t.canonical.z;return this.getAtPointOrZero(new cp(t.wrap+(t.canonical.x+e/un)/n,(t.canonical.y+i/un)/n))}getAtTileOffsetFunc(t,e,i,n){return r=>{const s=this.getAtTileOffset(t,r.x,r.y),o=n.upVector(t.canonical,r.x,r.y),a=n.upVectorScale(t.canonical,e,i).metersToTile;return Ou.scale(o,o,s*a),o}}getForTilePoints(t,e,i,n){if(this.isUsingMockSource())return!1;const r=Jm.create(this,t,n);return!!r&&(e.forEach((t=>{t[2]=this.exaggeration()*r.getElevationAt(t[0],t[1],i)})),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,r=1<<t.canonical.z-n.canonical.z;let s=t.canonical.x/r-n.canonical.x,o=t.canonical.y/r-n.canonical.y,a=0;for(let e=0;e<t.canonical.z-n.canonical.z&&!i.leaves[a];e++){s*=2,o*=2;const t=2*Math.floor(o)+Math.floor(s);a=i.childOffsets[a]+t,s%=1,o%=1}return{min:this.exaggeration()*i.minimums[a],max:this.exaggeration()*i.maximums[a]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,i){throw new Error("Pure virtual method called.")}pointCoordinate(t){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const t=this.visibleDemTiles;if(0===t.length)return null;let e=!1,i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(const r of t){const t=this.getMinMaxForTile(r.tileID);t&&(i=Math.min(i,t.min),n=Math.max(n,t.max),e=!0)}return e?{min:i,max:n}:null}}class Jm{constructor(t,e,i){this._demTile=t,this._dem=this._demTile.dem,this._scale=e,this._offset=i}static create(t,e,i){const n=i||t.findDEMTileFor(e);if(!n||!n.dem)return;const r=n.dem,s=n.tileID,o=1<<e.canonical.z-s.canonical.z;return new Jm(n,r.dim/un/o,[(e.canonical.x/o-s.canonical.x)*r.dim,(e.canonical.y/o-s.canonical.y)*r.dim])}tileCoordToPixel(t,e){const i=e*this._scale+this._offset[1],n=Math.floor(t*this._scale+this._offset[0]),r=Math.floor(i);return new v(n,r)}getElevationAt(t,e,i,n){const r=t*this._scale+this._offset[0],s=e*this._scale+this._offset[1],o=Math.floor(r),a=Math.floor(s),l=this._dem;return n=!!n,i?Jn(Jn(l.get(o,a,n),l.get(o,a+1,n),s-a),Jn(l.get(o+1,a,n),l.get(o+1,a+1,n),s-a),r-o):l.get(o,a,n)}getElevationAtPixel(t,e,i){return this._dem.get(t,e,!!i)}getMeterToDEM(t){return(1<<this._demTile.tileID.canonical.z)*tp(1,t)*this._dem.stride}}class tg{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Do(un,16,0),this.featureIndexArray=new gl,this.promoteId=e}insert(t,e,i,n,r,s=0){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r,s);const a=this.grid;for(let t=0;t<e.length;t++){const i=e[t],n=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){const e=i[t];n[0]=Math.min(n[0],e.x),n[1]=Math.min(n[1],e.y),n[2]=Math.max(n[2],e.x),n[3]=Math.max(n[3],e.y)}n[0]<un&&n[1]<un&&n[2]>=0&&n[3]>=0&&a.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new hm(new Rm(this.rawTileData)).layers,this.sourceLayerCoder=new pm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,e,i,n){this.loadVTLayers();const r=t.params||{},s=Bs(r.filter),o=t.tileResult,a=t.transform,l=o.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((t,e,i,n)=>Dp(o.bufferedTilespaceGeometry,t,e,i,n)));c.sort(ig);let h=null;a.elevation&&c.length>0&&(h=Jm.create(a.elevation,this.tileID));const u={};let d;for(let a=0;a<c.length;a++){const l=c[a];if(l===d)continue;d=l;const p=this.featureIndexArray.get(l);let f=null;this.loadMatchingFeature(u,p,s,r.layers,r.availableImages,e,i,n,((e,i,n,r=0)=>(f||(f=_p(e,this.tileID.canonical,t.tileTransform)),i.queryIntersectsFeature(o,e,n,f,this.z,t.transform,t.pixelPosMatrix,h,r))))}return u}loadMatchingFeature(t,e,i,n,r,s,o,a,l){const{featureIndex:c,bucketIndex:h,sourceLayerIndex:u,layoutVertexArrayOffset:d}=e,p=this.bucketLayerIDs[h];if(n&&!function(t,e){for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(n,p))return;const f=this.sourceLayerCoder.decode(u),m=this.vtLayers[f].feature(c);if(i.needGeometry){const t=yp(m,!0);if(!i.filter(new oa(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new oa(this.tileID.overscaledZ),m))return;const g=this.getId(m,f);for(let e=0;e<p.length;e++){const i=p[e];if(n&&n.indexOf(i)<0)continue;const h=s[i];if(!h)continue;let u={};void 0!==g&&a&&(u=a.getState(h.sourceLayer||"_geojsonTileLayer",g));const f=R({},o[i]);f.paint=eg(f.paint,h.paint,m,u,r),f.layout=eg(f.layout,h.layout,m,u,r);const _=!l||l(m,h,u,d);if(!_)continue;const y=new Bm(m,this.z,this.x,this.y,g);y.layer=f;let v=t[i];void 0===v&&(v=t[i]=[]),v.push({featureIndex:c,feature:y,intersectionZ:_})}}lookupSymbolFeatures(t,e,i,n,r,s,o,a){const l={};this.loadVTLayers();const c=Bs(r);for(const r of t)this.loadMatchingFeature(l,{bucketIndex:i,sourceLayerIndex:n,featureIndex:r,layoutVertexArrayOffset:0},c,s,o,a,e);return l}loadFeature(t){const{featureIndex:e,sourceLayerIndex:i}=t;this.loadVTLayers();const n=this.sourceLayerCoder.decode(i),r=this.vtFeatures[n];if(r[e])return r[e];const s=this.vtLayers[n].feature(e);return r[e]=s,s}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){let i=t.id;if(this.promoteId){const n="string"==typeof this.promoteId?this.promoteId:this.promoteId[e];null!=n&&(i=t.properties[n]),"boolean"==typeof i&&(i=Number(i))}return i}}function eg(t,e,i,n,r){return q(t,((t,s)=>{const o=e instanceof fa?e.get(s):null;return o&&o.evaluate?o.evaluate(i,n,r):o}))}function ig(t,e){return e-t}Lo(tg,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const ng=ka([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),rg=ka([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),sg=ka([{name:"a_projected_pos",components:4,type:"Float32"}],4);ka([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const og=ka([{name:"a_z_offset",components:1,type:"Float32"}],4),ag=ka([{name:"a_texb",components:2,type:"Uint16"}]),lg=ka([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),cg=ka([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_z_offset",components:1,type:"Float32"}]);ka([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const hg=ka([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ug=ka([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ka([{name:"triangle",components:3,type:"Uint16"}]),ka([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),ka([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),ka([{type:"Float32",name:"offsetX"}]),ka([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var dg=24;const pg=128;function fg(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new oa(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=i;let r=0;for(;r<e.length&&e[r]<=t;)r++;r=Math.max(0,r-1);let s=r;for(;s<e.length&&e[s]<t+1;)s++;s=Math.min(e.length-1,s);const o=e[r],a=e[s];return"composite"===i.kind?{kind:"composite",minZoom:o,maxZoom:a,interpolationType:n}:{kind:"camera",minZoom:o,maxZoom:a,minSize:i.evaluate(new oa(o)),maxSize:i.evaluate(new oa(a)),interpolationType:n}}}function mg(t,{uSize:e,uSizeT:i},{lowerSize:n,upperSize:r}){return"source"===t.kind?n/pg:"composite"===t.kind?Jn(n/pg,r/pg,i):e}function gg(t,e){let i=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:r,minZoom:s,maxZoom:o}=t,a=r?I(wr.interpolationFactor(r,e,s,o),0,1):0;"camera"===t.kind?n=Jn(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:n}}var _g=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:pg,evaluateSizeForFeature:mg,evaluateSizeForZoom:gg,getSizeData:fg});function yg(t,e,i){return t.sections.forEach((t=>{t.text=function(t,e,i){const n=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),sa.applyArabicShaping&&(t=sa.applyArabicShaping(t)),t}(t.text,e,i)})),t}const vg={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function bg(t){return"︶"===t||"﹈"===t||"︸"===t||"﹄"===t||"﹂"===t||"︾"===t||"︼"===t||"︺"===t||"︘"===t||"﹀"===t||"︐"===t||"︓"===t||"︔"===t||"`"===t||" ̄"===t||"︑"===t||"︒"===t}function xg(t){return"︵"===t||"﹇"===t||"︷"===t||"﹃"===t||"﹁"===t||"︽"===t||"︻"===t||"︹"===t||"︗"===t||"︿"===t}const wg=3;function Eg(t,e,i){e.glyphs=[],1===t&&i.readMessage(Sg,e)}function Sg(t,e,i){if(3===t){const{id:t,bitmap:n,width:r,height:s,left:o,top:a,advance:l}=i.readMessage(Tg,{});e.glyphs.push({id:t,bitmap:new tf({width:r+2*wg,height:s+2*wg},n),metrics:{width:r,height:s,left:o,top:a,advance:l}})}else 4===t?e.ascender=i.readSVarint():5===t&&(e.descender=i.readSVarint())}function Tg(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}const Mg=wg,Ag={horizontal:1,vertical:2,horizontalOnly:3},Cg=-17;class kg{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const i=new kg;return i.scale=t||1,i.fontStack=e,i}static forImage(t){const e=new kg;return e.imageName=t,e}}class Pg{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new Pg;for(let n=0;n<t.sections.length;n++){const r=t.sections[n];r.image?i.addImageSection(r):i.addTextSection(r,e)}return i}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSections(){return this.sections}getSectionIndex(t){return this.sectionIndex[t]}getCodePoint(t){return this.text.codePointAt(t)}verticalizePunctuation(t){this.text=function(t,e){let i="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n+1)||null,s=t.charCodeAt(n-1)||null;i+=!e&&(r&&Ho(r)&&!vg[t[n+1]]||s&&Ho(s)&&!vg[t[n-1]])||!vg[t[n]]?t[n]:vg[t[n]]}return i}(this.text,t)}trim(){let t=0;for(let e=0;e<this.text.length&&Dg[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let i=this.text.length-1;i>=0&&i>=t&&Dg[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new Pg;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(kg.forText(t.scale,t.fontStack||e));const i=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(i)}addImageSection(t){const e=t.image?t.image.namePrimary:"";if(0===e.length)return void Y("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCodePoint(i),this.sections.push(kg.forImage(e)),this.sectionIndex.push(this.sections.length-1)):Y("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ig(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f){const m=Pg.fromFeature(t,r);u===Ag.vertical&&m.verticalizePunctuation(d);let g=[];const _=function(t,e,i,n,r,s){if(!t)return[];const o=[],a=function(t,e,i,n,r,s){let o=0;for(let i=0;i<t.length();i++){const a=t.getSection(i);o+=Lg(t.getCodePoint(i),a,n,r,e,s)}return o/Math.max(1,Math.ceil(o/i))}(t,e,i,n,r,s),l=t.text.indexOf("")>=0;let c=0;for(let i=0;i<t.length();i++){const u=t.getSection(i),d=t.getCodePoint(i);if(Dg[d]||(c+=Lg(d,u,n,r,e,s)),i<t.length()-1){const e=!((h=d)<11904||!(No["Bopomofo Extended"](h)||No.Bopomofo(h)||No["CJK Compatibility Forms"](h)||No["CJK Compatibility Ideographs"](h)||No["CJK Compatibility"](h)||No["CJK Radicals Supplement"](h)||No["CJK Strokes"](h)||No["CJK Symbols and Punctuation"](h)||No["CJK Unified Ideographs Extension A"](h)||No["CJK Unified Ideographs"](h)||No["Enclosed CJK Letters and Months"](h)||No["Halfwidth and Fullwidth Forms"](h)||No.Hiragana(h)||No["Ideographic Description Characters"](h)||No["Kangxi Radicals"](h)||No["Katakana Phonetic Extensions"](h)||No.Katakana(h)||No["Vertical Forms"](h)||No["Yi Radicals"](h)||No["Yi Syllables"](h)));(Og[d]||e||u.imageName)&&o.push(Fg(i+1,c,a,o,Rg(d,t.getCodePoint(i+1),e&&l),!1))}}var h;return Bg(Fg(t.length(),c,a,o,0,!0))}(m,c,s,e,n,p),{processBidirectionalText:y,processStyledBidirectionalText:v}=sa;if(y&&1===m.sections.length){const t=y(m.toString(),_);for(const e of t){const t=new Pg;t.text=e,t.sections=m.sections;for(let i=0;i<e.length;i++)t.sectionIndex.push(0);g.push(t)}}else if(v){const t=v(m.text,m.sectionIndex,_);for(const e of t){const t=new Pg;t.text=e[0],t.sectionIndex=e[1],t.sections=m.sections,g.push(t)}}else g=function(t,e){const i=[],n=t.text;let r=0;for(const n of e)i.push(t.substring(r,n)),r=n;return r<n.length&&i.push(t.substring(r,n.length)),i}(m,_);const b=[],x={positionedLines:b,text:m.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:u,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(t,e,i,n,r,s,o,a,l,c,h,u){let d=0,p=0,f=0;const m="right"===a?1:"left"===a?0:.5;let g=!1;for(const t of r){const i=t.getSections();for(const t of i){if(t.imageName)continue;const i=e[t.fontStack];if(i&&(g=void 0!==i.ascender&&void 0!==i.descender,!g))break}if(!g)break}let _=0;for(const o of r){o.trim();const r=o.getMaxScale(),a=(r-1)*dg,v={positionedGlyphs:[],lineOffset:0};t.positionedLines[_]=v;const b=v.positionedGlyphs;let x=0;if(!o.length()){p+=s,++_;continue}let w=0,E=0;for(let s=0;s<o.length();s++){const a=o.getSection(s),f=o.getSectionIndex(s),m=o.getCodePoint(s);let _=a.scale,v=null,S=null,T=null,M=dg,A=0;const C=!(l===Ag.horizontal||!h&&!$o(m)||h&&(Dg[m]||(y=m,No.Arabic(y)||No["Arabic Supplement"](y)||No["Arabic Extended-A"](y)||No["Arabic Presentation Forms-A"](y)||No["Arabic Presentation Forms-B"](y))));if(a.imageName){const e=n[a.imageName];if(!e)continue;T=a.imageName,t.iconsInText=t.iconsInText||!0,S=e.paddedRect;const i=e.displaySize;_=_*dg/u,v={width:i[0],height:i[1],left:0,top:-Mg,advance:C?i[1]:i[0],localGlyph:!1},A=g?-v.height*_:Cg+r*dg-i[1]*_,M=v.advance;const s=(C?i[0]:i[1])*_-dg*r;s>0&&s>x&&(x=s)}else{const t=i[a.fontStack];if(!t)continue;t[m]&&(S=t[m]);const n=e[a.fontStack];if(!n)continue;const s=n.glyphs[m];if(!s)continue;if(v=s.metrics,M=8203!==m?dg:0,g){const t=void 0!==n.ascender?Math.abs(n.ascender):0,e=void 0!==n.descender?Math.abs(n.descender):0,i=(t+e)*_;w<i&&(w=i,E=(t-e)/2*_),A=-t*_}else A=Cg+(r-_)*dg}C?(t.verticalizable=!0,b.push({glyph:m,imageName:T,x:d,y:p+A,vertical:C,scale:_,localGlyph:v.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:v,rect:S}),d+=M*_+c):(b.push({glyph:m,imageName:T,x:d,y:p+A,vertical:C,scale:_,localGlyph:v.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:v,rect:S}),d+=v.advance*_+c)}0!==b.length&&(f=Math.max(d-c,f),g?jg(b,m,x,E,s*r/2):jg(b,m,x,0,s/2)),d=0;const S=s*r+x;v.lineOffset=Math.max(x,a),p+=S,++_}var y;const v=p,{horizontalAlign:b,verticalAlign:x}=Ng(o);(function(t,e,i,n,r,s){const o=(e-i)*r,a=-s*n;for(const e of t)for(const t of e.positionedGlyphs)t.x+=o,t.y+=a})(t.positionedLines,m,b,x,f,v),t.top+=-x*v,t.bottom=t.top+v,t.left+=-b*f,t.right=t.left+f,t.hasBaseline=g}(x,e,i,n,g,o,a,l,u,c,d,f),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(b)&&x}const Dg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Og={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Lg(t,e,i,n,r,s){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*dg/s+r:0}{const n=i[e.fontStack],s=n&&n.glyphs[t];return s?s.metrics.advance*e.scale+r:0}}function zg(t,e,i,n){const r=Math.pow(t-e,2);return n?t<e?r/2:2*r:r+Math.abs(i)*i}function Rg(t,e,i){let n=0;return 10===t&&(n-=1e4),i&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Fg(t,e,i,n,r,s){let o=null,a=zg(e,i,r,s);for(const t of n){const n=zg(e-t.x,i,r,s)+t.badness;n<=a&&(o=t,a=n)}return{index:t,x:e,priorBreak:o,badness:a}}function Bg(t){return t?Bg(t.priorBreak).concat(t.index):[]}function Ng(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function jg(t,e,i,n,r){if(!(e||i||n||r))return;const s=t.length-1,o=t[s],a=(o.x+o.metrics.advance*o.scale)*e;for(let e=0;e<=s;e++)t[e].x-=a,t[e].y+=i+n+r}function Vg(t,e,i,n){const{horizontalAlign:r,verticalAlign:s}=Ng(n),o=i[0]-t.displaySize[0]*r,a=i[1]-t.displaySize[1]*s;return{imagePrimary:t,imageSecondary:e,top:a,bottom:a+t.displaySize[1],left:o,right:o+t.displaySize[0]}}function Ug(t,e,i,n,r,s){const o=t.imagePrimary;let a;if(o.content){const t=o.content,e=o.pixelRatio||1;a=[t[0]/e,t[1]/e,o.displaySize[0]-t[2]/e,o.displaySize[1]-t[3]/e]}const l=e.left*s,c=e.right*s;let h,u,d,p;"width"===i||"both"===i?(p=r[0]+l-n[3],u=r[0]+c+n[1]):(p=r[0]+(l+c-o.displaySize[0])/2,u=p+o.displaySize[0]);const f=e.top*s,m=e.bottom*s;return"height"===i||"both"===i?(h=r[1]+f-n[0],d=r[1]+m+n[2]):(h=r[1]+(f+m-o.displaySize[1])/2,d=h+o.displaySize[1]),{imagePrimary:o,imageSecondary:void 0,top:h,right:u,bottom:d,left:p,collisionPadding:a}}class $g extends v{constructor(t,e,i,n,r){super(t,e),this.angle=n,this.z=i,void 0!==r&&(this.segment=r)}clone(){return new $g(this.x,this.y,this.z,this.angle,this.segment)}}function Hg(t,e,i,n,r){if(void 0===e.segment)return!0;let s=e,o=e.segment+1,a=0;for(;a>-i/2;){if(o--,o<0)return!1;a-=t[o].dist(s),s=t[o]}a+=t[o].dist(t[o+1]),o++;const l=[];let c=0;for(;a<i/2;){const e=t[o],i=t[o+1];if(!i)return!1;let s=t[o-1].angleTo(e)-e.angleTo(i);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:s}),c+=s;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;o++,a+=e.dist(i)}return!0}function qg(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Wg(t,e,i){return t?.6*e*i:0}function Gg(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Zg(t,e,i,n,r,s){const o=Wg(i,r,s),a=Gg(i,n)*s;let l=0;const c=qg(t)/2;for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1],s=n.dist(r);if(l+s>c){const h=(c-l)/s,u=Jn(n.x,r.x,h),d=Jn(n.y,r.y,h),p=new $g(u,d,0,r.angleTo(n),i);return!o||Hg(t,p,a,o,e)?p:void 0}l+=s}}function Yg(t,e,i,n,r,s,o,a,l){const c=Wg(n,s,o),h=Gg(n,r),u=h*o,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-u<e/4&&(e=u+e/4),Xg(t,d?e/2*a%e:(h/2+2*s)*o*a%e,e,c,i,u,d,!1,l)}function Xg(t,e,i,n,r,s,o,a,l){const c=s/2,h=qg(t);let u=0,d=e-i,p=[];for(let e=0;e<t.length-1;e++){const o=t[e],a=t[e+1],f=o.dist(a),m=a.angleTo(o);for(;d+i<u+f;){d+=i;const g=(d-u)/f,_=Jn(o.x,a.x,g),y=Jn(o.y,a.y,g);if(_>=0&&_<l&&y>=0&&y<l&&d-c>=0&&d+c<=h){const i=new $g(_,y,0,m,e);n&&!Hg(t,i,s,n,r)||p.push(i)}}u+=f}return a||p.length||o||(p=Xg(t,u/2,i,n,r,s,o,!0,l)),p}function Kg(t,e,i,n,r){const s=[];for(let o=0;o<t.length;o++){const a=t[o];let l;for(let t=0;t<a.length-1;t++){let o=a[t],c=a[t+1];o.x<e&&c.x<e||(o.x<e?o=new v(e,o.y+(e-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x<e&&(c=new v(e,o.y+(e-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y<i&&c.y<i||(o.y<i?o=new v(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round():c.y<i&&(c=new v(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round()),o.x>=n&&c.x>=n||(o.x>=n?o=new v(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x>=n&&(c=new v(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y>=r&&c.y>=r||(o.y>=r?o=new v(o.x+(r-o.y)/(c.y-o.y)*(c.x-o.x),r)._round():c.y>=r&&(c=new v(o.x+(r-o.y)/(c.y-o.y)*(c.x-o.x),r)._round()),l&&o.equals(l[l.length-1])||(l=[o],s.push(l)),l.push(c)))))}}return s}function Qg(t){let e=0,i=0;for(const n of t)e+=n.w*n.h,i=Math.max(i,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let r=0,s=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const i=n[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,s=Math.max(s,e.y+e.h),r=Math.max(r,e.x+e.w),e.w===i.w&&e.h===i.h){const e=n.pop();t<n.length&&(n[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(n.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:r,h:s,fill:e/(r*s)||0}}Lo($g,"Anchor");const Jg=1;class t_{constructor(t,{pixelRatio:e,version:i,stretchX:n,stretchY:r,content:s}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=r,this.content=s,this.version=i}get tl(){return[this.paddedRect.x+Jg,this.paddedRect.y+Jg]}get br(){return[this.paddedRect.x+this.paddedRect.w-Jg,this.paddedRect.y+this.paddedRect.h-Jg]}get displaySize(){return[(this.paddedRect.w-2*Jg)/this.pixelRatio,(this.paddedRect.h-2*Jg)/this.pixelRatio]}}class e_{constructor(t,e){const i={},n={};this.haveRenderCallbacks=[];const r=[];this.addImages(t,i,r),this.addImages(e,n,r);const{w:s,h:o}=Qg(r),a=new ef({width:s||1,height:o||1});for(const e in t){const n=t[e],r=i[e].paddedRect;ef.copy(n.data,a,{x:0,y:0},{x:r.x+Jg,y:r.y+Jg},n.data)}for(const t in e){const i=e[t],r=n[t].paddedRect,s=r.x+Jg,o=r.y+Jg,l=i.data.width,c=i.data.height;ef.copy(i.data,a,{x:0,y:0},{x:s,y:o},i.data),ef.copy(i.data,a,{x:0,y:c-1},{x:s,y:o-1},{width:l,height:1}),ef.copy(i.data,a,{x:0,y:0},{x:s,y:o+c},{width:l,height:1}),ef.copy(i.data,a,{x:l-1,y:0},{x:s-1,y:o},{width:1,height:c}),ef.copy(i.data,a,{x:0,y:0},{x:s+l,y:o},{width:1,height:c})}this.image=a,this.iconPositions=i,this.patternPositions=n}addImages(t,e,i){for(const n in t){const r=t[n],s={x:0,y:0,w:r.data.width+2*Jg,h:r.data.height+2*Jg};i.push(s),e[n]=new t_(s,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,e,i){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((e=>t.hasImage(e,i))),t.dispatchRenderCallbacks(this.haveRenderCallbacks,i);for(const n in t.getUpdatedImages(i))this.patchUpdatedImage(this.iconPositions[n],t.getImage(n,i),e),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n,i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,r]=t.tl;i.update(e.data,void 0,{x:n,y:r})}}Lo(t_,"ImagePosition"),Lo(e_,"ImageAtlas");const i_=1e20;function n_(t,e,i,n,r,s,o,a,l){for(let c=e;c<e+n;c++)r_(t,i*s+c,s,r,o,a,l);for(let c=i;c<i+r;c++)r_(t,c*s+e,1,n,o,a,l)}function r_(t,e,i,n,r,s,o){s[0]=0,o[0]=-i_,o[1]=i_,r[0]=t[e];for(let a=1,l=0,c=0;a<n;a++){r[a]=t[e+a*i];const n=a*a;do{const t=s[l];c=(r[a]-r[t]+n-t*t)/(a-t)/2}while(c<=o[l]&&--l>-1);l++,s[l]=a,o[l]=c,o[l+1]=i_}for(let a=0,l=0;a<n;a++){for(;o[l+1]<a;)l++;const n=s[l],c=a-n;t[e+a*i]=r[n]+c*c}}const s_=2;class o_{constructor(t,e,i){this.requestManager=t,this.localGlyphMode=e,this.localFontFamily=i,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(t,e){this.urls[e]=t}getGlyphs(t,e,i){const n=[],r=this.urls[e]||s.GLYPHS_URL;for(const e in t)for(const i of t[e])n.push({stack:e,id:i});L(n,(({stack:t,id:e},i)=>{let n=this.entries[t];n||(n=this.entries[t]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let s=n.glyphs[e];if(void 0!==s)return void i(null,{stack:t,id:e,glyph:s});if(s=this._tinySDF(n,t,e),s)return n.glyphs[e]=s,void i(null,{stack:t,id:e,glyph:s});const o=Math.floor(e/256);if(256*o>65535)return void i(new Error("glyphs > 65535 not supported"));if(n.ranges[o])return void i(null,{stack:t,id:e,glyph:s});let a=n.requests[o];a||(a=n.requests[o]=[],o_.loadGlyphRange(t,o,r,this.requestManager,((t,e)=>{if(e){n.ascender=e.ascender,n.descender=e.descender;for(const t in e.glyphs)this._doesCharSupportLocalGlyph(+t)||(n.glyphs[+t]=e.glyphs[+t]);n.ranges[o]=!0}for(const i of a)i(t,e);delete n.requests[o]}))),a.push(((n,r)=>{n?i(n):r&&i(null,{stack:t,id:e,glyph:r.glyphs[e]||null})}))}),((t,e)=>{if(t)i(t);else if(e){const t={};for(const{stack:i,id:n,glyph:r}of e)void 0===t[i]&&(t[i]={}),void 0===t[i].glyphs&&(t[i].glyphs={}),t[i].glyphs[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},t[i].ascender=this.entries[i].ascender,t[i].descender=this.entries[i].descender;i(null,t)}}))}_doesCharSupportLocalGlyph(t){return 0!==this.localGlyphMode&&(2===this.localGlyphMode?!!this.localFontFamily:!!this.localFontFamily&&(No["CJK Unified Ideographs"](t)||No["Hangul Syllables"](t)||No.Hiragana(t)||No.Katakana(t)||No["CJK Symbols and Punctuation"](t)||No["CJK Unified Ideographs Extension A"](t)||No["CJK Unified Ideographs Extension B"](t)))}_tinySDF(t,e,i){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let r=t.tinySDF;if(!r){let i="400";/bold/i.test(e)?i="900":/medium/i.test(e)?i="500":/light/i.test(e)&&(i="200"),r=t.tinySDF=new o_.TinySDF({fontFamily:n,fontWeight:i,fontSize:24*s_,buffer:3*s_,radius:8*s_}),r.fontWeight=i}if(this.localGlyphs[r.fontWeight][i])return this.localGlyphs[r.fontWeight][i];const s=String.fromCodePoint(i),{data:o,width:a,height:l,glyphWidth:c,glyphHeight:h,glyphLeft:u,glyphTop:d,glyphAdvance:p}=r.draw(s);return this.localGlyphs[r.fontWeight][i]={id:i,bitmap:new tf({width:a,height:l},o),metrics:{width:c/s_,height:h/s_,left:u/s_,top:d/s_-27,advance:p/s_,localGlyph:!0}}}}o_.loadGlyphRange=function(t,e,i,n,r){const s=256*e,o=s+255,a=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${s}-${o}`),vt.Glyphs);St(a,((t,e)=>{if(t)r(t);else if(e){const t={},i=function(t){return new Rm(t).readFields(Eg,{})}(e);for(const e of i.glyphs)t[e.id]=e;r(null,{glyphs:t,ascender:i.ascender,descender:i.descender})}}))},o_.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:r="sans-serif",fontWeight:s="normal",fontStyle:o="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=i;const a=this.size=t+4*e,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${s} ${t}px ${r}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:r,actualBoundingBoxRight:s}=this.ctx.measureText(t),o=Math.ceil(i),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s-r))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=a+2*this.buffer,h=l+2*this.buffer,u=Math.max(c*h,0),d=new Uint8ClampedArray(u),p={data:d,width:c,height:h,glyphWidth:a,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===a||0===l)return p;const{ctx:f,buffer:m,gridInner:g,gridOuter:_}=this;f.clearRect(m,m,a,l),f.fillText(t,m,m+o);const y=f.getImageData(m,m,a,l);_.fill(i_,0,u),g.fill(0,0,u);for(let t=0;t<l;t++)for(let e=0;e<a;e++){const i=y.data[4*(t*a+e)+3]/255;if(0===i)continue;const n=(t+m)*c+e+m;if(1===i)_[n]=0,g[n]=i_;else{const t=.5-i;_[n]=t>0?t*t:0,g[n]=t<0?t*t:0}}n_(_,0,0,c,h,c,this.f,this.v,this.z),n_(g,m,m,a,l,c,this.f,this.v,this.z);for(let t=0;t<u;t++){const e=Math.sqrt(_[t])-Math.sqrt(g[t]);d[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return p}};const a_=Jg;function l_(t,e,i,n){const r=[],s=t.imagePrimary,o=s.pixelRatio,a=s.paddedRect.w-2*a_,l=s.paddedRect.h-2*a_,c=t.right-t.left,h=t.bottom-t.top,u=s.stretchX||[[0,a]],d=s.stretchY||[[0,l]],p=(t,e)=>t+e[1]-e[0],f=u.reduce(p,0),m=d.reduce(p,0),g=a-f,_=l-m;let y=0,b=f,x=0,w=m,E=0,S=g,T=0,M=_;if(s.content&&n){const t=s.content;y=c_(u,0,t[0]),x=c_(d,0,t[1]),b=c_(u,t[0],t[2]),w=c_(d,t[1],t[3]),E=t[0]-y,T=t[1]-x,S=t[2]-t[0]-b,M=t[3]-t[1]-w}const A=(n,r,a,l)=>{const u=u_(n.stretch-y,b,c,t.left),d=d_(n.fixed-E,S,n.stretch,f),p=u_(r.stretch-x,w,h,t.top),g=d_(r.fixed-T,M,r.stretch,m),_=u_(a.stretch-y,b,c,t.left),A=d_(a.fixed-E,S,a.stretch,f),C=u_(l.stretch-x,w,h,t.top),k=d_(l.fixed-T,M,l.stretch,m),P=new v(u,p),I=new v(_,p),D=new v(_,C),O=new v(u,C),L=new v(d/o,g/o),z=new v(A/o,k/o),R=e*Math.PI/180;if(R){const t=Math.sin(R),e=Math.cos(R),i=[e,-t,t,e];P._matMult(i),I._matMult(i),O._matMult(i),D._matMult(i)}const F=n.stretch+n.fixed,B=a.stretch+a.fixed,N=r.stretch+r.fixed,j=l.stretch+l.fixed,V=t.imageSecondary;return{tl:P,tr:I,bl:O,br:D,texPrimary:{x:s.paddedRect.x+a_+F,y:s.paddedRect.y+a_+N,w:B-F,h:j-N},texSecondary:V?{x:V.paddedRect.x+a_+F,y:V.paddedRect.y+a_+N,w:B-F,h:j-N}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:z,minFontScaleX:S/o/c,minFontScaleY:M/o/h,isSDF:i}};if(n&&(s.stretchX||s.stretchY)){const t=h_(u,g,f),e=h_(d,_,m);for(let i=0;i<t.length-1;i++){const n=t[i],s=t[i+1];for(let t=0;t<e.length-1;t++)r.push(A(n,e[t],s,e[t+1]))}}else r.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:a+1},{fixed:0,stretch:l+1}));return r}function c_(t,e,i){let n=0;for(const r of t)n+=Math.max(e,Math.min(i,r[1]))-Math.max(e,Math.min(i,r[0]));return n}function h_(t,e,i){const n=[{fixed:-a_,stretch:0}];for(const[e,i]of t){const t=n[n.length-1];n.push({fixed:e-t.stretch,stretch:t.stretch}),n.push({fixed:e-t.stretch,stretch:t.stretch+(i-e)})}return n.push({fixed:e+a_,stretch:i}),n}function u_(t,e,i,n){return t/e*i+n}function d_(t,e,i,n){return t-e*i/n}function p_(t,e,i,n){const r=e+t.positionedLines[n].lineOffset;return 0===n?i+r/2:i+(r+(e+t.positionedLines[n-1].lineOffset))/2}function f_(t,e=1,i=!1){let n=1/0,r=1/0,s=-1/0,o=-1/0;const a=t[0];for(let t=0;t<a.length;t++){const e=a[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<r)&&(r=e.y),(!t||e.x>s)&&(s=e.x),(!t||e.y>o)&&(o=e.y)}const l=Math.min(s-n,o-r);let c=l/2;const h=new hn([],m_);if(0===l)return new v(n,r);for(let e=n;e<s;e+=l)for(let i=r;i<o;i+=l)h.push(new g_(e+c,i+c,c,t));let u=function(t){let e=0,i=0,n=0;const r=t[0];for(let t=0,s=r.length,o=s-1;t<s;o=t++){const s=r[t],a=r[o],l=s.x*a.y-a.x*s.y;i+=(s.x+a.x)*l,n+=(s.y+a.y)*l,e+=3*l}return new g_(i/e,n/e,0,t)}(t),d=h.length;for(;h.length;){const n=h.pop();(n.d>u.d||!u.d)&&(u=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-u.d<=e||(c=n.h/2,h.push(new g_(n.p.x-c,n.p.y-c,c,t)),h.push(new g_(n.p.x+c,n.p.y-c,c,t)),h.push(new g_(n.p.x-c,n.p.y+c,c,t)),h.push(new g_(n.p.x+c,n.p.y+c,c,t)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${u.d}`)),u.p}function m_(t,e){return e.max-t.max}class g_{constructor(t,e,i,n){this.p=new v(t,e),this.h=i,this.d=function(t,e){let i=!1,n=1/0;for(let r=0;r<e.length;r++){const s=e[r];for(let e=0,r=s.length,o=r-1;e<r;o=e++){const r=s[e],a=s[o];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,kp(t,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const __=7,y_=Number.POSITIVE_INFINITY,v_=Math.sqrt(2);function b_(t,[e,i]){let n=0,r=0;if(i===y_){e<0&&(e=0);const i=e/v_;switch(t){case"top-right":case"top-left":r=i-__;break;case"bottom-right":case"bottom-left":r=-i+__;break;case"bottom":r=-e+__;break;case"top":r=e-__}switch(t){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=e;break;case"right":n=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":r=i-__;break;case"bottom-right":case"bottom-left":case"bottom":r=-i+__}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}}return[n,r]}function x_(t,e,i,n,r,s,o,a,l,c,h){t.createArrays(),t.tilePixelRatio=un/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const u=t.layers[0].layout,d=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){const{minZoom:e,maxZoom:i}=t.textSizeData;p.compositeTextSizes=[d["text-size"].possiblyEvaluate(new oa(e),a),d["text-size"].possiblyEvaluate(new oa(i),a)]}if("composite"===t.iconSizeData.kind){const{minZoom:e,maxZoom:i}=t.iconSizeData;p.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new oa(e),a),d["icon-size"].possiblyEvaluate(new oa(i),a)]}p.layoutTextSize=d["text-size"].possiblyEvaluate(new oa(l+1),a),p.layoutIconSize=d["icon-size"].possiblyEvaluate(new oa(l+1),a),p.textMaxSize=d["text-size"].possiblyEvaluate(new oa(18),a);const f="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),m=u.get("text-size");let g=!1;for(const e of t.features)if(e.icon&&e.icon.nameSecondary){g=!0;break}for(const s of t.features){const l=u.get("text-font").evaluate(s,{},a).join(","),d=m.evaluate(s,{},a),_=p.layoutTextSize.evaluate(s,{},a),y=(p.layoutIconSize.evaluate(s,{},a),{horizontal:{},vertical:void 0}),v=s.text;let b,x=[0,0];if(v){const n=v.toString(),o=u.get("text-letter-spacing").evaluate(s,{},a)*dg,c=u.get("text-line-height").evaluate(s,{},a)*dg,h=Vo(n)?o:0,p=u.get("text-anchor").evaluate(s,{},a),m=u.get("text-variable-anchor");if(!m){const t=u.get("text-radial-offset").evaluate(s,{},a);x=t?b_(p,[t*dg,y_]):u.get("text-offset").evaluate(s,{},a).map((t=>t*dg))}let g=f?"center":u.get("text-justify").evaluate(s,{},a);const b="point"===u.get("symbol-placement"),w=b?u.get("text-max-width").evaluate(s,{},a)*dg:1/0,E=s=>{t.allowVerticalPlacement&&jo(n)&&(y.vertical=Ig(v,e,i,r,l,w,c,p,s,h,x,Ag.vertical,!0,_,d))};if(!f&&m){const t="auto"===g?m.map((t=>w_(t))):[g];let n=!1;for(let s=0;s<t.length;s++){const o=t[s];if(!y.horizontal[o])if(n)y.horizontal[o]=y.horizontal[0];else{const t=Ig(v,e,i,r,l,w,c,"center",o,h,x,Ag.horizontal,!1,_,d);t&&(y.horizontal[o]=t,n=1===t.positionedLines.length)}}E("left")}else{if("auto"===g&&(g=w_(p)),b||u.get("text-writing-mode").indexOf("horizontal")>=0||!jo(n)){const t=Ig(v,e,i,r,l,w,c,p,g,h,x,Ag.horizontal,!1,_,d);t&&(y.horizontal[g]=t)}E(b?"left":g)}}let w=!1;if(s.icon&&s.icon.namePrimary){const e=n[s.icon.namePrimary];e&&(b=Vg(r[s.icon.namePrimary],s.icon.nameSecondary?r[s.icon.nameSecondary]:void 0,u.get("icon-offset").evaluate(s,{},a),u.get("icon-anchor").evaluate(s,{},a)),w=e.sdf,void 0===t.sdfIcons?t.sdfIcons=e.sdf:t.sdfIcons!==e.sdf&&Y("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}const E=A_(y.horizontal)||y.vertical;t.iconsInText||(t.iconsInText=!!E&&E.iconsInText),(E||b)&&E_(t,s,y,b,n,p,_,0,x,w,o,a,c,h,g)}s&&t.generateCollisionDebugBuffers(l,t.collisionBoxArray)}function w_(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function E_(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f){let m=s.textMaxSize.evaluate(e,{},u);void 0===m&&(m=o);const g=t.layers[0].layout,_=g.get("icon-offset").evaluate(e,{},u),y=A_(i.horizontal)||i.vertical,v="globe"===d.name,b=dg,x=o/b,w=t.tilePixelRatio*m/b,S=(D=t.overscaling,t.zoom>18&&D>2&&(D>>=1),Math.max(un/(512*D),1)*g.get("symbol-spacing")),T=g.get("text-padding")*t.tilePixelRatio,M=g.get("icon-padding")*t.tilePixelRatio,A=E(g.get("text-max-angle")),C="map"===g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),k="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),P=g.get("symbol-placement"),I=S/2;var D;const O=g.get("icon-text-fit").evaluate(e,{},u),L=g.get("icon-text-fit-padding").evaluate(e,{},u),z="none"!==O;let R;!1===t.hasAnyIconTextFit&&z&&(t.hasAnyIconTextFit=!0),n&&z&&(t.allowVerticalPlacement&&i.vertical&&(R=Ug(n,i.vertical,O,L,_,x)),y&&(n=Ug(n,y,O,L,_,x)));const F=(o,a,m)=>{if(a.x<0||a.x>=un||a.y<0||a.y>=un)return;let g=null;if(v){const{x:t,y:e,z:i}=d.projectTilePoint(a.x,a.y,m);g={anchor:new $g(t,e,i,0,void 0),up:d.upVector(m,a.x,a.y)}}!function(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x,w,E,S,T,M){const A=t.addToLineVertexArray(e,n);let C,k,P,I,D,O,L,z=0,R=0,F=0,B=0,N=-1,j=-1;const V={};let U=Pl("");const $=i?i.anchor:e,H="none"!==l.layout.get("icon-text-fit").evaluate(b,{},S);let q=0,W=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[q,W]=l.layout.get("text-offset").evaluate(b,{},S).map((t=>t*dg)):(q=l.layout.get("text-radial-offset").evaluate(b,{},S)*dg,W=y_),t.allowVerticalPlacement&&r.vertical){const t=r.vertical;if(f)O=k_(t),a&&(L=k_(a));else{const i=l.layout.get("text-rotate").evaluate(b,{},S)+90;P=C_(c,$,e,h,u,d,t,p,i,m),a&&(I=C_(c,$,e,h,u,d,a,_,i))}}if(s){const n=l.layout.get("icon-rotate").evaluate(b,{},S),r=l_(s,n,w,H),o=a?l_(a,n,w,H):void 0;k=C_(c,$,e,h,u,d,s,_,n),z=4*r.length;const p=t.iconSizeData;let f=null;"source"===p.kind?(f=[pg*l.layout.get("icon-size").evaluate(b,{},S)],f[0]>T_&&Y(`${t.layerIds[0]}: Value for "icon-size" is >= ${S_}. Reduce your "icon-size".`)):"composite"===p.kind&&(f=[pg*x.compositeIconSizes[0].evaluate(b,{},S),pg*x.compositeIconSizes[1].evaluate(b,{},S)],(f[0]>T_||f[1]>T_)&&Y(`${t.layerIds[0]}: Value for "icon-size" is >= ${S_}. Reduce your "icon-size".`)),t.addSymbols(t.icon,r,f,v,y,b,!1,i,e,A.lineStartIndex,A.lineLength,-1,E,S,T,M),N=t.icon.placedSymbolArray.length-1,o&&(R=4*o.length,t.addSymbols(t.icon,o,f,v,y,b,Ag.vertical,i,e,A.lineStartIndex,A.lineLength,-1,E,S,T,M),j=t.icon.placedSymbolArray.length-1)}for(const n in r.horizontal){const s=r.horizontal[n];C||(U=Pl(s.text),f?D=k_(s):C=C_(c,$,e,h,u,d,s,p,l.layout.get("text-rotate").evaluate(b,{},S),m));const a=1===s.positionedLines.length;if(F+=M_(t,i,e,s,o,l,f,b,m,A,r.vertical?Ag.horizontal:Ag.horizontalOnly,a?Object.keys(r.horizontal):[n],V,N,x,E,S,T),a)break}r.vertical&&(B+=M_(t,i,e,r.vertical,o,l,f,b,m,A,Ag.vertical,["vertical"],V,j,x,E,S,T));let G=-1;const Z=(t,e)=>t?Math.max(t,e):e;G=Z(D,G),G=Z(O,G),G=Z(L,G);const X=G>-1?1:0;t.glyphOffsetArray.length>=yy.MAX_GLYPHS&&Y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,$.x,$.y,$.z,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical>=0?V.vertical:-1,N,j,U,void 0!==C?C:t.collisionBoxArray.length,void 0!==C?C+1:t.collisionBoxArray.length,void 0!==P?P:t.collisionBoxArray.length,void 0!==P?P+1:t.collisionBoxArray.length,void 0!==k?k:t.collisionBoxArray.length,void 0!==k?k+1:t.collisionBoxArray.length,I||t.collisionBoxArray.length,I?I+1:t.collisionBoxArray.length,h,F,B,z,R,X,0,q,W,G,0,H?1:0)}(t,a,g,o,i,n,r,R,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,T,C,l,0,M,k,_,e,s,c,h,u,p,f)};if("line"===P)for(const r of Kg(e.geometry,0,0,un,un)){const e=Yg(r,S,A,i.vertical||y,n,b,w,t.overscaling,un);for(const i of e)y&&P_(t,y.text,I,i)||F(r,i,u)}else if("line-center"===P){for(const t of e.geometry)if(t.length>1){const e=Zg(t,A,i.vertical||y,n,b,w);e&&F(t,e,u)}}else if("Polygon"===e.type)for(const t of Nf(e.geometry,0)){const e=f_(t,16);F(t[0],new $g(e.x,e.y,0,0,void 0),u)}else if("LineString"===e.type)for(const t of e.geometry)F(t,new $g(t[0].x,t[0].y,0,0,void 0),u);else if("Point"===e.type)for(const t of e.geometry)for(const e of t)F([e],new $g(e.x,e.y,0,0,void 0),u)}const S_=255,T_=S_*pg;function M_(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_){const y=function(t,e,i,n,r,s,o,a){const l=[];if(0===e.positionedLines.length)return l;const c=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,h=function(t){const e=t[0],i=t[1],n=e*i;return n>0?[e,-i]:n<0?[-e,i]:0===e?[i,e]:[i,-e]}(i);let u=Math.abs(e.top-e.bottom);for(const t of e.positionedLines)u-=t.lineOffset;const d=e.positionedLines.length,p=u/d;let f=e.top-i[1];for(let t=0;t<d;++t){const n=e.positionedLines[t];f=p_(e,p,f,t);for(const t of n.positionedGlyphs){if(!t.rect)continue;const n=t.rect||{};let s=Mg+1,u=!0,d=1,p=0;if(t.imageName){const e=o[t.imageName];if(!e)continue;if(e.sdf){Y("SDF images are not supported in formatted text and will be ignored.");continue}u=!1,d=e.pixelRatio,s=Jg/d}const m=(r||a)&&t.vertical,g=t.metrics.advance*t.scale/2,_=t.metrics,y=t.rect;if(null===y)continue;a&&e.verticalizable&&(p=t.imageName?g-t.metrics.width*t.scale/2:0);const b=r?[t.x+g,t.y]:[0,0];let x=[0,0],w=[0,0],E=!1;r||(m?(w=[t.x+g+h[0],t.y+h[1]-p],E=!0):x=[t.x+g+i[0],t.y+i[1]-p]);const S=y.w*t.scale/(d*(t.localGlyph?s_:1)),T=y.h*t.scale/(d*(t.localGlyph?s_:1));let M,A,C,k;if(m){const e=t.y-f,i=new v(-g,g-e),n=-Math.PI/2,r=new v(...w);M=new v(-g+x[0],x[1]),M._rotateAround(n,i)._add(r),M.x+=-e+g,M.y-=(_.left-s)*t.scale;const o=t.imageName?_.advance*t.scale:dg*t.scale,a=String.fromCodePoint(t.glyph);bg(a)?M.x+=(1-s)*t.scale:xg(a)?M.x+=o-_.height*t.scale+(-s-1)*t.scale:M.x+=t.imageName||_.width+2*s===y.w&&_.height+2*s===y.h?(o-T)/2:(o-(_.height+2*s)*t.scale)/2,A=new v(M.x,M.y-S),C=new v(M.x+T,M.y),k=new v(M.x+T,M.y-S)}else{const e=(_.left-s)*t.scale-g+x[0],i=(-_.top-s)*t.scale+x[1],n=e+S,r=i+T;M=new v(e,i),A=new v(n,i),C=new v(e,r),k=new v(n,r)}if(c){let t;t=r?new v(0,0):E?new v(h[0],h[1]):new v(i[0],i[1]),M._rotateAround(c,t),A._rotateAround(c,t),C._rotateAround(c,t),k._rotateAround(c,t)}const P=new v(0,0),I=new v(0,0);l.push({tl:M,tr:A,bl:C,br:k,texPrimary:n,texSecondary:void 0,writingMode:e.writingMode,glyphOffset:b,sectionIndex:t.sectionIndex,isSDF:u,pixelOffsetTL:P,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,l,s,o,a,r,t.allowVerticalPlacement),b=t.textSizeData;let x=null;"source"===b.kind?(x=[pg*s.layout.get("text-size").evaluate(a,{},g)],x[0]>T_&&Y(`${t.layerIds[0]}: Value for "text-size" is >= ${S_}. Reduce your "text-size".`)):"composite"===b.kind&&(x=[pg*f.compositeTextSizes[0].evaluate(a,{},g),pg*f.compositeTextSizes[1].evaluate(a,{},g)],(x[0]>T_||x[1]>T_)&&Y(`${t.layerIds[0]}: Value for "text-size" is >= ${S_}. Reduce your "text-size".`)),t.addSymbols(t.text,y,x,l,o,a,h,e,i,c.lineStartIndex,c.lineLength,p,m,g,_,!1);for(const e of u)d[e]=t.text.placedSymbolArray.length-1;return 4*y.length}function A_(t){for(const e in t)return t[e];return null}function C_(t,e,i,n,r,s,o,a,l,c){let h=o.top,u=o.bottom,d=o.left,p=o.right;const f=o.collisionPadding;if(f&&(d-=f[0],h-=f[1],p+=f[2],u+=f[3]),l){const t=new v(d,h),e=new v(p,h),i=new v(d,u),n=new v(p,u),r=E(l);let s=new v(0,0);c&&(s=new v(c[0],c[1])),t._rotateAround(r,s),e._rotateAround(r,s),i._rotateAround(r,s),n._rotateAround(r,s),d=Math.min(t.x,e.x,i.x,n.x),p=Math.max(t.x,e.x,i.x,n.x),h=Math.min(t.y,e.y,i.y,n.y),u=Math.max(t.y,e.y,i.y,n.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,d,h,p,u,a,n,r,s),t.length-1}function k_(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function P_(t,e,i,n){const r=t.compareText;if(e in r){const t=r[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<i)return!0}else r[e]=[];return r[e].push(n),!1}function I_(t,e){const i=t.fovAboveCenter,n=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,r=(t._camera.position[2]*t.worldSize-n)/Math.cos(t._pitch),s=Math.sin(i)*r/Math.sin(Math.max(Math.PI/2-t._pitch-i,.01)),o=Math.sin(t._pitch)*s+r;return Math.min(1.01*o,r*(1/t._horizonShift))}function D_(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const i=Math.pow(2,-t.z),n=t.x*i,r=(t.x+1)*i,s=t.y*i,o=(t.y+1)*i,a=ep(n),l=ep(r),c=ip(s),h=ip(o),u=e.project(a,c),d=e.project(l,c),p=e.project(l,h),f=e.project(a,h);let m=Math.min(u.x,d.x,p.x,f.x),g=Math.min(u.y,d.y,p.y,f.y),_=Math.max(u.x,d.x,p.x,f.x),y=Math.max(u.y,d.y,p.y,f.y);const v=i/16;function b(t,i,n,r,s,o){const a=(n+s)/2,l=(r+o)/2,c=e.project(ep(a),ip(l)),h=Math.max(0,m-c.x,g-c.y,c.x-_,c.y-y);m=Math.min(m,c.x),_=Math.max(_,c.x),g=Math.min(g,c.y),y=Math.max(y,c.y),h>v&&(b(t,c,n,r,a,l),b(c,i,a,l,s,o))}b(u,d,n,s,r,s),b(d,p,r,s,r,o),b(p,f,r,o,n,o),b(f,u,n,o,n,s),m-=v,g-=v,_+=v,y+=v;const x=1/Math.max(_-m,y-g);return{scale:x,x:m*x,y:g*x,x2:_*x,y2:y*x,projection:e}}function O_(t,e,i,n,r,s,o,a,l){if("globe"===l.name)return vd(t,e,new $u(i,n,r),!1);const c=D_({z:i,x:n,y:r},l);return new ed([(s+c.x/c.scale)*e,e*(c.y/c.scale),o],[(s+c.x2/c.scale)*e,e*(c.y2/c.scale),a])}function L_(t,{x:e,y:i},n=0){return new v(((e-n)*t.scale-t.x)*un,(i*t.scale-t.y)*un)}function z_(t,e,i=0){return Ou.fromValues(((e.x-i)*t.scale-t.x)*un,(e.y*t.scale-t.y)*un,np(e.z,e.y))}const R_=Au.identity(new Float32Array(16));class F_{constructor(t){this.spec=t,this.name=t.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(t,e){return{x:0,y:0,z:0}}unproject(t,e){return new Zd(0,0)}projectTilePoint(t,e,i){return{x:t,y:e,z:0}}locationPoint(t,e,i=!0){return t._coordinatePoint(t.locationCoordinate(e),i)}pixelsPerMeter(t,e){return tp(1,t)*e}pixelSpaceConversion(t,e,i){return 1}farthestPixelDistance(t){return I_(t,t.pixelsPerMeter)}pointCoordinate(t,e,i,n){const r=t.horizonLineFromTop(!1),s=new v(e,Math.max(r,i));return t.rayIntersectionCoordinate(t.pointRayIntersection(s,n))}pointCoordinate3D(t,e,i){const n=new v(e,i);if(t.elevation)return t.elevation.pointCoordinate(n);{const e=this.pointCoordinate(t,n.x,n.y,0);return[e.x,e.y,e.z]}}isPointAboveHorizon(t,e){if(t.elevation)return!this.pointCoordinate3D(t,e.x,e.y);const i=t.horizonLineFromTop();return e.y<i}createInversionMatrix(t,e){return R_}createTileMatrix(t,e,i){let n,r,s;const o=i.canonical,a=Au.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=D_(o,this);n=1,r=l.x+i.wrap*l.scale,s=l.y,Au.scale(a,a,[n/l.scale,n/l.scale,t.pixelsPerMeter/e])}else n=e/t.zoomScale(o.z),r=(o.x+Math.pow(2,o.z)*i.wrap)*n,s=o.y*n;return Au.translate(a,a,[r,s,0]),Au.scale(a,a,[n/un,n/un,1]),a}upVector(t,e,i){return[0,0,1]}upVectorScale(t,e,i){return{metersToTile:1}}}class B_ extends F_{constructor(t){super(t),this.range=[4,7],this.center=t.center||[-96,37.5];const[e,i]=this.parallels=t.parallels||[29.5,45.5],n=Math.sin(E(e));this.n=(n+Math.sin(E(i)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(t,e){const{n:i,c:n,r0:r}=this,s=E(t-this.center[0]),o=E(e),a=Math.sqrt(n-2*i*Math.sin(o))/i;return{x:a*Math.sin(s*i),y:a*Math.cos(s*i)-r,z:0}}unproject(t,e){const{n:i,c:n,r0:r}=this,s=r+e;let o=Math.atan2(t,Math.abs(s))*Math.sign(s);s*i<0&&(o-=Math.PI*Math.sign(t)*Math.sign(s));const a=E(this.center[0])*i;o=O(o,-Math.PI-a,Math.PI-a);const l=I(S(o/i)+this.center[0],-180,180),c=Math.asin(I((n-(t*t+s*s)*i*i)/(2*i),-1,1)),h=I(S(c),-rp,rp);return new Zd(l,h)}}const N_=1.340264,j_=-.081106,V_=893e-6,U_=.003796,$_=Math.sqrt(3)/2;class H_ extends F_{project(t,e){e=e/180*Math.PI,t=t/180*Math.PI;const i=Math.asin($_*Math.sin(e)),n=i*i,r=n*n*n;return{x:.5*(t*Math.cos(i)/($_*(N_+3*j_*n+r*(7*V_+9*U_*n)))/Math.PI+.5),y:1-.5*(i*(N_+j_*n+r*(V_+U_*n))/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let i=e=(2*(1-e)-1)*Math.PI,n=i*i,r=n*n*n;for(let t,s,o,a=0;a<12&&(s=i*(N_+j_*n+r*(V_+U_*n))-e,o=N_+3*j_*n+r*(7*V_+9*U_*n),t=s/o,i=I(i-t,-Math.PI/3,Math.PI/3),n=i*i,r=n*n*n,!(Math.abs(t)<1e-12));++a);const s=$_*t*(N_+3*j_*n+r*(7*V_+9*U_*n))/Math.cos(i),o=Math.asin(Math.sin(i)/$_),a=I(180*s/Math.PI,-180,180),l=I(180*o/Math.PI,-rp,rp);return new Zd(a,l)}}class q_ extends F_{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0}project(t,e){return{x:.5+t/360,y:.5-e/360,z:0}}unproject(t,e){const i=360*(t-.5),n=I(360*(.5-e),-rp,rp);return new Zd(i,n)}}const W_=Math.PI/2;function G_(t){return Math.tan((W_+t)/2)}class Z_ extends F_{constructor(t){super(t),this.center=t.center||[0,30];const[e,i]=this.parallels=t.parallels||[30,30];let n=E(e),r=E(i);this.southernCenter=n+r<0,this.southernCenter&&(n=-n,r=-r);const s=Math.cos(n),o=G_(n);this.n=n===r?Math.sin(n):Math.log(s/Math.cos(r))/Math.log(G_(r)/o),this.f=s*Math.pow(G_(n),this.n)/this.n}project(t,e){e=E(e),this.southernCenter&&(e=-e),t=E(t-this.center[0]);const i=1e-6,{n:n,f:r}=this;r>0?e<-W_+i&&(e=-W_+i):e>W_-i&&(e=W_-i);const s=r/Math.pow(G_(e),n);let o=s*Math.sin(n*t),a=r-s*Math.cos(n*t);return o=.5*(o/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:o,y:this.southernCenter?a:1-a,z:0}}unproject(t,e){t=(2*t-.5)*Math.PI,this.southernCenter&&(e=1-e),e=(2*(1-e)-.5)*Math.PI;const{n:i,f:n}=this,r=n-e,s=Math.sign(r),o=Math.sign(i)*Math.sqrt(t*t+r*r);let a=Math.atan2(t,Math.abs(r))*s;r*i<0&&(a-=Math.PI*Math.sign(t)*s);const l=I(S(a/i)+this.center[0],-180,180),c=I(S(2*Math.atan(Math.pow(n/o,1/i))-W_),-rp,rp);return new Zd(l,this.southernCenter?-c:c)}}class Y_ extends F_{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,e){return{x:Qd(t),y:Jd(e),z:0}}unproject(t,e){const i=ep(t),n=ip(e);return new Zd(i,n)}}const X_=E(rp);class K_ extends F_{project(t,e){const i=(e=E(e))*e,n=i*i;return{x:.5*((t=E(t))*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(e*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let i=e=(2*(1-e)-1)*Math.PI,n=25,r=0,s=i*i;do{s=i*i;const t=s*s;r=(i*(1.007226+s*(.015085+t*(.028874*s-.044475-.005916*t)))-e)/(1.007226+s*(.045255+t*(.259866*s-.311325-.005916*11*t))),i=I(i-r,-X_,X_)}while(Math.abs(r)>1e-6&&--n>0);s=i*i;const o=I(S(t/(.8707+s*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979))),-180,180),a=S(i);return new Zd(o,a)}}const Q_=E(rp);class J_ extends F_{project(t,e){e=E(e),t=E(t);const i=Math.cos(e),n=2/Math.PI,r=Math.acos(i*Math.cos(t/2)),s=Math.sin(r)/r,o=.5*(t*n+2*i*Math.sin(t/2)/s)||0,a=.5*(e+Math.sin(e)/s)||0;return{x:.5*(o/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(t,e){let i=t=(2*t-.5)*Math.PI,n=e=(2*(1-e)-1)*Math.PI,r=25;const s=1e-6;let o=0,a=0;do{const r=Math.cos(n),s=Math.sin(n),l=2*s*r,c=s*s,h=r*r,u=Math.cos(i/2),d=Math.sin(i/2),p=2*u*d,f=d*d,m=1-h*u*u,g=m?1/m:0,_=m?Math.acos(r*u)*Math.sqrt(1/m):0,y=.5*(2*_*r*d+2*i/Math.PI)-t,v=.5*(_*s+n)-e,b=.5*g*(h*f+_*r*u*c)+1/Math.PI,x=g*(p*l/4-_*s*d),w=.125*g*(l*d-_*s*h*p),E=.5*g*(c*u+_*f*r)+.5,S=x*w-E*b;o=(v*x-y*E)/S,a=(y*w-v*b)/S,i=I(i-o,-Math.PI,Math.PI),n=I(n-a,-Q_,Q_)}while((Math.abs(o)>s||Math.abs(a)>s)&&--r>0);return new Zd(S(i),S(n))}}class ty extends F_{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(E(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,e){const{scale:i,cosPhi:n}=this;return{x:E(t)*n*i+.5,y:-Math.sin(E(e))/n*i+.5,z:0}}unproject(t,e){const{scale:i,cosPhi:n}=this,r=-(e-.5)/i,s=I(S((t-.5)/i)/n,-180,180),o=Math.asin(I(r*n,-1,1)),a=I(S(o),-rp,rp);return new Zd(s,a)}}class ey extends Y_{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,e,i){const n=Sd(t,e,i),r=Ad(md(i));return Ou.transformMat4(n,n,r),{x:n[0],y:n[1],z:n[2]}}locationPoint(t,e){const i=Ed(e.lat,e.lng),n=Ou.normalize([],i),r=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(e),t._centerAltitude):t._centerAltitude,s=tp(1,0)*un*r;Ou.scaleAndAdd(i,i,n,s);const o=Au.identity(new Float64Array(16));return Au.multiply(o,t.pixelMatrix,t.globeMatrix),Ou.transformMat4(i,i,o),new v(i[0],i[1])}pixelsPerMeter(t,e){return tp(1,0)*e}pixelSpaceConversion(t,e,i){const n=tp(1,t)*e,r=Jn(tp(1,45)*e,n,i);return this.pixelsPerMeter(t,e)/r}createTileMatrix(t,e,i){const n=Cd(md(i.canonical));return Au.multiply(new Float64Array(16),t.globeMatrix,n)}createInversionMatrix(t,e){const{center:i}=t,n=Ad(md(e));return Au.rotateY(n,n,E(i.lng)),Au.rotateX(n,n,E(i.lat)),Au.scale(n,n,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(t,e,i,n){return dd(t,e,i,!0)||new cp(0,0)}pointCoordinate3D(t,e,i){const n=this.pointCoordinate(t,e,i,0);return[n.x,n.y,n.z]}isPointAboveHorizon(t,e){return!dd(t,e.x,e.y,!1)}farthestPixelDistance(t){const e=function(t,e){const i=t.cameraToCenterDistance,n=t._centerAltitude*e,r=t._camera,s=t._camera.forward(),o=Ou.add([],Ou.scale([],s,-i),[0,0,n]),a=t.worldSize/(2*Math.PI),l=[0,0,-a],c=t.width/t.height,h=Math.tan(t.fovAboveCenter),u=Ou.scale([],r.up(),h),d=Ou.scale([],r.right(),h*c),p=Ou.normalize([],Ou.add([],Ou.add([],s,u),d)),f=[];let m;if(new Zu(o,p).closestPointOnSphere(l,a,f)){const e=Ou.add([],f,l),i=Ou.sub([],e,o);m=Math.cos(t.fovAboveCenter)*Ou.length(i)}else{const t=Ou.sub([],o,l),e=Ou.sub([],l,o);Ou.normalize(e,e);const i=Ou.length(t)-a;m=Math.sqrt(i*(i+2*a));const n=Math.acos(m/(a+i))-Math.acos(Ou.dot(s,e));m*=Math.cos(n)}return 1.01*m}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),i=Od(t.zoom);if(i>0){const n=I_(t,tp(1,t.center.lat)*t.worldSize),r=t.worldSize/(2*Math.PI),s=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Jn(e,n+r*(1-Math.cos(s)),Math.pow(i,10))}return e}upVector(t,e,i){return Sd(e,i,t,1)}upVectorScale(t){return{metersToTile:ud(Td(md(t)))}}}function iy(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Y_(t);case"equirectangular":return new q_(t);case"naturalEarth":return new K_(t);case"equalEarth":return new H_(t);case"winkelTripel":return new J_(t);case"albers":return i?new ty(t):new B_(t);case"lambertConformalConic":return i?new ty(t):new Z_(t);case"globe":return new ey(t)}throw new Error(`Invalid projection name: ${t.name}`)}const ny=new ya({"symbol-placement":new ma(De.layout_symbol["symbol-placement"]),"symbol-spacing":new ma(De.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ma(De.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ga(De.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ma(De.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new ma(De.layout_symbol["symbol-z-elevate"]),"icon-allow-overlap":new ma(De.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ma(De.layout_symbol["icon-ignore-placement"]),"icon-optional":new ma(De.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ma(De.layout_symbol["icon-rotation-alignment"]),"icon-size":new ga(De.layout_symbol["icon-size"]),"icon-text-fit":new ga(De.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ga(De.layout_symbol["icon-text-fit-padding"]),"icon-image":new ga(De.layout_symbol["icon-image"]),"icon-rotate":new ga(De.layout_symbol["icon-rotate"]),"icon-padding":new ma(De.layout_symbol["icon-padding"]),"icon-keep-upright":new ma(De.layout_symbol["icon-keep-upright"]),"icon-offset":new ga(De.layout_symbol["icon-offset"]),"icon-anchor":new ga(De.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ma(De.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ma(De.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ma(De.layout_symbol["text-rotation-alignment"]),"text-field":new ga(De.layout_symbol["text-field"]),"text-font":new ga(De.layout_symbol["text-font"]),"text-size":new ga(De.layout_symbol["text-size"]),"text-max-width":new ga(De.layout_symbol["text-max-width"]),"text-line-height":new ga(De.layout_symbol["text-line-height"]),"text-letter-spacing":new ga(De.layout_symbol["text-letter-spacing"]),"text-justify":new ga(De.layout_symbol["text-justify"]),"text-radial-offset":new ga(De.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ma(De.layout_symbol["text-variable-anchor"]),"text-anchor":new ga(De.layout_symbol["text-anchor"]),"text-max-angle":new ma(De.layout_symbol["text-max-angle"]),"text-writing-mode":new ma(De.layout_symbol["text-writing-mode"]),"text-rotate":new ga(De.layout_symbol["text-rotate"]),"text-padding":new ma(De.layout_symbol["text-padding"]),"text-keep-upright":new ma(De.layout_symbol["text-keep-upright"]),"text-transform":new ga(De.layout_symbol["text-transform"]),"text-offset":new ga(De.layout_symbol["text-offset"]),"text-allow-overlap":new ma(De.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ma(De.layout_symbol["text-ignore-placement"]),"text-optional":new ma(De.layout_symbol["text-optional"]),visibility:new ma(De.layout_symbol.visibility)});var ry={paint:new ya({"icon-opacity":new ga(De.paint_symbol["icon-opacity"]),"icon-emissive-strength":new ga(De.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new ga(De.paint_symbol["text-emissive-strength"]),"icon-color":new ga(De.paint_symbol["icon-color"]),"icon-halo-color":new ga(De.paint_symbol["icon-halo-color"]),"icon-halo-width":new ga(De.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ga(De.paint_symbol["icon-halo-blur"]),"icon-translate":new ma(De.paint_symbol["icon-translate"]),"icon-translate-anchor":new ma(De.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new ga(De.paint_symbol["icon-image-cross-fade"]),"text-opacity":new ga(De.paint_symbol["text-opacity"]),"text-color":new ga(De.paint_symbol["text-color"],{runtimeType:We,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new ga(De.paint_symbol["text-halo-color"]),"text-halo-width":new ga(De.paint_symbol["text-halo-width"]),"text-halo-blur":new ga(De.paint_symbol["text-halo-blur"]),"text-translate":new ma(De.paint_symbol["text-translate"]),"text-translate-anchor":new ma(De.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new ma(De.paint_symbol["icon-color-saturation"])}),layout:ny};class sy{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ue,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Lo(sy,"FormatSectionOverride",{omit:["defaultValue"]});class oy extends Sa{constructor(t,e){super(t,ry,e)}recalculate(t,e){super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const i=this.layout.get("text-writing-mode");if(i){const t=[];for(const e of i)t.indexOf(e)<0&&t.push(e);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,n){const r=this.layout.get(t).evaluate(e,{},i,n),s=this._unevaluatedLayout._values[t];return s.isDataDriven()||Es(s.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>i in t?String(t[i]):""))}(e.properties,r)}createBucket(t){return new yy(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of ry.paint.overridableProperties){if(!oy.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new sy(e),n=new ws(i,e.property.specification);let r=null;r="constant"===e.value.kind||"source"===e.value.kind?new Ts("source",n):new Ms("composite",n,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new pa(e.property,r,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&oy.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),n=ry.paint.properties[e];let r=!1;const s=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof fi)s(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{r||(e instanceof xi&&yi(e.value)===Xe?s(e.value.sections):e instanceof Mi?s(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return r}getProgramIds(){const t=0!==this.paint.get("icon-opacity").constantOr(1),e=0!==this.paint.get("text-opacity").constantOr(1),i=[];return t&&i.push("symbolIcon"),e&&i.push("symbolSDF"),i}getDefaultProgramParams(t,e){return{config:new tc(this,e),overrideFog:!1}}}const ay=um.types,ly=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function cy(t,e,i,n,r,s,o,a,l,c,h,u,d){const p=a?Math.min(T_,Math.round(a[0])):0,f=a?Math.min(T_,Math.round(a[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*r),s,o,(p<<1)+(l?1:0),f,16*c,16*h,256*u,256*d)}function hy(t,e,i){t.emplaceBack(e,i)}function uy(t,e,i,n,r,s,o){t.emplaceBack(e,i,n,r,s,o)}function dy(t,e,i,n,r){const s=5*e+2;t.float32[s+0]=i,t.float32[s+1]=n,t.float32[s+2]=r}function py(t,e,i,n,r){t.emplaceBack(e,i,n,r),t.emplaceBack(e,i,n,r),t.emplaceBack(e,i,n,r),t.emplaceBack(e,i,n,r)}function fy(t){for(const e of t.sections)if(Go(e.text))return!0;return!1}class my{constructor(t){this.layoutVertexArray=new ja,this.indexArray=new Za,this.programConfigurations=t,this.segments=new bl,this.dynamicLayoutVertexArray=new Ra,this.opacityVertexArray=new Ua,this.placedSymbolArray=new hl,this.iconTransitioningVertexArray=new $a,this.globeExtVertexArray=new Va,this.zOffsetVertexArray=new Ka}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(t,e,i,n,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ng.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,sg.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,ly,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=t.createVertexBuffer(this.iconTransitioningVertexArray,ag.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,rg.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||r)&&(this.zOffsetVertexBuffer=t.createVertexBuffer(this.zOffsetVertexArray,og.members,!0)),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}Lo(my,"SymbolBuffers");class gy{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new bl,this.collisionVertexArray=new Ga,this.collisionVertexArrayExt=new Ra}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,lg.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,cg.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Lo(gy,"CollisionBuffers");class _y{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Au.identity([]),this.placementViewportMatrix=Au.identity([]);const e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=fg(this.zoom,e["text-size"]),this.iconSizeData=fg(this.zoom,e["icon-size"]);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map((t=>Ag[t])),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=t.sourceID,this.projection=t.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=i.get("symbol-z-elevate")}createArrays(){this.text=new my(new ec(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new my(new ec(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new pl,this.lineVertexArray=new fl,this.symbolInstances=new dl}calculateGlyphDependencies(t,e,i,n,r){for(let i=0;i<t.length;i++){const s=t.codePointAt(i);if(void 0===s)break;if(e[s]=!0,n&&r&&s<=65535){const n=vg[t.charAt(i)];n&&(e[n.charCodeAt(0)]=!0)}}}populate(t,e,i,n){const r=this.layers[0],s=r.layout,o="globe"===this.projection.name,a=s.get("text-font"),l=s.get("text-field"),c=s.get("icon-image"),h=("constant"!==l.value.kind||l.value.value instanceof fi&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,d=s.get("symbol-sort-key");if(this.features=[],!h&&!u)return;const p=e.iconDependencies,f=e.glyphDependencies,m=e.availableImages,g=new oa(this.zoom);for(const{feature:e,id:l,index:c,sourceLayerIndex:_}of t){const t=r._featureFilter.needGeometry,y=yp(e,t);if(!r._featureFilter.filter(g,y,i))continue;if(t||(y.geometry=_p(e,i,n)),o&&1!==e.type&&i.z<=5){const t=y.geometry,e=.98078528056,n=(t,n)=>{const r=Sd(t.x,t.y,i,1),s=Sd(n.x,n.y,i,1);return Ou.dot(r,s)<e};for(let e=0;e<t.length;e++)t[e]=pp(t[e],n)}let v,b;if(h){const t=r.getValueAndResolveTokens("text-field",y,i,m),e=fi.factory(t);fy(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===na()||this.hasRTLText&&sa.isParsed())&&(v=yg(e,r,y))}if(u){const t=r.getValueAndResolveTokens("icon-image",y,i,m);b=t instanceof mi?t:mi.fromString(t)}if(!v&&!b)continue;const x=this.sortFeaturesByKey?d.evaluate(y,{},i):void 0;if(this.features.push({id:l,text:v,icon:b,index:c,sourceLayerIndex:_,geometry:y.geometry,properties:e.properties,type:ay[e.type],sortKey:x}),b&&(p[b.namePrimary]=!0,b.nameSecondary&&(p[b.nameSecondary]=!0)),v){const t=a.evaluate(y,{},i).join(","),e="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Ag.vertical)>=0;for(const i of v.sections)if(i.image)p[i.image.namePrimary]=!0;else{const n=jo(v.toString()),r=i.fontStack||t,s=f[r]=f[r]||{};this.calculateGlyphDependencies(i.text,s,e,this.allowVerticalPlacement,n)}}}"line"===s.get("symbol-placement")&&(this.features=function(t){const e={},i={},n=[];let r=0;function s(e){n.push(t[e]),r++}function o(t,e,r){const s=i[t];return delete i[t],i[e]=s,n[s].geometry[0].pop(),n[s].geometry[0]=n[s].geometry[0].concat(r[0]),s}function a(t,i,r){const s=e[i];return delete e[i],e[t]=s,n[s].geometry[0].shift(),n[s].geometry[0]=r[0].concat(n[s].geometry[0]),s}function l(t,e,i){const n=i?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;c<t.length;c++){const h=t[c],u=h.geometry,d=h.text?h.text.toString():null;if(!d){s(c);continue}const p=l(d,u),f=l(d,u,!0);if(p in i&&f in e&&i[p]!==e[f]){const t=a(p,f,u),r=o(p,f,n[t].geometry);delete e[p],delete i[f],i[l(d,n[r].geometry,!0)]=r,n[t].geometry=null}else p in i?o(p,f,u):f in e?a(p,f,u):(s(c),e[p]=r-1,i[f]=r-1)}return n.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i,n,r){const s=0!==Object.keys(t).length;if(s&&!this.stateDependentLayers.length)return;const o=s?this.stateDependentLayers:this.layers;this.text.programConfigurations.updatePaintArrays(t,e,o,i,n,r),this.icon.programConfigurations.updatePaintArrays(t,e,o,i,n,r)}updateZOffset(){const t=(t,e,n)=>{i+=e,i>t.length&&t.resize(i);for(let r=-e;r<0;r++)t.emplace(r+i,n)},e=(t,e,i)=>{n+=e,n>t.length&&t.resize(n);for(let r=-e;r<0;r++)t.emplace(r+n,i)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let i=0,n=0;for(let i=0;i<this.symbolInstances.length;i++){const n=this.symbolInstances.get(i),{numHorizontalGlyphVertices:r,numVerticalGlyphVertices:s,numIconVertices:o}=n,a=n.zOffset,l=o>0;if((r>0||s>0)&&(t(this.text.zOffsetVertexArray,r,a),t(this.text.zOffsetVertexArray,s,a)),l){const{placedIconSymbolIndex:t,verticalPlacedIconSymbolIndex:i}=n;t>=0&&e(this.icon.zOffsetVertexArray,o,a),i>=0&&e(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=iy(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment)for(const{x:t,y:i}of e)this.lineVertexArray.emplaceBack(t,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m){const g=t.indexArray,_=t.layoutVertexArray,y=t.globeExtVertexArray,v=t.segments.prepareSegment(4*e.length,_,g,this.canOverlap?s.sortKey:void 0),b=this.glyphOffsetArray.length,x=v.vertexLength,w=this.allowVerticalPlacement&&o===Ag.vertical?Math.PI/2:0,E=s.text&&s.text.sections;for(let n=0;n<e.length;n++){const{tl:r,tr:o,bl:c,br:h,texPrimary:u,texSecondary:b,pixelOffsetTL:x,pixelOffsetBR:S,minFontScaleX:T,minFontScaleY:M,glyphOffset:A,isSDF:C,sectionIndex:k}=e[n],P=v.vertexLength,I=A[1];if(cy(_,l.x,l.y,r.x,I+r.y,u.x,u.y,i,C,x.x,x.y,T,M),cy(_,l.x,l.y,o.x,I+o.y,u.x+u.w,u.y,i,C,S.x,x.y,T,M),cy(_,l.x,l.y,c.x,I+c.y,u.x,u.y+u.h,i,C,x.x,S.y,T,M),cy(_,l.x,l.y,h.x,I+h.y,u.x+u.w,u.y+u.h,i,C,S.x,S.y,T,M),a){const{x:e,y:i,z:n}=a.anchor,[r,s,o]=a.up;uy(y,e,i,n,r,s,o),uy(y,e,i,n,r,s,o),uy(y,e,i,n,r,s,o),uy(y,e,i,n,r,s,o),py(t.dynamicLayoutVertexArray,e,i,n,w)}else py(t.dynamicLayoutVertexArray,l.x,l.y,l.z,w);if(m){const e=b||u;hy(t.iconTransitioningVertexArray,e.x,e.y),hy(t.iconTransitioningVertexArray,e.x+e.w,e.y),hy(t.iconTransitioningVertexArray,e.x,e.y+e.h),hy(t.iconTransitioningVertexArray,e.x+e.w,e.y+e.h)}g.emplaceBack(P,P+1,P+2),g.emplaceBack(P+1,P+2,P+3),v.vertexLength+=4,v.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),n!==e.length-1&&k===e[n+1].sectionIndex||t.programConfigurations.populatePaintArrays(_.length,s,s.index,{},d,p,f,E&&E[k])}const S=a?a.anchor:l;t.placedSymbolArray.emplaceBack(S.x,S.y,S.z,l.x,l.y,b,this.glyphOffsetArray.length-b,x,c,h,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],o,0,!1,0,u,0)}_commitLayoutVertex(t,e,i,n,r,s,o){t.emplaceBack(e,i,n,r,s,Math.round(o.x),Math.round(o.y))}_addCollisionDebugVertices(t,e,i,n,r,s,o){const a=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=a.vertexLength,c=o.tileAnchorX,h=o.tileAnchorY;for(let t=0;t<4;t++)i.collisionVertexArray.emplaceBack(0,0,0,0);this._commitDebugCollisionVertexUpdate(i.collisionVertexArrayExt,e,t.padding,o.zOffset),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new v(t.x1,t.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new v(t.x2,t.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new v(t.x2,t.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,r,s,c,h,new v(t.x1,t.y2)),a.vertexLength+=4;const u=i.indexArray;u.emplaceBack(l,l+1),u.emplaceBack(l+1,l+2),u.emplaceBack(l+2,l+3),u.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(t,e,i,n,r,s){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceTextSize(t,s,e,o);this._addCollisionDebugVertices(n,r,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,s)}}_addIconDebugCollisionBoxes(t,e,i,n,r,s){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceIconSize(t,e,s.placedIconSymbolIndex);this._addCollisionDebugVertices(n,r,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,s)}}generateCollisionDebugBuffers(t,e){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new gy(qa,hg.members,$a),this.iconCollisionBox=new gy(qa,hg.members,$a);const i=gg(this.iconSizeData,t),n=gg(this.textSizeData,t);for(let r=0;r<this.symbolInstances.length;r++){const s=this.symbolInstances.get(r);this._addTextDebugCollisionBoxes(n,t,e,s.textBoxStartIndex,s.textBoxEndIndex,s),this._addTextDebugCollisionBoxes(n,t,e,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s),this._addIconDebugCollisionBoxes(i,t,e,s.iconBoxStartIndex,s.iconBoxEndIndex,s),this._addIconDebugCollisionBoxes(i,t,e,s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s)}}getSymbolInstanceTextSize(t,e,i,n){const r=this.text.placedSymbolArray.get(e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:n),s=mg(this.textSizeData,t,r)/dg;return this.tilePixelRatio*s}getSymbolInstanceIconSize(t,e,i){const n=this.icon.placedSymbolArray.get(i),r=mg(this.iconSizeData,t,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(t,e,i,n){t.emplaceBack(e,-i,-i,n),t.emplaceBack(e,i,-i,n),t.emplaceBack(e,i,i,n),t.emplaceBack(e,-i,i,n)}_updateTextDebugCollisionBoxes(t,e,i,n,r,s){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceTextSize(t,s,e,o);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,n.padding,s.zOffset)}}_updateIconDebugCollisionBoxes(t,e,i,n,r,s){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceIconSize(t,e,s.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,n.padding,s.zOffset)}}updateCollisionDebugBuffers(t,e){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const i=gg(this.iconSizeData,t),n=gg(this.textSizeData,t);for(let r=0;r<this.symbolInstances.length;r++){const s=this.symbolInstances.get(r);this._updateTextDebugCollisionBoxes(n,t,e,s.textBoxStartIndex,s.textBoxEndIndex,s),this._updateTextDebugCollisionBoxes(n,t,e,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s),this._updateIconDebugCollisionBoxes(i,t,e,s.iconBoxStartIndex,s.iconBoxEndIndex,s),this._updateIconDebugCollisionBoxes(i,t,e,s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(t,e,i,n,r,s,o,a,l){const c={};if(e<i){const{x1:i,y1:n,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d,featureIndex:p}=t.get(e);c.textBox={x1:i,y1:n,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d},c.textFeatureIndex=p}if(n<r){const{x1:e,y1:i,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d,featureIndex:p}=t.get(n);c.verticalTextBox={x1:e,y1:i,x2:r,y2:s,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d},c.verticalTextFeatureIndex=p}if(s<o){const{x1:e,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d,featureIndex:p}=t.get(s);c.iconBox={x1:e,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d},c.iconFeatureIndex=p}if(a<l){const{x1:e,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d,featureIndex:p}=t.get(a);c.verticalIconBox={x1:e,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:h,tileAnchorX:u,tileAnchorY:d},c.verticalIconFeatureIndex=p}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(t,e){const i=t.placedSymbolArray.get(e),n=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;e<n;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),n=[],r=[],s=[];for(let t=0;t<this.symbolInstances.length;++t){s.push(t);const o=this.symbolInstances.get(t);n.push(0|Math.round(e*o.tileAnchorX+i*o.tileAnchorY)),r.push(o.featureIndex)}return s.sort(((t,e)=>n[t]-n[e]||r[e]-r[t])),s}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let t=0;t<this.symbolInstances.length;++t)this.symbolInstanceIndexesSortedZOffset.push(t)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort(((t,e)=>this.symbolInstances.get(e).zOffset-this.symbolInstances.get(t).zOffset))}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);const{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:s,placedIconSymbolIndex:o,verticalPlacedIconSymbolIndex:a}=e;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&r!==i&&this.addIndicesForPlacedSymbol(this.text,r),s>=0&&this.addIndicesForPlacedSymbol(this.text,s),o>=0&&this.addIndicesForPlacedSymbol(this.icon,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Lo(_y,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),_y.MAX_GLYPHS=65535,_y.addDynamicAttributes=py;var yy=_y;const vy=ka([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:by}=vy,xy=ka([{name:"a_packed",components:4,type:"Float32"}]),{members:wy}=xy,Ey=um.types,Sy=Math.cos(Math.PI/180*37.5);class Ty{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new za,this.layoutVertexArray2=new Ra,this.indexArray=new Za,this.programConfigurations=new ec(t.layers,t.zoom),this.segments=new bl,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){this.hasPattern=Vf("line",this.layers,e);const r=this.layers[0].layout.get("line-sort-key"),s=[];for(const{feature:e,id:o,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=yp(e,t);if(!this.layers[0]._featureFilter.filter(new oa(this.zoom),c,i))continue;const h=r?r.evaluate(c,{},i):void 0,u={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:a,geometry:t?c.geometry:_p(e,i,n),patterns:{},sortKey:h};s.push(u)}r&&s.sort(((t,e)=>t.sortKey-e.sortKey));const{lineAtlas:o,featureIndex:a}=e,l=this.addConstantDashes(o);for(const n of s){const{geometry:r,index:s,sourceLayerIndex:c}=n;if(l&&this.addFeatureDashes(n,o),this.hasPattern){const t=Uf("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,s,i,o.positions,e.availableImages,e.brightness);a.insert(t[s].feature,r,s,c,this.index)}}addConstantDashes(t){let e=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)e=!0;else{const e=r.value,i=n.value;if(!i)continue;t.addDash(i,e)}}return e}addFeatureDashes(t,e){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,s=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===s.kind)continue;let o,a;if("constant"===r.kind){if(o=r.value,!o)continue}else o=r.evaluate({zoom:i},t);a="constant"===s.kind?s.value:s.evaluate({zoom:i},t),e.addDash(o,a),t.patterns[n.id]=e.getKey(o,a)}}update(t,e,i,n,r){const s=0!==Object.keys(t).length;s&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(t,e,s?this.stateDependentLayers:this.layers,i,n,r)}addFeatures(t,e,i,n,r,s){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i,n,s)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,wy)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,by),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,n,r,s,o){const a=this.layers[0].layout,l=a.get("line-join").evaluate(t,{}),c=a.get("line-cap").evaluate(t,{}),h=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,l,c,h,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,s,n,o)}addLine(t,e,i,n,r,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const o="Polygon"===Ey[e.type];let a=t.length;for(;a>=2&&t[a-1].equals(t[a-2]);)a--;let l=0;for(;l<a-1&&t[l].equals(t[l+1]);)l++;if(a<(o?3:2))return;"bevel"===i&&(r=1.05);const c=this.overscaling<=16?15*un/(512*this.overscaling):0,h=this.segments.prepareSegment(10*a,this.layoutVertexArray,this.indexArray);let u,d,p,f,m;this.e1=this.e2=-1,o&&(u=t[a-2],m=t[l].sub(u)._unit()._perp());for(let e=l;e<a;e++){if(p=e===a-1?o?t[l+1]:void 0:t[e+1],p&&t[e].equals(p))continue;m&&(f=m),u&&(d=u),u=t[e],m=p?p.sub(u)._unit()._perp():f,f=f||m;let g=f.add(m);0===g.x&&0===g.y||g._unit();const _=f.x*m.x+f.y*m.y,y=g.x*m.x+g.y*m.y,v=0!==y?1/y:1/0,b=2*Math.sqrt(2-2*y),x=y<Sy&&d&&p,w=f.x*m.y-f.y*m.x>0;if(x&&e>l){const t=u.dist(d);if(t>2*c){const e=u.sub(u.sub(d)._mult(c/t)._round());this.updateDistance(d,e),this.addCurrentVertex(e,f,0,0,h),d=e}}const E=d&&p;let S=E?i:o?"butt":n;if(E&&"round"===S&&(v<s?S="miter":v<=2&&(S="fakeround")),"miter"===S&&v>r&&(S="bevel"),"bevel"===S&&(v>2&&(S="flipbevel"),v<r&&(S="miter")),d&&this.updateDistance(d,u),"miter"===S)g._mult(v),this.addCurrentVertex(u,g,0,0,h);else if("flipbevel"===S){if(v>100)g=m.mult(-1);else{const t=v*f.add(m).mag()/f.sub(m).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(u,g,0,0,h),this.addCurrentVertex(u,g.mult(-1),0,0,h)}else if("bevel"===S||"fakeround"===S){const t=-Math.sqrt(v*v-1),e=w?t:0,i=w?0:t;if(d&&this.addCurrentVertex(u,f,e,i,h),"fakeround"===S){const t=Math.round(180*b/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*t*t+(.848013+_*(.215638*_-1.06021)))}const n=m.sub(f)._mult(i)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(u,n.x,n.y,!1,w,0,h)}}p&&this.addCurrentVertex(u,m,-e,-i,h)}else if("butt"===S)this.addCurrentVertex(u,g,0,0,h);else if("square"===S){const t=d?1:-1;d||this.addCurrentVertex(u,g,t,t,h),this.addCurrentVertex(u,g,0,0,h),d&&this.addCurrentVertex(u,g,t,t,h)}else"round"===S&&(d&&(this.addCurrentVertex(u,f,0,0,h),this.addCurrentVertex(u,f,1,1,h,!0)),p&&(this.addCurrentVertex(u,m,-1,-1,h,!0),this.addCurrentVertex(u,m,0,0,h)));if(x&&e<a-1){const t=u.dist(p);if(t>2*c){const e=u.add(p.sub(u)._mult(c/t)._round());this.updateDistance(u,e),this.addCurrentVertex(e,m,0,0,h),u=e}}}}addCurrentVertex(t,e,i,n,r,s=!1){const o=e.y*n-e.x,a=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,s,!1,i,r),this.addHalfVertex(t,o,a,s,!0,-n,r)}addHalfVertex({x:t,y:e},i,n,r,s,o,a){this.layoutVertexArray.emplaceBack((t<<1)+(r?1:0),(e<<1)+(s?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),s?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}Lo(Ty,"LineBucket",{omit:["layers","patternFeatures"]});class My{constructor(t,e,i,n){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,i,n){const{width:r,height:s}=t,{context:o}=this,{gl:a}=o,{HTMLImageElement:l,HTMLCanvasElement:c,HTMLVideoElement:h,ImageData:u,ImageBitmap:d}=e;if(a.bindTexture(a.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!i||!1!==i.premultiply)),n||this.size&&this.size[0]===r&&this.size[1]===s){const{x:e,y:i}=n||{x:0,y:0};if(t instanceof l||t instanceof c||t instanceof h||t instanceof u||d&&t instanceof d)a.texSubImage2D(a.TEXTURE_2D,0,e,i,a.RGBA,a.UNSIGNED_BYTE,t);else{let n=this.format,o=a.UNSIGNED_BYTE;this.format===a.R32F&&(n=a.RED,o=a.FLOAT),a.texSubImage2D(a.TEXTURE_2D,0,e,i,r,s,n,o,t.data)}}else if(this.size=[r,s],t instanceof l||t instanceof c||t instanceof h||t instanceof u||d&&t instanceof d){let e=this.format;this.format===a.R8&&(e=a.RED),a.texImage2D(a.TEXTURE_2D,0,this.format,e,a.UNSIGNED_BYTE,t)}else{let e=this.format,i=this.format,n=a.UNSIGNED_BYTE;this.format===a.DEPTH_COMPONENT&&(e=a.DEPTH_COMPONENT16,n=a.UNSIGNED_SHORT),this.format===a.R32F&&(n=a.FLOAT,i=a.RED),a.texImage2D(a.TEXTURE_2D,0,e,r,s,0,i,n,t.data)}this.useMipmap=Boolean(i&&i.useMipmap),this.useMipmap&&a.generateMipmap(a.TEXTURE_2D)}bind(t,e){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),t!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,this.useMipmap?t===n.NEAREST?n.NEAREST_MIPMAP_NEAREST:n.LINEAR_MIPMAP_NEAREST:t),this.minFilter=t),e!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrapS=e)}bindExtraParam(t,e,i,n){const{context:r}=this,{gl:s}=r;s.bindTexture(s.TEXTURE_2D,this.texture),e!==this.magFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,e),this.magFilter=e),t!==this.minFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,this.useMipmap?t===s.NEAREST?s.NEAREST_MIPMAP_NEAREST:s.LINEAR_MIPMAP_NEAREST:t),this.minFilter=t),i!==this.wrapS&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,i),this.wrapS=i),n!==this.wrapT&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,n),this.wrapT=n)}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class Ay{constructor(t,e){this.context=t,this.texture=e}bind(t,e){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),t!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,t),this.minFilter=t),e!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrapS=e)}}const Cy=32,ky=33,Py=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,i=0,n=0,r=0,s=0,o=0,a=0;for(1&e?r=s=o=Cy:i=n=a=Cy;(e>>=1)>1;){const t=i+r>>1,l=n+s>>1;1&e?(r=i,s=n,i=o,n=a):(i=r,n=s,r=o,s=a),o=t,a=l}const l=4*t;Py[l+0]=i,Py[l+1]=n,Py[l+2]=r,Py[l+3]=s}const Iy=new Uint16Array(2178),Dy=new Uint8Array(1089),Oy=new Uint16Array(1089);function Ly(t){return 0===t?-.03125:32===t?.03125:0}var zy=ka([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Ry={type:2,extent:un,loadGeometry:()=>[[new v(0,0),new v(un+1,0),new v(un+1,un+1),new v(0,un+1),new v(0,0)]]};class Fy{constructor(t,e,i,n,r){this.tileID=t,this.uid=N(),this.uses=0,this.tileSize=e,this.tileZoom=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=r,n&&n.style&&(this._lastUpdatedBrightness=n.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",n&&n.transform&&(this.projection=n.transform.projection)}registerFadeDuration(t){const e=t+this.timeAdded;e<pe.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=D_(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,e,i){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const n of t){const t=n.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.fqid]=n}}return i}(t.buckets,e.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const e=this.buckets[t];if(e instanceof yy){if(this.hasSymbolBuckets=!0,!i)break;e.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const e=this.buckets[t];if(e instanceof yy&&e.hasRTLText){this.hasRTLText=!0,sa.isLoading()||sa.isLoaded()||"deferred"!==na()||ra();break}}this.queryPadding=0;for(const t in this.buckets){const i=this.buckets[t],n=e.style.getOwnLayer(t);if(!n)continue;const r=n.queryRadius(i);this.queryPadding=Math.max(this.queryPadding,r)}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new ll}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(t){return this.buckets[t.fqid]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new My(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new My(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new My(t,this.lineAtlas.image,e.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t,e,i){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture,i),!e||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const n=e.style.getBrightness();(this._lastUpdatedBrightness||n)&&(this._lastUpdatedBrightness&&n&&Math.abs(this._lastUpdatedBrightness-n)<.001||(this._lastUpdatedBrightness=n,this.updateBuckets(void 0,e)))}queryRenderedFeatures(t,e,i,n,r,s,o,a){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:n,pixelPosMatrix:o,transform:s,params:r,tileTransform:this.tileTransform},t,e,i):{}}querySourceFeatures(t,e){const i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;const n=i.loadVTLayers(),r=e?e.sourceLayer:"",s=n._geojsonTileLayer||n[r];if(!s)return;const o=Bs(e&&e.filter),{z:a,x:l,y:c}=this.tileID.canonical,h={z:a,x:l,y:c};for(let e=0;e<s.length;e++){const n=s.feature(e);if(o.needGeometry){const t=yp(n,!0);if(!o.filter(new oa(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!o.filter(new oa(this.tileID.overscaledZ),n))continue;const u=i.getId(n,r),d=new Bm(n,a,l,c,u);d.tile=h,t.push(d)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}bucketsLoaded(){for(const t in this.buckets)if(this.buckets[t].uploadPending())return!1;return!0}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const e=this.expirationTime;if(t.cacheControl){const e=et(t.cacheControl);e["max-age"]&&(this.expirationTime=Date.now()+1e3*e["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let i=!1;if(this.expirationTime>t)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{const n=this.expirationTime-e;n?this.expirationTime=t+Math.max(n,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length&&e&&this.updateBuckets(t,e)}updateBuckets(t,e){if(!this.latestFeatureIndex)return;const i=this.latestFeatureIndex.loadVTLayers(),n=e.style.listImages(),r=e.style.getBrightness();for(const s in this.buckets){if(!e.style.hasLayer(s))continue;const o=this.buckets[s],a=o.layers[0].sourceLayer||"_geojsonTileLayer",l=i[a];let c={};if(t&&(c=t[a],!l||!c||0===Object.keys(c).length))continue;if(o.update(c,l,n,this.imageAtlas&&this.imageAtlas.patternPositions||{},r),o instanceof Ty||o instanceof $f){const t=e.style.getOwnSourceCache(o.layers[0].source);e._terrain&&e._terrain.enabled&&t&&o.programConfigurations.needsUpload&&e._terrain._clearRenderCacheForTile(t.id,this.tileID)}const h=e&&e.style&&e.style.getOwnLayer(s);h&&(this.queryPadding=Math.max(this.queryPadding,h.queryRadius(o)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<pe.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=pe.now()+t}setTexture(t,e){const i=e.context,n=i.gl;this.texture=this.texture||e.getTileTexture(t.width),this.texture&&this.texture instanceof My?this.texture.update(t,{useMipmap:!0}):(this.texture=new My(i,t,n.RGBA,{useMipmap:!0}),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE))}setDependencies(t,e){const i={};for(const t of e)i[t]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,e){if(!e||"mercator"===e.name||this._tileDebugBuffer)return;const i=_p(Ry,this.tileID.canonical,this.tileTransform)[0],n=new Ia,r=new el;for(let t=0;t<i.length;t++){const{x:e,y:s}=i[t];n.emplaceBack(e,s),r.emplaceBack(t)}r.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(r),this._tileDebugBuffer=t.createVertexBuffer(n,ju.members),this._tileDebugSegments=bl.simpleSegment(0,0,n.length,r.length)}_makeTileBoundsBuffers(t,e){if(this._tileBoundsBuffer||!e||"mercator"===e.name)return;const i=_p(Ry,this.tileID.canonical,this.tileTransform)[0];let n,r;if(this.isRaster){const t=function(t,e){const i=D_(t,e),n=Math.pow(2,t.z);for(let r=0;r<ky;r++)for(let s=0;s<ky;s++){const o=ep((t.x+(s+Ly(s))/Cy)/n),a=ip((t.y+(r+Ly(r))/Cy)/n),l=e.project(o,a),c=r*ky+s;Iy[2*c+0]=Math.round((l.x*i.scale-i.x)*un),Iy[2*c+1]=Math.round((l.y*i.scale-i.y)*un)}Dy.fill(0),Oy.fill(0);for(let t=2045;t>=0;t--){const e=4*t,i=Py[e+0],n=Py[e+1],r=Py[e+2],s=Py[e+3],o=i+r>>1,a=n+s>>1,l=o+a-n,c=a+i-o,h=n*ky+i,u=s*ky+r,d=a*ky+o,p=Math.hypot((Iy[2*h+0]+Iy[2*u+0])/2-Iy[2*d+0],(Iy[2*h+1]+Iy[2*u+1])/2-Iy[2*d+1])>=16;Dy[d]=Dy[d]||(p?1:0),t<1022&&(Dy[d]=Dy[d]||Dy[(n+c>>1)*ky+(i+l>>1)]||Dy[(s+c>>1)*ky+(r+l>>1)])}const r=new Oa,s=new Za;let o=0;function a(t,e){const i=e*ky+t;return 0===Oy[i]&&(r.emplaceBack(Iy[2*i+0],Iy[2*i+1],t*un/Cy,e*un/Cy),Oy[i]=++o),Oy[i]-1}function l(t,e,i,n,r,o){const c=t+i>>1,h=e+n>>1;if(Math.abs(t-r)+Math.abs(e-o)>1&&Dy[h*ky+c])l(r,o,t,e,c,h),l(i,n,r,o,c,h);else{const l=a(t,e),c=a(i,n),h=a(r,o);s.emplaceBack(l,c,h)}}return l(0,0,Cy,Cy,Cy,0),l(Cy,Cy,0,0,0,Cy),{vertices:r,indices:s}}(this.tileID.canonical,e);n=t.vertices,r=t.indices}else{n=new Oa,r=new Za;for(const{x:t,y:e}of i)n.emplaceBack(t,e,0,0);const t=Bf(n.int16,void 0,4);for(let e=0;e<t.length;e+=3)r.emplaceBack(t[e],t[e+1],t[e+2])}this._tileBoundsBuffer=t.createVertexBuffer(n,zy.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(r),this._tileBoundsSegments=bl.simpleSegment(0,0,n.length,r.length)}_makeGlobeTileDebugBuffers(t,e){const i=e.projection;if(!i||"globe"!==i.name||e.freezeTileCoverage)return;const n=this.tileID.canonical,r=Ad(_d(n,e)),s=Od(e.zoom);let o;s>0&&(o=Au.invert(new Float64Array(16),e.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,n,e,r,o,s),this._makeGlobeTileDebugTextBuffer(t,n,e,r,o,s)}_globePoint(t,e,i,n,r,s,o){let a=Sd(t,e,i);if(s){const r=1<<i.z,l=Qd(n.center.lng),c=Jd(n.center.lat),h=(i.x+.5)/r-l;let u=0;h>.5?u=-1:h<-.5&&(u=1);let d=(t/un+i.x)/r+u,p=(e/un+i.y)/r;d=(d-l)*n._pixelsPerMercatorPixel+l,p=(p-c)*n._pixelsPerMercatorPixel+c;const f=[d*n.worldSize,p*n.worldSize,0];Ou.transformMat4(f,f,s),a=gd(a,f,o)}return Ou.transformMat4(a,a,r)}_makeGlobeTileDebugBorderBuffer(t,e,i,n,r,s){const o=new Ia,a=new el,l=new Da,c=(t,c,h,u,d)=>{const p=(h-t)/(d-1),f=(u-c)/(d-1),m=o.length;for(let h=0;h<d;h++){const u=t+h*p,d=c+h*f;o.emplaceBack(u,d);const g=this._globePoint(u,d,e,i,n,r,s);l.emplaceBack(g[0],g[1],g[2]),a.emplaceBack(m+h)}},h=un;c(0,0,h,0,16),c(h,0,h,h,16),c(h,h,0,h,16),c(0,h,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(a),this._tileDebugBuffer=t.createVertexBuffer(o,ju.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(l,Nu.members),this._tileDebugSegments=bl.simpleSegment(0,0,o.length,a.length)}_makeGlobeTileDebugTextBuffer(t,e,i,n,r,s){const o=un/4,a=new Ia,l=new Za,c=new Da,h=25;l.reserve(32),a.reserve(h),c.reserve(h);const u=(t,e)=>h*t+e;for(let t=0;t<h;t++){const l=t*o;for(let t=0;t<h;t++){const h=t*o;a.emplaceBack(h,l);const u=this._globePoint(h,l,e,i,n,r,s);c.emplaceBack(u[0],u[1],u[2])}}for(let t=0;t<4;t++)for(let e=0;e<4;e++){const i=u(t,e),n=u(t,e+1),r=u(t+1,e),s=u(t+1,e+1);l.emplaceBack(i,n,r),l.emplaceBack(r,n,s)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(l),this._tileDebugTextBuffer=t.createVertexBuffer(a,ju.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(c,Nu.members),this._tileDebugTextSegments=bl.simpleSegment(0,0,h,32)}destroy(t=!1){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),!t&&this.texture&&this.texture instanceof My&&(this.texture.destroy(),delete this.texture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.latestFeatureIndex=null,this.state="unloaded"}}class By{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const r={value:e,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout((()=>{this.remove(t,r)}),i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const n of this.data[i])t(n.value)||e.push(n);for(const t of e)this.remove(t.value.tileID,t)}}class Ny{constructor(t,e,i,n){this.id=Ny.uniqueIdxCounter,Ny.uniqueIdxCounter++,this.context=t;const r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||n||e.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){this.id=Ny.uniqueIdxCounter,Ny.uniqueIdxCounter++;const e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Ny.uniqueIdxCounter=0;const jy={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Vy{constructor(t,e,i,n,r,s){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.instanceCount=s,this.context=t;const o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||r||e.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const n=e.attributes[this.attributes[i].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,i){for(let n=0;n<this.attributes.length;n++){const r=this.attributes[n],s=e.attributes[r.name];void 0!==s&&t.vertexAttribPointer(s,r.components,t[jy[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}setVertexAttribDivisor(t,e,i){for(let n=0;n<this.attributes.length;n++){const r=e.attributes[this.attributes[n].name];void 0!==r&&this.instanceCount&&this.instanceCount>0&&t.vertexAttribDivisor(r,i)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Uy{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class $y extends Uy{getDefault(){return ui.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Hy extends Uy{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class qy extends Uy{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Wy extends Uy{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Gy extends Uy{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Zy extends Uy{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Yy extends Uy{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Xy extends Uy{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Ky extends Uy{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class Qy extends Uy{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Jy extends Uy{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class tv extends Uy{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class ev extends Uy{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class iv extends Uy{getDefault(){const t=this.gl;return[t.ONE,t.ZERO,t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.blendFuncSeparate(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class nv extends Uy{getDefault(){return ui.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class rv extends Uy{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(t,t),this.current=t,this.dirty=!1)}}class sv extends Uy{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class ov extends Uy{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class av extends Uy{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}let lv=class extends Uy{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}};class cv extends Uy{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class hv extends Uy{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class uv extends Uy{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class dv extends Uy{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class pv extends Uy{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class fv extends Uy{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class mv extends Uy{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class gv extends Uy{getDefault(){return null}set(t){this.gl&&(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}}class _v extends Uy{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class yv extends Uy{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class vv extends Uy{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class bv extends Uy{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class xv extends bv{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class wv extends bv{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,this.attachment(),e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ev extends bv{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,this.attachment(),e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Sv extends wv{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class Tv{constructor(t,e,i,n,r){this.context=t,this.width=e,this.height=i;const s=this.framebuffer=t.gl.createFramebuffer();n&&(this.colorAttachment=new xv(t,s)),r&&(this.depthAttachmentType=r,this.depthAttachment="renderbuffer"===r?new wv(t,s):new Ev(t,s))}destroy(){const t=this.context.gl;if(this.colorAttachment){const e=this.colorAttachment.get();e&&t.deleteTexture(e)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}else{const e=this.depthAttachment.get();e&&t.deleteTexture(e)}t.deleteFramebuffer(this.framebuffer)}}class Mv{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}Mv.ReadOnly=!1,Mv.ReadWrite=!0,Mv.disabled=new Mv(519,Mv.ReadOnly,[0,1]);const Av=7680;class Cv{constructor(t,e,i,n,r,s){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=r,this.pass=s}}Cv.disabled=new Cv({func:519,mask:0},0,0,Av,Av,Av);const kv=771;class Pv{constructor(t,e,i,n){this.blendFunction=t,this.blendColor=e,this.mask=i,this.blendEquation=n}}Pv.Replace=[1,0,1,0],Pv.disabled=new Pv(Pv.Replace,ui.transparent,[!1,!1,!1,!1]),Pv.unblended=new Pv(Pv.Replace,ui.transparent,[!0,!0,!0,!0]),Pv.alphaBlended=new Pv([1,kv,1,kv],ui.transparent,[!0,!0,!0,!0]),Pv.multiply=new Pv([774,0,774,0],ui.transparent,[!0,!0,!0,!0]);const Iv=1029,Dv=2305;class Ov{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}Ov.disabled=new Ov(!1,Iv,Dv),Ov.backCCW=new Ov(!0,Iv,Dv),Ov.backCW=new Ov(!0,Iv,2304),Ov.frontCW=new Ov(!0,1028,2304),Ov.frontCCW=new Ov(!0,1028,Dv);class Lv{constructor(t,e){this.gl=t,this.clearColor=new $y(this),this.clearDepth=new Hy(this),this.clearStencil=new qy(this),this.colorMask=new Wy(this),this.depthMask=new Gy(this),this.stencilMask=new Zy(this),this.stencilFunc=new Yy(this),this.stencilOp=new Xy(this),this.stencilTest=new Ky(this),this.depthRange=new Qy(this),this.depthTest=new Jy(this),this.depthFunc=new tv(this),this.blend=new ev(this),this.blendFunc=new iv(this),this.blendColor=new nv(this),this.blendEquation=new rv(this),this.cullFace=new sv(this),this.cullFaceSide=new ov(this),this.frontFace=new av(this),this.program=new lv(this),this.activeTexture=new cv(this),this.viewport=new hv(this),this.bindFramebuffer=new uv(this),this.bindRenderbuffer=new dv(this),this.bindTexture=new pv(this),this.bindVertexBuffer=new fv(this),this.bindElementBuffer=new mv(this),this.bindVertexArrayOES=new gv(this),this.pixelStoreUnpack=new _v(this),this.pixelStoreUnpackPremultiplyAlpha=new yv(this),this.pixelStoreUnpackFlipY=new vv(this),this.options=e?{...e}:{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=t.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=t.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=t.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=t.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e,i){return new Ny(this,t,e,i)}createVertexBuffer(t,e,i,n,r){return new Vy(this,t,e,i,n,r)}createRenderbuffer(t,e,i){const n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),r}createFramebuffer(t,e,i,n){return new Tv(this,t,e,i,n)}clear({color:t,depth:e,stencil:i,colorMask:n}){const r=this.gl;let s=0;t&&(s|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set(n||[!0,!0,!0,!0])),void 0!==e&&(s|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(s|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(s)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){b(t.blendFunction,Pv.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}class zv extends Ie{constructor(t,e,i){super(),this.id=t,this._onlySymbols=i,e.on("data",(t=>{"source"===t.dataType&&"metadata"===t.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),e.on("error",(()=>{this._sourceErrored=!0})),this._source=e,this._tiles={},this._cache=new By(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=e.minTileCacheSize,this._maxTileCacheSize=e.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Nm,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(t){this.map=t,this._minTileCacheSize=void 0===this._minTileCacheSize&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const t in this._tiles){const e=this._tiles[t];if("errored"!==e.state&&("loaded"!==e.state||!e.bucketsLoaded()))return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,e){return t.isSymbolTile=this._onlySymbols,t.isExtraShadowCaster=this._shadowCasterTiles[t.tileID.key],this._source.loadTile(t,e)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,(()=>{}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return z(this._tiles).map((t=>t.tileID)).sort(Rv).map((t=>t.key))}getRenderableIds(t,e){const i=[];for(const n in this._tiles)this._isIdRenderable(+n,t,e)&&i.push(this._tiles[n]);return t?i.sort(((t,e)=>{const i=t.tileID,n=e.tileID,r=new v(i.canonical.x,i.canonical.y)._rotate(this.transform.angle),s=new v(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return i.overscaledZ-n.overscaledZ||s.y-r.y||s.x-r.x})).map((t=>t.tileID.key)):i.map((t=>t.tileID)).sort(Rv).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())&&(i||!this._shadowCasterTiles[t])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(+t,"reloading")}}_reloadTile(t,e){const i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))}_tileLoaded(t,e,i,n){if(n)if(t.state="errored",404!==n.status)this._source.fire(new Pe(n,{tile:t}));else{if(!(t.tileID.key in this._loadedParentTiles))return void this._source.fire(new ke("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id}));if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const t=this.map.painter.terrain;this.update(this.transform,t.getScaledDemTileSize(),!0),t.resetTileLookupCache(this.id)}else this.update(this.transform)}else t.timeAdded=pe.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new ke("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n<e.length;n++){const r=e[n];if(t.neighboringTiles&&t.neighboringTiles[r]){const e=this.getTileByID(r);i(t,e),i(e,t)}}function i(t,e){if(!t.dem||t.dem.borderReady)return;t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x;const n=e.tileID.canonical.y-t.tileID.canonical.y,r=Math.pow(2,t.tileID.canonical.z),s=e.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[s]&&(t.neighboringTiles[s].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,n){for(const r in this._tiles){let s=this._tiles[r];if(n[r]||!s.hasData()||s.tileID.overscaledZ<=e||s.tileID.overscaledZ>i)continue;let o=s.tileID;for(;s&&s.tileID.overscaledZ>e+1;){const t=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[t.key],s&&s.hasData()&&(o=t)}let a=o;for(;a.overscaledZ>e;)if(a=a.scaledTo(a.overscaledZ-1),t[a.key]){n[o.key]=o;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),n=this._getLoadedTile(e);if(n)return n}}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,e){e=e||this._source.tileSize;const i=Math.ceil(t.width/e)+1,n=Math.ceil(t.height/e)+1,r=Math.floor(i*n*5),s="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,s):s;this._cache.setMaxSize(o)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(+t,this._tiles[t])}}update(t,e,i,n){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!i)return;let r;if(this.updateCacheSize(t,e),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new qu(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(r=t.coveringTiles({tileSize:e||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!i,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(r=r.filter((t=>this._source.hasTile(t))))):r=[],r.length>0&&this.castsShadows&&n&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!Fv(this._source.type)){const s=t.coveringZoomLevel({tileSize:e||this._source.tileSize,roundZoom:this._source.roundZoom&&!i}),o=Math.min(s,this._source.maxzoom),a=t.extendTileCoverForShadows(r,n,o);for(const t of a)this._shadowCasterTiles[t.key]=!0,r.push(t)}const s=this._updateRetainedTiles(r);if(Fv(this._source.type)&&0!==r.length){const t={},e={},i=Object.keys(s);for(const n of i){const i=s[n],r=this._tiles[n];if(!r||r.fadeEndTime&&r.fadeEndTime<=pe.now())continue;const o=this.findLoadedParent(i,Math.max(i.overscaledZ-zv.maxOverzooming,this._source.minzoom));o&&(this._addTile(o.tileID),t[o.tileID.key]=o.tileID),e[n]=i}const n=r[r.length-1].overscaledZ;for(const t in this._tiles){const i=this._tiles[t];if(s[t]||!i.hasData())continue;let r=i.tileID;for(;r.overscaledZ>n;){r=r.scaledTo(r.overscaledZ-1);const n=this._tiles[r.key];if(n&&n.hasData()&&e[r.key]){s[t]=i.tileID;break}}}for(const e in t)s[e]||(this._coveredTiles[e]=!0,s[e]=t[e])}for(const t in s)this._tiles[t].clearFadeHold();const o=function(t,e){const i=[];for(const n in t)n in e||i.push(n);return i}(this._tiles,s);for(const t of o){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(+t)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const e={};if(0===t.length)return e;const i={},n=t.reduce(((t,e)=>Math.min(t,e.overscaledZ)),1/0),r=t[0].overscaledZ,s=Math.max(r-zv.maxOverzooming,this._source.minzoom),o=Math.max(r+zv.maxUnderzooming,this._source.minzoom),a={};for(const i of t){const t=this._addTile(i);e[i.key]=i,t.hasData()||n<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,n,o,e);for(const n of t){let t=this._tiles[n.key];if(t.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const t=n.children(this._source.maxzoom)[0],i=this.getTile(t);if(i&&i.hasData()){e[t.key]=t;continue}}else{const t=n.children(this._source.maxzoom);if(e[t[0].key]&&e[t[1].key]&&e[t[2].key]&&e[t[3].key])continue}let r=t.wasRequested();for(let o=n.overscaledZ-1;o>=s;--o){const s=n.scaledTo(o);if(i[s.key])break;if(i[s.key]=!0,t=this.getTile(s),!t&&r&&(t=this._addTile(s)),t&&(e[s.key]=s,r=t.wasRequested(),t.hasData()))break}}return e}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;n=t}for(const t of e)this._loadedParentTiles[t]=i}}_addTile(t){let e=this._tiles[t.key];if(e)return!0!==e.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),e;e=this._cache.getAndRemove(t),e&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));const i=Boolean(e);if(!i){const i=this.map?this.map.painter:null;e=new Fy(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,i,this._isRaster),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))}return e?(e.uses++,this._tiles[t.key]=e,i||this._source.fire(new ke("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,e,i){const n=[],r=this.transform;if(!r)return n;const s="globe"===r.projection.name,o=Qd(r.center.lng);for(const a in this._tiles){const l=this._tiles[a];if(i&&l.clearQueryDebugViz(),l.holdingForFade())continue;let c;if(s){const t=l.tileID.canonical;if(0===t.z){const e=[Math.abs(I(o,...Bv(t,-1))-o),Math.abs(I(o,...Bv(t,1))-o)];c=[0,2*e.indexOf(Math.min(...e))-1]}else{const e=[Math.abs(I(o,...Bv(t,-1))-o),Math.abs(I(o,...Bv(t,0))-o),Math.abs(I(o,...Bv(t,1))-o)];c=[e.indexOf(Math.min(...e))-1]}}else c=[0];for(const i of c){const s=t.containsTile(l,r,e,i);s&&n.push(s)}}return n}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(t){return this._getRenderableCoordinates(t)}_getRenderableCoordinates(t,e){const i=this.getRenderableIds(t,e).map((t=>this._tiles[t].tileID)),n="globe"===this.transform.projection.name;for(const t of i)t.projMatrix=this.transform.calculateProjMatrix(t.toUnwrapped()),t.expandedProjMatrix=n?this.transform.calculateProjMatrix(t.toUnwrapped(),!1,!0):t.projMatrix;return i}sortCoordinatesByDistance(t){const e=t.slice(),i=this.transform._camera.position,n=this.transform._camera.forward(),r={};for(const t of e){const e=1/(1<<t.canonical.z);r[t.key]=((t.canonical.x+.5)*e+t.wrap-i[0])*n[0]+((t.canonical.y+.5)*e-i[1])*n[1]-i[2]*n[2]}return e.sort(((t,e)=>r[t.key]-r[e.key])),e}hasTransition(){if(this._source.hasTransition())return!0;if(Fv(this._source.type))for(const t in this._tiles){const e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=pe.now())return!0}return!1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const n=this._tiles[t];n&&n.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(+i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)))}_preloadTiles(t,e){if(!this._sourceLoaded){const i=()=>{this._sourceLoaded&&(this._source.off("data",i),this._preloadTiles(t,e))};return void this._source.on("data",i)}const i=new Map,n=Array.isArray(t)?t:[t],r=this.map.painter.terrain,s=this.usedForTerrain&&r?r.getScaledDemTileSize():this._source.tileSize;for(const t of n){const e=t.coveringTiles({tileSize:s,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const t of e)i.set(t.key,t);this.usedForTerrain&&t.updateElevation(!1)}L(Array.from(i.values()),((t,e)=>{const i=new Fy(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(i,(t=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),e(t,i)}))}),e)}}function Rv(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Fv(t){return"raster"===t||"image"===t||"video"===t||"custom"===t}function Bv(t,e){const i=1<<t.z;return[t.x/i+e,(t.x+1)/i+e]}zv.maxOverzooming=10,zv.maxUnderzooming=3;const Nv=ka([{name:"a_pos_3f",components:3,type:"Float32"}]),jv=ka([{name:"a_color_3f",components:3,type:"Float32"}]),Vv=ka([{name:"a_color_4f",components:4,type:"Float32"}]),Uv=ka([{name:"a_uv_2f",components:2,type:"Float32"}]),$v=ka([{name:"a_normal_3f",components:3,type:"Float32"}]),Hv=ka([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),qv=ka([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);class Wv{constructor(t=0,e=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n}interpolate(t,e,i){return null!=e.top&&null!=t.top&&(this.top=Jn(t.top,e.top,i)),null!=e.bottom&&null!=t.bottom&&(this.bottom=Jn(t.bottom,e.bottom,i)),null!=e.left&&null!=t.left&&(this.left=Jn(t.left,e.left,i)),null!=e.right&&null!=t.right&&(this.right=Jn(t.right,e.right,i)),this}getCenter(t,e){const i=I((this.left+t-this.right)/2,0,t),n=I((this.top+e-this.bottom)/2,0,e);return new v(i,n)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Wv(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Gv(t,e){const i=st(t,3);Au.fromQuat(t,e),ot(t,3,i)}function Zv(t,e){const i=ku.identity([]);return ku.rotateZ(i,i,-e),ku.rotateX(i,i,-t),i}function Yv(t,e){const i=[t[0],t[1],0],n=[e[0],e[1],0];if(Ou.length(i)>=1e-15){const t=Ou.normalize([],i);Ou.scale(n,t,Ou.dot(n,t)),e[0]=n[0],e[1]=n[1]}const r=Ou.cross([],e,t);if(Ou.len(r)<1e-15)return null;const s=Math.atan2(-r[1],r[0]);return Zv(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),s)}class Xv{constructor(t,e){this.position=t,this.orientation=e}get position(){return this._position}set position(t){if(t){const e=t instanceof cp?t:new cp(t[0],t[1],t[2]);this._renderWorldCopies&&(e.x=O(e.x,0,1)),this._position=e}else this._position=null}lookAtPoint(t,e){if(this.orientation=null,!this.position)return;const i=this.position,n=this._elevation?this._elevation.getAtPointOrZero(cp.fromLngLat(t)):0,r=cp.fromLngLat(t,n),s=[r.x-i.x,r.y-i.y,r.z-i.z];e||(e=[0,0,1]),e[2]=Math.abs(e[2]),this.orientation=Yv(s,e)}setPitchBearing(t,e){this.orientation=Zv(E(t),E(-e))}}class Kv{constructor(t,e){this._transform=Au.identity([]),this.orientation=e,this.position=t}get mercatorPosition(){const t=this.position;return new cp(t[0],t[1],t[2])}get position(){const t=st(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var e;t&&ot(this._transform,3,[(e=t)[0],e[1],e[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||ku.identity([]),t&&Gv(this._transform,this._orientation)}getPitchBearing(){const t=this.forward(),e=this.right();return{bearing:Math.atan2(-e[1],e[0]),pitch:Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2])}}setPitchBearing(t,e){this._orientation=Zv(t,e),Gv(this._transform,this._orientation)}forward(){const t=st(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=st(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=st(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,e){const i=new Float64Array(16);return Au.invert(i,this.getWorldToCamera(t,e)),i}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,e,i){const n=this.position;Ou.scale(n,n,-t);const r=new Float64Array(16);return Au.fromScaling(r,[i,i,i]),Au.translate(r,r,n),r[10]*=e,r}getWorldToCamera(t,e){const i=new Float64Array(16),n=new Float64Array(4),r=this.position;return ku.conjugate(n,this._orientation),Ou.scale(r,r,-t),Au.fromQuat(i,n),Au.translate(i,i,r),i[1]*=-1,i[5]*=-1,i[9]*=-1,i[13]*=-1,i[8]*=e,i[9]*=e,i[10]*=e,i[11]*=e,i}getCameraToClipPerspective(t,e,i,n){const r=new Float64Array(16);return Au.perspective(r,t,e,i,n),r}getCameraToClipOrthographic(t,e,i,n,r,s){const o=new Float64Array(16);return Au.ortho(o,t,e,i,n,r,s),o}getDistanceToElevation(t,e=!1){const i=0===t?0:tp(t,e?ip(this.position[1]):this.position[1]),n=this.forward();return(i-this.position[2])/n[2]}clone(){return new Kv([...this.position],[...this.orientation])}}function Qv(t,e){const i=tb(t.projection,t.zoom,t.width,t.height),n=function(t,e,i,n,r){const s=new Zd(i.lng-180*eb,i.lat),o=new Zd(i.lng+180*eb,i.lat),a=t.project(s.lng,s.lat),l=t.project(o.lng,o.lat),c=-Math.atan2(l.y-a.y,l.x-a.x),h=cp.fromLngLat(i);h.y=I(h.y,-1+eb,1-eb);const u=h.toLngLat(),d=t.project(u.lng,u.lat),p=cp.fromLngLat(u);p.x+=eb;const f=p.toLngLat(),m=t.project(f.lng,f.lat),g=nb(m.x-d.x,m.y-d.y,c),_=cp.fromLngLat(u);_.y+=eb;const y=_.toLngLat(),v=t.project(y.lng,y.lat),b=nb(v.x-d.x,v.y-d.y,c),x=Math.abs(g.x)/Math.abs(b.y),w=Au.identity([]);Au.rotateZ(w,w,-c*(1-(r?0:n)));const E=Au.identity([]);return Au.scale(E,E,[1,1-(1-x)*n,1]),E[4]=-b.x/b.y*n,Au.rotateZ(E,E,c),Au.multiply(E,w,E),E}(t.projection,0,t.center,i,e),r=Jv(t);return Au.scale(n,n,[r,r,1]),n}function Jv(t){const e=t.projection,i=tb(t.projection,t.zoom,t.width,t.height),n=ib(e,t.center),r=ib(e,Zd.convert(e.center));return Math.pow(2,n*i+(1-i)*r)}function tb(t,e,i,n,r=1/0){const s=t.range;if(!s)return 0;const o=Math.min(r,Math.max(i,n)),a=Math.log(o/1024)/Math.LN2;return D(s[0]+a,s[1]+a,e)}const eb=1/4e4;function ib(t,e){const i=I(e.lat,-rp,rp),n=new Zd(e.lng-180*eb,i),r=new Zd(e.lng+180*eb,i),s=t.project(n.lng,i),o=t.project(r.lng,i),a=cp.fromLngLat(n),l=cp.fromLngLat(r),c=o.x-s.x,h=o.y-s.y,u=l.x-a.x,d=l.y-a.y,p=Math.sqrt((u*u+d*d)/(c*c+h*h));return Math.log(p)/Math.LN2}function nb(t,e,i){const n=Math.cos(i),r=Math.sin(i);return{x:t*n-e*r,y:t*r+e*n}}function rb(t,e,i){return e*(un/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}const sb={unknown:0,flipRequired:1,flipNotRequired:2},ob=Math.tan(85*Math.PI/180);function ab(t,e,i,n,r,s,o){const a=Au.create();if(i)if("globe"===s.name){const t=function(t,e){const{x:i,y:n}=t.point,r=Id(i,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return Au.multiply(r,r,Cd(md(e)))}(r,e);Au.multiply(a,a,t)}else{const t=wu.invert([],o);a[0]=t[0],a[1]=t[1],a[4]=t[2],a[5]=t[3],n||Au.rotateZ(a,a,r.angle)}else Au.multiply(a,r.labelPlaneMatrix,t);return a}function lb(t,e,i,n,r,s,o){const a=ab(t,e,i,n,r,s,o);return"globe"===s.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a}function cb(t,e,i,n,r,s,o){if(i){if("globe"===s.name){const a=ab(t,e,i,n,r,s,o);return Au.invert(a,a),Au.multiply(a,t,a),a}{const e=Au.clone(t),i=Au.identity([]);return i[0]=o[0],i[1]=o[1],i[4]=o[2],i[5]=o[3],Au.multiply(e,e,i),n||Au.rotateZ(e,e,-r.angle),e}}return r.glCoordMatrix}function hb(t,e,i,n){const r=[t,e,i,1];i?vu.transformMat4(r,r,n):xb(r,r,n);const s=r[3];return r[0]/=s,r[1]/=s,r[2]/=s,r}function ub(t,e){return Math.min(.5+t/e*.5,1.5)}function db(t,e){const i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}function pb(t,e,i,n,r,s,o,a,l,c){const h=i.transform,u=n?t.textSizeData:t.iconSizeData,d=gg(u,i.transform.zoom),p="globe"===h.projection.name,f=[256/i.width*2+1,256/i.height*2+1],m=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;m.clear();let g=null;p&&(g=n?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const _=t.lineVertexArray,y=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,b=i.transform.width/i.transform.height;let x,w=!1;for(let n=0;n<y.length;n++){const p=y.get(n),{numGlyphs:E,writingMode:S}=p;if(S!==Ag.vertical||w||x===Ag.horizontal||(w=!0),x=S,(p.hidden||S===Ag.vertical)&&!w){bb(E,m);continue}w=!1;const T=new v(p.tileAnchorX,p.tileAnchorY);let{x:M,y:A,z:C}=h.projection.projectTilePoint(T.x,T.y,c.canonical);if(l){const[t,e,i]=l(T);M+=t,A+=e,C+=i}const k=[M,A,C,1];if(vu.transformMat4(k,k,e),!db(k,f)){bb(E,m);continue}const P=k[3],I=ub(i.transform.getCameraToCenterDistance(h.projection),P),D=mg(u,d,p),O=o?D/I:D*I,L=hb(M,A,C,r);if(L[3]<=0){bb(E,m);continue}let z={};const R=o?null:l,F=gb(p,O,!1,a,e,r,s,t.glyphOffsetArray,_,m,g,L,T,z,b,R,h.projection,c,o);w=F.useVertical,R&&F.needsFlipping&&(z={}),(F.notEnoughRoom||w||F.needsFlipping&&gb(p,O,!0,a,e,r,s,t.glyphOffsetArray,_,m,g,L,T,z,b,R,h.projection,c,o).notEnoughRoom)&&bb(E,m)}n?(t.text.dynamicLayoutVertexBuffer.updateData(m),g&&t.text.globeExtVertexBuffer&&t.text.globeExtVertexBuffer.updateData(g)):(t.icon.dynamicLayoutVertexBuffer.updateData(m),g&&t.icon.globeExtVertexBuffer&&t.icon.globeExtVertexBuffer.updateData(g))}function fb(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m){const{lineStartIndex:g,glyphStartIndex:_,segment:y}=a,v=_+a.numGlyphs,b=g+a.lineLength,x=e.getoffsetX(_),w=e.getoffsetX(v-1),E=vb(t*x,i,n,r,s,o,y,g,b,l,c,h,u,d,!0,p,f,m);if(!E)return null;const S=vb(t*w,i,n,r,s,o,y,g,b,l,c,h,u,d,!0,p,f,m);return S?{first:E,last:S}:null}function mb(t,e,i,n){return t===Ag.horizontal&&Math.abs(n)>Math.abs(i)?{useVertical:!0}:t===Ag.vertical?n>0?{needsFlipping:!0}:null:e!==sb.unknown&&function(t,e){return 0===t||Math.abs(e/t)>ob}(i,n)?e===sb.flipRequired?{needsFlipping:!0}:null:i<0?{needsFlipping:!0}:null}function gb(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y){const b=e/24,x=t.lineOffsetX*b,w=t.lineOffsetY*b,{lineStartIndex:E,glyphStartIndex:S,numGlyphs:T,segment:M,writingMode:A,flipState:C}=t,k=E+t.lineLength,P=t=>{if(h){const[e,i,n]=t.up,r=c.length;dy(h,r+0,e,i,n),dy(h,r+1,e,i,n),dy(h,r+2,e,i,n),dy(h,r+3,e,i,n)}const[e,i,n]=t.point;py(c,e,i,n,t.angle)};if(T>1){const e=fb(b,a,x,w,i,u,d,t,l,s,p,m,!1,g,_,y);if(!e)return{notEnoughRoom:!0};if(n&&!i){let[i,n,r]=e.first.point,[s,a,l]=e.last.point;[i,n]=hb(i,n,r,o),[s,a]=hb(s,a,l,o);const c=mb(A,C,(s-i)*f,a-n);if(t.flipState=c&&c.needsFlipping?sb.flipRequired:sb.flipNotRequired,c)return c}P(e.first);for(let t=S+1;t<S+T-1;t++){const e=vb(b*a.getoffsetX(t),x,w,i,u,d,M,E,k,l,s,p,m,!1,!1,g,_,y);if(!e)return c.length-=4*(t-S),{notEnoughRoom:!0};P(e)}P(e.last)}else{if(n&&!i){const e=hb(d.x,d.y,0,r),i=E+M+1,n=new v(l.getx(i),l.gety(i)),s=hb(n.x,n.y,0,r),o=s[3]>0?s:yb(d,n,e,1,r,void 0,g,_.canonical),a=mb(A,C,(o[0]-e[0])*f,o[1]-e[1]);if(t.flipState=a&&a.needsFlipping?sb.flipRequired:sb.flipNotRequired,a)return a}const e=vb(b*a.getoffsetX(S),x,w,i,u,d,M,E,k,l,s,p,m,!1,!1,g,_,y);if(!e)return{notEnoughRoom:!0};P(e)}return{}}function _b(t,e,i,n,r){const{x:s,y:o,z:a}=n.projectTilePoint(t.x,t.y,e);if(!r)return hb(s,o,a,i);const[l,c,h]=r(t);return hb(s+l,o+c,a+h,i)}function yb(t,e,i,n,r,s,o,a){const l=_b(t.sub(e)._unit()._add(t),a,r,o,s);return Ou.sub(l,i,l),Ou.normalize(l,l),Ou.scaleAndAdd(l,i,l,n)}function vb(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_){const y=n?t-e:t+e;let b=y>0?1:-1,x=0;n&&(b*=-1,x=Math.PI),b<0&&(x+=Math.PI);let w=a+o+(b>0?0:1)|0,E=r,S=r,T=0,M=0;const A=Math.abs(y),C=[],k=[];let P=s,I=P;const D=()=>yb(I,P,S,A-T+1,h,d,m,g.canonical);for(;T+M<=A;){if(w+=b,w<a||w>=l)return null;if(S=E,I=P,C.push(S),p&&k.push(I),P=new v(c.getx(w),c.gety(w)),E=u[w],!E){const t=_b(P,g.canonical,h,m,d);E=t[3]>0?u[w]=t:D()}T+=M,M=Ou.distance(S,E)}f&&d&&(u[w]&&(E=D(),M=Ou.distance(S,E)),u[w]=E);const O=(A-T)/M,L=P.sub(I)._mult(O)._add(I),z=Ou.sub([],E,S),R=Ou.scaleAndAdd([],S,z,O);let F=[0,0,1],B=z[0],N=z[1];if(_&&(F=m.upVector(g.canonical,L.x,L.y),0!==F[0]||0!==F[1]||1!==F[2])){const t=[F[2],0,-F[0]],e=Ou.cross([],F,t);Ou.normalize(t,t),Ou.normalize(e,e),B=Ou.dot(z,t),N=Ou.dot(z,e)}if(i){const t=Ou.cross([],F,z);Ou.normalize(t,t),Ou.scaleAndAdd(R,R,t,i*b)}const j=x+Math.atan2(N,B);return C.push(R),p&&k.push(L),{point:R,angle:j,path:C,tilePath:k,up:F}}function bb(t,e){const i=e.length,n=i+4*t;e.resize(n),e.float32.fill(-1/0,4*i,4*n)}function xb(t,e,i){const n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t[3]=i[3]*n+i[7]*r+i[15],t}const wb=(t,e,i)=>(1-i)*t+i*e,Eb=t=>t*t*t*t*t;class Sb{constructor(t,e,i,n,r,s,o){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this._minPitch=null==i?0:i,this._maxPitch=null==n?60:n,this.setProjection(s),this.setMaxBounds(o),this.width=0,this.height=0,this._center=new Zd(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Wv,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new Kv,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1}clone(){const t=new Sb(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return t._elevation=this._elevation,t._centerAltitude=this._centerAltitude,t._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,t.tileSize=this.tileSize,t.mercatorFromTransition=this.mercatorFromTransition,t.width=this.width,t.height=this.height,t.cameraElevationReference=this.cameraElevationReference,t._center=this._center,t._setZoom(this.zoom),t._seaLevelZoom=this._seaLevelZoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._nearZ=this._nearZ,t._farZ=this._farZ,t._averageElevation=this._averageElevation,t._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._camera=this._camera.clone(),t._calcMatrices(),t.freezeTileCoverage=this.freezeTileCoverage,t.frustumCorners=this.frustumCorners,t}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(t){this._elevation!==t&&(this._elevation=t,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(t,e=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(t||i)&&this._constrainCamera(e),this._calcMatrices()}getProjection(){return F(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const e=this.projection?this.getProjection():void 0;this.projection=iy(this.projectionOptions);const i=!b(e,this.getProjection());return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}setOrthographicProjectionAtLowPitch(t){return this._orthographicProjectionAtLowPitch!==t&&(this._orthographicProjectionAtLowPitch=t,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=iy({name:"mercator"});const e=t!==this.projection.name;return e&&this._calcMatrices(),e}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get cameraWorldSize(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return tp(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new v(this.width,this.height)}get bearing(){return O(this.rotation,-180,180)}set bearing(t){this.rotation=t}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const e=-t*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=wu.create(),wu.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const e=I(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const t=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/t)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=E(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(t){this._averageElevation=t,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._setZoom(e),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(t){this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}_updateCameraOnTerrain(){const t=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,e=this.elevation&&t===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||t===Number.NEGATIVE_INFINITY&&(!e||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;e||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration(),this._centerAltitudeValidForExaggeration=i.exaggeration()):(this._centerAltitude=t||0,this._centerAltitudeValidForExaggeration=i.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,e=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],i=this.horizonLineFromTop();let n=0,r=0;for(let s=0;s<e.length;s++){const o=new v(e[s][0]*this.width,i+e[s][1]*(this.height-i)),a=t.pointCoordinate(o);if(!a)continue;const l=1/Math.hypot(a[0]-this._camera.position[0],a[1]-this._camera.position[1]);n+=a[3]*l,r+=l}return 0===r?NaN:n/r}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const t=this._seaLevelZoom,e=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),i=this.pixelsPerMeter/this.worldSize*e,n=this._mercatorZfromZoom(t),r=this._mercatorZfromZoom(this._maxZoom),s=Math.max(n-i,r);this._setZoom(this._zoomFromMercatorZ(s))}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}computeZoomRelativeTo(t){const e=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let i;i=t.z<this._camera.position[2]?[e.x,e.y,e.z]:[t.x,t.y,t.z];const n=Ou.length(Ou.sub([],this._camera.position,i));return I(this._zoomFromMercatorZ(n),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let e=!1;if(t.orientation&&!ku.exactEquals(t.orientation,this._camera.orientation)&&(e=this._setCameraOrientation(t.orientation)),t.position){const i=[t.position.x,t.position.y,t.position.z];Ou.exactEquals(i,this._camera.position)||(this._setCameraPosition(i),e=!0)}e&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,e=new Xv;return e.position=new cp(t[0],t[1],t[2]),e.orientation=this._camera.orientation,e._elevation=this.elevation,e._renderWorldCopies=this.renderWorldCopies,e}_setCameraOrientation(t){if(!ku.length(t))return!1;ku.normalize(t,t);const e=Ou.transformQuat([],[0,0,-1],t),i=Ou.transformQuat([],[0,-1,0],t);if(i[2]<0)return!1;const n=Yv(e,i);return!!n&&(this._camera.orientation=n,!0)}_setCameraPosition(t){const e=this.zoomScale(this.minZoom)*this.tileSize,i=this.zoomScale(this.maxZoom)*this.tileSize,n=this.cameraToCenterDistance;t[2]=I(t[2],n/i,n/e),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){const e=[new Hu(0,t)];if(this.renderWorldCopies){const i=this.pointCoordinate(new v(0,0)),n=this.pointCoordinate(new v(this.width,0)),r=this.pointCoordinate(new v(this.width,this.height)),s=this.pointCoordinate(new v(0,this.height)),o=Math.floor(Math.min(i.x,n.x,r.x,s.x)),a=Math.floor(Math.max(i.x,n.x,r.x,s.x)),l=1;for(let i=o-l;i<=a+l;i++)0!==i&&e.push(new Hu(i,t))}return e}isLODDisabled(t){return(!t||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCoverForShadows(t,e,i){let n=[];if(0===e[0]&&0===e[1])return n;for(const i of t){const t=i.canonical,r=i.overscaledZ,s=i.wrap,o=1<<t.z,a=t.x+1<o,l=t.x>0,c=t.y+1<o,h=t.y>0,u=i.wrap-(l?0:1),d=i.wrap+(a?0:1),p=l?t.x-1:o-1,f=a?t.x+1:0;e[0]<0?(n.push(new qu(r,d,t.z,f,t.y)),e[1]<0&&c&&(n.push(new qu(r,s,t.z,t.x,t.y+1)),n.push(new qu(r,d,t.z,f,t.y+1))),e[1]>0&&h&&(n.push(new qu(r,s,t.z,t.x,t.y-1)),n.push(new qu(r,d,t.z,f,t.y-1)))):e[0]>0?(n.push(new qu(r,u,t.z,p,t.y)),e[1]<0&&c&&(n.push(new qu(r,s,t.z,t.x,t.y+1)),n.push(new qu(r,u,t.z,p,t.y+1))),e[1]>0&&h&&(n.push(new qu(r,s,t.z,t.x,t.y-1)),n.push(new qu(r,u,t.z,p,t.y-1)))):e[1]<0&&c?n.push(new qu(r,s,t.z,t.x,t.y+1)):h&&n.push(new qu(r,s,t.z,t.x,t.y-1))}if(n.length>1){n.sort(((t,e)=>t.overscaledZ-e.overscaledZ||t.wrap-e.wrap||t.canonical.z-e.canonical.z||t.canonical.x-e.canonical.x||t.canonical.y-e.canonical.y));let t=0,e=0;for(;e<n.length;)n[e].equals(n[t])?++e:n[++t]=n[e++];n.length=t+1}const r=[];for(const t of n)n.some((e=>t.isChildOf(e)))||r.push(t);return n=r.filter((e=>!t.some((t=>!!(e.overscaledZ<i&&t.isChildOf(e))||e.equals(t)||e.isChildOf(t))))),n}coveringTiles(t){let e=this.coveringZoomLevel(t);const i=e,n=this.elevation&&this.elevation.exaggeration(),r=n&&!t.isTerrainDEM,s="mercator"===this.projection.name;if(void 0!==t.minzoom&&e<t.minzoom)return[];void 0!==t.maxzoom&&e>t.maxzoom&&(e=t.maxzoom);const o=this.locationCoordinate(this.center),a=this.center.lat,l=1<<e,c=[l*o.x,l*o.y,0],h="globe"===this.projection.name,u=!h,d=td.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e,u),p=h?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),f=l*tp(1,this.center.lat),m=this._camera.position[2]/tp(1,this.center.lat),g=[l*p.x,l*p.y,m*(u?1:f)],_=h||n,y=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),v=this.isLODDisabled(!0)?e:0;let b;if(this._elevation&&t.isTerrainDEM)b=1e4*this._elevation.exaggeration();else if(this._elevation){const t=this._elevation.getMinMaxForVisibleTiles();b=t?t.max:this._centerAltitude}else b=this._centerAltitude;const x=t.isTerrainDEM?-b:this._elevation?this._elevation.getMinElevationBelowMSL():0,w=this.projection.isReprojectedInTileSpace?Jv(this):1,E=t=>{const e=1/4e4,i=new cp(t.x+e,t.y,t.z),n=new cp(t.x,t.y+e,t.z),r=t.toLngLat(),s=i.toLngLat(),o=n.toLngLat(),a=this.locationCoordinate(r),l=this.locationCoordinate(s),c=this.locationCoordinate(o),h=Math.hypot(l.x-a.x,l.y-a.y),u=Math.hypot(c.x-a.x,c.y-a.y);return Math.sqrt(h*u)*w/e},S=t=>{const e=b,i=x;return{aabb:O_(this,l,0,0,0,t,i,e,this.projection),zoom:0,x:0,y:0,minZ:i,maxZ:e,wrap:t,fullyVisible:!1}},M=[];let A=[];const C=e,k=t.reparseOverscaled?i:e,P=t=>t*t,I=P((m-this._centerAltitude)*f),D=t=>{if(!this._elevation||!t.tileID||!s)return;const e=this._elevation.getMinMaxForTile(t.tileID),i=t.aabb;e?(i.min[2]=e.min,i.max[2]=e.max,i.center[2]=(i.min[2]+i.max[2])/2):(t.shouldSplit=O(t),t.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},O=t=>{if(t.zoom<v)return!0;if(t.zoom===C)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const e=t.aabb.distanceX(g),n=t.aabb.distanceY(g);let s=I,o=1;if(h){s=P(t.aabb.distanceZ(g));const e=Math.pow(2,t.zoom),i=ip((t.y+1)/e),n=ip(t.y/e),r=Math.min(Math.max(a,i),n),l=Kd(r)/Kd(a);if(o=r===a?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,l/this._mercatorScaleRatio),this.zoom<=id&&t.zoom===C-1&&l>=.9)return!0}else if(r&&(s=P(t.aabb.distanceZ(g)*f)),this.projection.isReprojectedInTileSpace&&i<=5){const e=Math.pow(2,t.zoom),i=E(new cp((t.x+.5)/e,(t.y+.5)/e));o=i>.85?1:i}const l=e*e+n*n+s,c=P((1<<C-t.zoom)*y*o*((t,e)=>{if(e*P(.707)<t)return 1;const i=Math.sqrt(e/t);return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(s,I),l));return l<c};if(this.renderWorldCopies)for(let t=1;t<=3;t++)M.push(S(-t)),M.push(S(t));for(M.push(S(0));M.length>0;){const i=M.pop(),n=i.x,o=i.y;let a=i.fullyVisible;const u=()=>"globe"===this.projection.name&&(0===i.y||i.y===(1<<i.zoom)-1);if(!a){let t=_?i.aabb.intersects(d):i.aabb.intersectsFlat(d);if(0===t&&u()){const e=new $u(i.zoom,n,o);t=vd(this,l,e,!0).intersects(d)}if(0===t)continue;a=2===t}if(i.zoom!==C&&O(i))for(let t=0;t<4;t++){const e=(n<<1)+t%2,c=(o<<1)+(t>>1),u={aabb:s?i.aabb.quadrant(t):O_(this,l,i.zoom+1,e,c,i.wrap,i.minZ,i.maxZ,this.projection),zoom:i.zoom+1,x:e,y:c,wrap:i.wrap,fullyVisible:a,tileID:void 0,shouldSplit:void 0,minZ:i.minZ,maxZ:i.maxZ};r&&!h&&(u.tileID=new qu(i.zoom+1===C?k:i.zoom+1,i.wrap,i.zoom+1,e,c),D(u)),M.push(u)}else{const r=i.zoom===C?k:i.zoom;if(t.minzoom&&t.minzoom>r)continue;if(!a){let t=_?i.aabb.intersectsPrecise(d):i.aabb.intersectsPreciseFlat(d);if(0===t&&u()){const e=new $u(i.zoom,n,o);t=vd(this,l,e,!0).intersectsPrecise(d)}if(0===t)continue}const s=c[0]-(.5+n+(i.wrap<<i.zoom))*(1<<e-i.zoom),h=c[1]-.5-o,p=i.tileID?i.tileID:new qu(r,i.wrap,i.zoom,n,o);A.push({tileID:p,distanceSq:s*s+h*h})}}if(this.fogCullDistSq){const e=this.fogCullDistSq,i=this.horizonLineFromTop();A=A.filter((n=>{const r=[0,0,0,1],s=[un,un,0,1],o=this.calculateFogTileMatrix(n.tileID.toUnwrapped());vu.transformMat4(r,r,o),vu.transformMat4(s,s,o);const a=function(t,e,i){let n=0;for(let i=0;i<2;++i){const r=0;t[i]>r&&(n+=(t[i]-r)*(t[i]-r)),e[i]<r&&(n+=(r-e[i])*(r-e[i]))}return n}(vu.min([],r,s),vu.max([],r,s));if(0===a)return!0;let l=!1;const c=this._elevation;if(c&&a>e&&0!==i){const e=this.calculateProjMatrix(n.tileID.toUnwrapped());let r;t.isTerrainDEM||(r=c.getMinMaxForTile(n.tileID)),r||(r={min:x,max:b});const s=function(t){const e=Math.round((t+45+360)%360/90)%4;return T[e]}(this.rotation),o=[s[0]*un,s[1]*un,r.max];Ou.transformMat4(o,o,e),l=(1-o[1])*this.height*.5<i}return a<e||l}))}return A.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const e=I(t.lat,-rp,rp),i=this.projection.project(t.lng,e);return new v(i.x*this.worldSize,i.y*this.worldSize)}unproject(t){return this.projection.unproject(t.x/this.worldSize,t.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/tp(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,e){let i,n;const r=this.centerPoint;if("globe"===this.projection.name){const t=this.worldSize;i=(e.x-r.x)/t,n=(e.y-r.y)/t}else{const t=this.pointCoordinate(e),s=this.pointCoordinate(r);i=t.x-s.x,n=t.y-s.y}const s=this.locationCoordinate(t);this.setLocation(new cp(s.x-i,s.y-n))}setLocation(t){this.center=this.coordinateLocation(t),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(t){return this.projection.locationPoint(this,t)}locationPoint3D(t){return this.projection.locationPoint(this,t,!0)}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}pointLocation3D(t){return this.coordinateLocation(this.pointCoordinate3D(t))}locationCoordinate(t,e){const i=e?tp(e,t.lat):void 0,n=this.projection.project(t.lng,t.lat);return new cp(n.x,n.y,i)}coordinateLocation(t){return this.projection.unproject(t.x,t.y)}pointRayIntersection(t,e){const i=null!=e?e:this._centerAltitude,n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];vu.transformMat4(n,n,this.pixelMatrixInverse),vu.transformMat4(r,r,this.pixelMatrixInverse);const s=r[3];vu.scale(n,n,1/n[3]),vu.scale(r,r,1/s);const o=n[2],a=r[2];return{p0:n,p1:r,t:o===a?0:(i-o)/(a-o)}}screenPointToMercatorRay(t){const e=[t.x,t.y,0,1],i=[t.x,t.y,1,1];return vu.transformMat4(e,e,this.pixelMatrixInverse),vu.transformMat4(i,i,this.pixelMatrixInverse),vu.scale(e,e,1/e[3]),vu.scale(i,i,1/i[3]),e[2]=tp(e[2],this._center.lat)*this.worldSize,i[2]=tp(i[2],this._center.lat)*this.worldSize,vu.scale(e,e,1/this.worldSize),vu.scale(i,i,1/this.worldSize),new Zu([e[0],e[1],e[2]],Ou.normalize([],Ou.sub([],i,e)))}rayIntersectionCoordinate(t){const{p0:e,p1:i,t:n}=t,r=tp(e[2],this._center.lat),s=tp(i[2],this._center.lat);return new cp(Jn(e[0],i[0],n)/this.worldSize,Jn(e[1],i[1],n)/this.worldSize,Jn(r,s,n))}pointCoordinate(t,e=this._centerAltitude){return this.projection.pointCoordinate(this,t.x,t.y,e)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let e=this.projection.pointCoordinate3D(this,t.x,t.y);if(e)return new cp(e[0],e[1],e[2]);let i=0,n=this.horizonLineFromTop();if(t.y>n)return this.pointCoordinate(t);const r=.02*n,s=t.clone();for(let t=0;t<10&&n-i>r;t++){s.y=Jn(i,n,.66);const t=this.projection.pointCoordinate3D(this,s.x,s.y);t?(n=s.y,e=t):i=s.y}return e?new cp(e[0],e[1],e[2]):this.pointCoordinate(t)}isPointAboveHorizon(t){return this.projection.isPointAboveHorizon(this,t)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=nd)return!this.isPointAboveHorizon(t);const e=this.pointCoordinate(t);return e.y>=0&&e.y<=1}_coordinatePoint(t,e){const i=e&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,n=[t.x*this.worldSize,t.y*this.worldSize,i+t.toAltitude(),1];return vu.transformMat4(n,n,this.pixelMatrix),n[3]>0?new v(n[0]/n[3],n[1]/n[3]):new v(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:e}=this._edgeInsets,i=this.height-this._edgeInsets.bottom,n=this.width-this._edgeInsets.right,r=this.pointLocation3D(new v(e,t)),s=this.pointLocation3D(new v(n,t)),o=this.pointLocation3D(new v(n,i)),a=this.pointLocation3D(new v(e,i));let l=Math.min(r.lng,s.lng,o.lng,a.lng),c=Math.max(r.lng,s.lng,o.lng,a.lng),h=Math.min(r.lat,s.lat,o.lat,a.lat),u=Math.max(r.lat,s.lat,o.lat,a.lat);const d=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,f=(t,e,i,n,r)=>{const s=(t+i)/2,o=(e+n)/2,a=new v(s,o),{lng:m,lat:g}=this.pointLocation3D(a),_=Math.max(0,l-m,h-g,m-c,g-u);l=Math.min(l,m),c=Math.max(c,m),h=Math.min(h,g),u=Math.max(u,g),(r<p||_>d)&&(f(t,e,s,o,r+1),f(s,o,i,n,r+1))};if(f(e,t,n,t,1),f(n,t,n,i,1),f(n,i,e,i,1),f(e,i,e,t,1),"globe"===this.projection.name){const[t,e]=function(t){const e=Au.identity(new Float64Array(16));Au.multiply(e,t.pixelMatrix,t.globeMatrix);const i=[0,ld,0],n=[0,cd,0];return Ou.transformMat4(i,i,e),Ou.transformMat4(n,n,e),[i[0]>0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!jd(t,new Zd(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!jd(t,new Zd(t.center.lat,-90))]}(this);t?(u=90,c=180,l=-180):e&&(h=-90,c=180,l=-180)}return new ac(new Zd(l,h),new Zd(c,u))}_getBoundsRectangular(t,e){const{top:i,left:n}=this._edgeInsets,r=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,o=new v(n,i),a=new v(s,i),l=new v(s,r),c=new v(n,r);let h=this.pointCoordinate(o,t),u=this.pointCoordinate(a,t);const d=this.pointCoordinate(l,e),p=this.pointCoordinate(c,e),f=(t,e)=>(e.y-t.y)/(e.x-t.x);return h.y>1&&u.y>=0?h=new cp((1-p.y)/f(p,h)+p.x,1):h.y<0&&u.y<=1&&(h=new cp(-p.y/f(p,h)+p.x,0)),u.y>1&&h.y>=0?u=new cp((1-d.y)/f(d,u)+d.x,1):u.y<0&&h.y<=1&&(u=new cp(-d.y/f(d,u)+d.x,0)),(new ac).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(d))}_getBoundsRectangularTerrain(){const t=this.elevation;if(!t.visibleDemTiles.length||t.isUsingMockSource())return this._getBoundsRectangular(0,0);const e=t.visibleDemTiles.reduce(((t,e)=>{if(e.dem){const i=e.dem.tree;t.min=Math.min(t.min,i.minimums[0]),t.max=Math.max(t.max,i.maximums[0])}return t}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(e.min*t.exaggeration(),e.max*t.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(t=!0){const e=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,i=this.height/2-e*(1-this._horizonShift);return t?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-rp,this.maxLat=rp,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=Qd(this.minLng)*this.tileSize,this.worldMaxX=Qd(this.maxLng)*this.tileSize,this.worldMinY=Jd(this.maxLat)*this.tileSize,this.worldMaxY=Jd(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(t,e){return this.projection.createTileMatrix(this,e,t)}calculateDistanceTileData(t){const e=t.key,i=this._distanceTileDataCache;if(i[e])return i[e];const n=t.canonical,r=1/this.height,s=this.cameraWorldSize,o=s/this.zoomScale(n.z),a=(n.x+Math.pow(2,n.z)*t.wrap)*o,l=n.y*o,c=this.point;c.x*=s/this.worldSize,c.y*=s/this.worldSize;const h=this.angle,u=Math.sin(-h),d=-Math.cos(-h);return i[e]={bearing:[u,d],center:[(c.x-a)*r,(c.y-l)*r],scale:o/un*r},i[e]}calculateFogTileMatrix(t){const e=t.key,i=this._fogTileMatrixCache;if(i[e])return i[e];const n=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return Au.multiply(n,this.worldToFogMatrix,n),i[e]=new Float32Array(n),i[e]}calculateProjMatrix(t,e=!1,i=!1){const n=t.key;let r;if(r=i?this._expandedProjMatrixCache:e?this._alignedProjMatrixCache:this._projMatrixCache,r[n])return r[n];const s=this.calculatePosMatrix(t,this.worldSize);let o;return o=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:i?this.expandedFarZProjMatrix:e?this.alignedProjMatrix:this.projMatrix,Au.multiply(s,o,s),r[n]=new Float32Array(s),r[n]}calculatePixelsToTileUnitsMatrix(t){const e=t.tileID.key,i=this._pixelsToTileUnitsCache;if(i[e])return i[e];const n=function(t,e){const{scale:i}=t.tileTransform,n=i*un/(t.tileSize*Math.pow(2,e.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return wu.scale(new Float32Array(4),e.inverseAdjustmentMatrix,[n,n])}(t,this);return i[e]=n,i[e]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,e=Au.fromScaling([],[t,t,t]);return Au.multiply(e,e,this.globeMatrix),e}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const e=tp(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(e),n=this._camera.forward(),r=tp(1,this._center.lat);i[2]/=r,n[2]/=r,Ou.normalize(n,n);const s=t.raycast(i,n,t.exaggeration());if(s){const t=Ou.scaleAndAdd([],i,n,s),e=new cp(t[0],t[1],tp(t[2],ip(t[1]))),o=(e.z+Ou.length([e.x-i[0],e.y-i[1],e.z-i[2]*r]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(o),this._centerAltitude=e.toAltitude(),this._center=this.coordinateLocation(e),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const e=this._elevation,i=tp(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(i),r=e.getAtPointOrZero(new cp(...n)),s=this.pixelsPerMeter/this.worldSize*r,o=this._minimumHeightOverTerrain(),a=n[2]-s;if(a<=o)if(a<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),e=[n[0],n[1],t.z-n[2]],i=Ou.length(e);e[2]-=(o-a)/this._pixelsPerMercatorPixel;const r=Ou.length(e);if(0===r)return;Ou.scale(e,e,i/r*this._pixelsPerMercatorPixel),this._camera.position=[n[0],n[1],t.z*this._pixelsPerMercatorPixel-e[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const e=this.center;return e.lat=I(e.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(e.lng=I(e.lng,this.minLng,this.maxLng)),this.center=e,void(this._constraining=!1)}const e=this._unmodified,{x:i,y:n}=this.point;let r=0,s=i,o=n;const a=this.width/2,l=this.height/2,c=this.worldMinY*this.scale,h=this.worldMaxY*this.scale;if(n-l<c&&(o=c+l),n+l>h&&(o=h-l),h-c<this.height&&(r=Math.max(r,this.height/(h-c)),o=(h+c)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const t=this.worldMinX*this.scale,e=this.worldMaxX*this.scale,n=this.worldSize/2-(t+e)/2;s=(i+n+this.worldSize)%this.worldSize-n,s-a<t&&(s=t+a),s+a>e&&(s=e-a),e-t<this.width&&(r=Math.max(r,this.width/(e-t)),s=(e+t)/2)}s===i&&o===n||(this.center=this.unproject(new v(s,o))),r&&(this.zoom+=this.scaleZoom(r)),this._constrainCamera(),this._unmodified=e,this._constraining=!1}_minZoomForBounds(){let t=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(t=Math.max(t,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),t}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,e="globe"===this.projection.name,i=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=tp(1,this.center.lat)/tp(1,45));const n=tb(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,n),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const r="meters"===this.projection.zAxisUnit?i:1,s=this._camera.getWorldToCamera(this.worldSize,r);let o;const a=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(a[8]=2*-t.x/this.width,a[9]=2*t.y/this.height,this.isOrthographic){let e=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),i=e*this.aspect,n=-i,r=-e;i-=t.x,n-=t.x,e+=t.y,r+=t.y,o=this._camera.getCameraToClipOrthographic(n,i,r,e,this._nearZ,this._farZ),((t,e,i,n)=>{for(let r=0;r<16;r++)t[r]=wb(e[r],i[r],n)})(o,o,a,Eb(this.pitch>=15?1:this.pitch/15))}else o=a;const l=Au.mul([],a,s);let c=Au.mul([],o,s);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),e=Au.identity([]);Au.translate(e,e,[t.x*this.worldSize,t.y*this.worldSize,0]),Au.multiply(e,e,Qv(this)),Au.translate(e,e,[-t.x*this.worldSize,-t.y*this.worldSize,0]),Au.multiply(c,c,e),Au.multiply(l,l,e),this.inverseAdjustmentMatrix=function(t){const e=Qv(t,!0);return wu.invert([],[e[0],e[1],e[4],e[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=Au.scale([],c,[this.worldSize,this.worldSize,this.worldSize/r,1]),this.projMatrix=c,this.invProjMatrix=Au.invert(new Float64Array(16),this.projMatrix),e){const e=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);e[8]=2*-t.x/this.width,e[9]=2*t.y/this.height,this.expandedFarZProjMatrix=Au.mul([],e,s)}else this.expandedFarZProjMatrix=this.projMatrix;const h=Au.invert([],o);this.frustumCorners=Yu.fromInvProjectionMatrix(h,this.horizonLineFromTop(),this.height),this.cameraFrustum=td.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!e);const u=new Float32Array(16);Au.identity(u),Au.scale(u,u,[1,-1,1]),Au.rotateX(u,u,this._pitch),Au.rotateZ(u,u,this.angle);const d=Au.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=Au.clone(d);const p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;d[8]=2*-t.x/this.width,d[9]=2*(t.y+p)/this.height,this.skyboxMatrix=Au.multiply(u,d,u);const f=this.point,m=f.x,g=f.y,_=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),b=Math.sin(this.angle),x=m-Math.round(m)+v*_+b*y,w=g-Math.round(g)+v*y+b*_,E=new Float64Array(c);if(Au.translate(E,E,[x>.5?x-1:x,w>.5?w-1:w,0]),this.alignedProjMatrix=E,c=Au.create(),Au.scale(c,c,[this.width/2,-this.height/2,1]),Au.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=Au.create(),Au.scale(c,c,[1,-1,1]),Au.translate(c,c,[-1,-1,0]),Au.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=Au.multiply(new Float64Array(16),this.labelPlaneMatrix,l),this._calcFogMatrices(),this._distanceTileDataCache={},c=Au.invert(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=c,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=function(t){const{x:e,y:i}=t.point,{lng:n,lat:r}=t._center;return Id(e,i,t.worldSize,n,r)}(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=Ou.transformMat4(t,t,s),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=c;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,e=this.cameraPixelsPerMeter,i=this._camera.position,n=1/this.height/this._pixelsPerMercatorPixel,r=[t,t,e];Ou.scale(r,r,n),Ou.scale(i,i,-1),Ou.multiply(i,i,r);const s=Au.create();Au.translate(s,s,i),Au.scale(s,s,r),this.mercatorFogMatrix=s,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,e,n)}_computeCameraPosition(t){const e=(t=t||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,r=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*e-t/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*r,n.y/this.worldSize-i[1]*r,t/this.worldSize*this._centerAltitude-i[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const e=this._maxCameraBoundsDistance()*Math.cos(this._pitch),i=this._camera.position[2],n=t[2];let r=1;this.projection.wrap&&(this.center=this.center.wrap()),n>0&&(r=Math.min((e-i)/n,1)),this._camera.position=Ou.scaleAndAdd([],this._camera.position,t,r),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,e=this._camera.forward(),{pitch:i,bearing:n}=this._camera.getPitchBearing(),r=tp(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(E(this._maxPitch)),o=Math.max((t[2]-r)/Math.cos(i),s),a=this._zoomFromMercatorZ(o);Ou.scaleAndAdd(t,t,e,o),this._pitch=I(i,E(this.minPitch),E(this.maxPitch)),this.angle=O(n,-Math.PI,Math.PI),this._setZoom(I(a,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new cp(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(t){return Math.pow(2,t)*this.tileSize}_mercatorZfromZoom(t){return this.cameraToCenterDistance/this._worldSizeFromZoom(t)}_minimumHeightOverTerrain(){const t=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(t)}_zoomFromMercatorZ(t){return this.scaleZoom(this.cameraToCenterDistance/(t*this.tileSize))}zoomFromMercatorZAdjusted(t){let e=0,i=nd,n=0,r=1/0;for(;i-e>1e-6&&i>e;){const s=e+.5*(i-e),o=this.tileSize*Math.pow(2,s),a=this.getCameraToCenterDistance(this.projection,s,o),l=this.scaleZoom(a/(t*this.tileSize)),c=Math.abs(s-l);c<r&&(r=c,n=s),s<l?e=s:i=s}return n}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(Y("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,e){const i=Math.min(t.x,e.x),n=Math.max(t.x,e.x),r=Math.min(t.y,e.y),s=Math.max(t.y,e.y);if(r<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const o=[new v(i,r),new v(n,s),new v(i,s),new v(n,r)],a=this.renderWorldCopies?-3:0,l=this.renderWorldCopies?4:1;for(const t of o){const e=this.pointRayIntersection(t);if(e.t<0)return!0;const i=this.rayIntersectionCoordinate(e);if(i.x<a||i.y<0||i.x>l||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+S(this.fovAboveCenter)>88||this.anyCornerOffEdge(new v(0,0),new v(this.width,this.height))}zoomDeltaToMovement(t,e){const i=Ou.length(Ou.sub([],this._camera.position,t)),n=this._zoomFromMercatorZ(i)+e;return i-this._mercatorZfromZoom(n)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,e,i],n){const r=[t,e,i,1];vu.transformMat4(r,r,n);const s=r[3]=Math.max(r[3],1e-6);return r[0]/=s,r[1]/=s,r[2]/=s,r}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new v(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new v(0,t))}}getCameraToCenterDistance(t,e=this.zoom,i=this.worldSize){const n=tb(t,e,this.width,this.height,1024),r=t.pixelSpaceConversion(this.center.lat,i,n);let s=.5/Math.tan(.5*this._fov)*this.height*r;return this.isOrthographic&&(s=wb(1,s,Eb(this.pitch>=15?1:this.pitch/15))),s}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&Au.multiply(t,t,this.globeMatrix),t}getFrustum(t){return td.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}function Tb(t,e,i){Au.identity(t),Au.rotateZ(t,t,E(e[2])),Au.rotateX(t,t,E(e[0])),Au.rotateY(t,t,E(e[1])),Au.scale(t,t,i),Au.multiply(t,t,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function Mb(t,e,i,n,r,s,o,a){const l=[i[0]-e[0],i[1]-e[1],0],c=[n[0]-e[0],n[1]-e[1],0];if(Ou.length(l)<1e-12||Ou.length(c)<1e-12)return ku.identity(t);const h=Ou.cross([],l,c);Ou.normalize(h,h),Ou.subtract(c,n,e),l[2]=(s-r)*a,c[2]=(o-r)*a;const u=l;return Ou.cross(u,l,c),Ou.normalize(u,u),ku.rotationTo(t,h,u)}function Ab(t,e,i=!1){const n=Od(e.zoom),r=function(t,e,i){const n=e.worldSize,r=[t[12],t[13],t[14]],s=ip(r[1]/n),o=ep(r[0]/n),a=Au.identity([]),l=tp(1,s)*n,c=tp(1,0)*n*op(s,e.zoom),h=1/kd(n);let u=c*h;if(i){const t=tb(e.projection,e.zoom,e.width,e.height,1024);u=h*e.projection.pixelSpaceConversion(e.center.lat,n,t)}const d=Ed(s,o);Ou.add(d,d,Ou.scale([],Ou.normalize([],d),l*u*r[2]));const p=function(t){const e=[t[0],t[1],t[2]];let i=[0,1,0];const n=Ou.cross([],i,e);return Ou.cross(i,e,n),0===Ou.squaredLength(i)&&(i=[0,1,0],Ou.cross(n,e,i)),Ou.normalize(n,n),Ou.normalize(i,i),Ou.normalize(e,e),[n[0],n[1],n[2],0,i[0],i[1],i[2],0,e[0],e[1],e[2],0,t[0],t[1],t[2],1]}(d);Au.scale(a,a,[u,u,u*l]),Au.translate(a,a,[-r[0],-r[1],-r[2]]);const f=Au.multiply([],e.globeMatrix,p);return Au.multiply(f,f,a),Au.multiply(f,f,t),f}(t,e,i);if(n>0){const i=function(t,e){const i=e.worldSize,n=tp(1,0)*i*op(e.center.lat,e.zoom)/kd(i),r=tp(1,e.center.lat)*i,s=Au.identity([]);return Au.rotateY(s,s,E(e.center.lng)),Au.rotateX(s,s,E(e.center.lat)),Au.translate(s,s,[0,0,rd]),Au.scale(s,s,[n,n,n*r]),Au.translate(s,s,[e.point.x-.5*i,e.point.y-.5*i,0]),Au.multiply(s,s,t),Au.multiply(s,e.globeMatrix,s)}(t,e);return function(t,e,i){const n=(t,e,i)=>{const n=Ou.length(t),r=Ou.length(e),s=gd(t,e,i);return Ou.scale(s,s,1/Ou.length(s)*Jn(n,r,i))},r=n([t[0],t[1],t[2]],[e[0],e[1],e[2]],i),s=n([t[4],t[5],t[6]],[e[4],e[5],e[6]],i),o=n([t[8],t[9],t[10]],[e[8],e[9],e[10]],i),a=gd([t[12],t[13],t[14]],[e[12],e[13],e[14]],i);return[r[0],r[1],r[2],0,s[0],s[1],s[2],0,o[0],o[1],o[2],0,a[0],a[1],a[2],1]}(r,i,n)}return r}const Cb=64,kb=[1,1,1];class Pb{constructor(t,e,i,n){this.id=t,this.position=null!=e?new Zd(e[0],e[1]):new Zd(0,0),this.orientation=null!=i?i:[0,0,0],this.nodes=n,this.uploaded=!1,this.aabb=new ed([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(t,e){if(Au.multiply(t.matrix,e,t.matrix),t.meshes)for(const e of t.meshes){const i=ed.applyTransform(e.aabb,t.matrix);this.aabb.encapsulate(i)}if(t.children)for(const e of t.children)this._applyTransformations(e,t.matrix)}computeBoundsAndApplyParent(){const t=Au.identity([]);for(const e of this.nodes)this._applyTransformations(e,t)}_positionModelOnTerrain(t,e){const i=t.elevation;if(!i)return 0;const n=ed.projectAabbCorners(this.aabb,this.matrix),r=tp(1,this.position.lat)*t.worldSize,s=function(t,e){const i=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const r of n){const n=t[r.corners[0]],s=t[r.corners[1]],o=t[r.corners[2]],a=[s[0]-n[0],s[1]-n[1],e*(s[2]-n[2])],l=Ou.cross(a,a,[o[0]-n[0],o[1]-n[1],e*(o[2]-n[2])]);Ou.normalize(l,l),r.dotProductWithUp=Ou.dot(l,i)}return n.sort(((t,e)=>t.dotProductWithUp-e.dotProductWithUp)),n[0].corners}(n,r),o=n[s[0]],a=n[s[1]],l=n[s[2]],c=n[s[3]],h=i.getAtPointOrZero(new cp(o[0]/t.worldSize,o[1]/t.worldSize),0),u=i.getAtPointOrZero(new cp(a[0]/t.worldSize,a[1]/t.worldSize),0),d=i.getAtPointOrZero(new cp(l[0]/t.worldSize,l[1]/t.worldSize),0),p=i.getAtPointOrZero(new cp(c[0]/t.worldSize,c[1]/t.worldSize),0),f=(h+p)/2,m=(u+d)/2;return f>m?u<d?Mb(e,a,c,o,u,p,h,r):Mb(e,l,o,c,d,h,p,r):h<p?Mb(e,o,a,l,h,u,d,r):Mb(e,c,l,a,p,d,u,r),Math.max(f,m)}computeModelMatrix(t,e,i,n,r,s,o=!1){const a=t.transform,l=a.zoom,c=a.project(this.position),h=op(this.position.lat,l),u=1/h;Au.identity(this.matrix),Au.translate(this.matrix,this.matrix,[c.x+n[0]*u,c.y+n[1]*u,n[2]]);let d=1,p=1;const f=a.worldSize;if(o){if("mercator"===a.projection.name){let t=0;a.elevation&&(t=a.elevation.getAtPointOrZero(new cp(c.x/f,c.y/f),0));const e=vu.transformMat4([],[c.x,c.y,t,1],a.projMatrix)[3]/a.cameraToCenterDistance;d=e,p=e*op(a.center.lat,l)}else if("globe"===a.projection.name){const t=Ab(this.matrix,a),e=Au.multiply([],a.projMatrix,t),i=[0,0,0,1];vu.transformMat4(i,i,e);const n=i[3]/a.cameraToCenterDistance,r=Od(l),s=a.projection.pixelsPerMeter(this.position.lat,f)*op(this.position.lat,l),o=a.projection.pixelsPerMeter(a.center.lat,f)*op(a.center.lat,l);d=n/Jn(s,sp(a.center.lat),r),p=n*h/s,d*=o,p*=o}}else d=u;Au.scale(this.matrix,this.matrix,[d,d,p]);const m=[...this.matrix],g=this.orientation,_=[];if(Tb(_,[g[0]+e[0],g[1]+e[1],g[2]+e[2]],i),Au.multiply(this.matrix,m,_),r&&a.elevation){let t=0;const e=[];if(s&&a.elevation){t=this._positionModelOnTerrain(a,e);const i=Au.fromQuat([],e),n=Au.multiply([],i,_);Au.multiply(this.matrix,m,n)}else t=a.elevation.getAtPointOrZero(new cp(c.x/f,c.y/f),0);0!==t&&(this.matrix[14]+=t)}}upload(t){if(!this.uploaded){for(const e of this.nodes)Ob(e,t);for(const t of this.nodes)Lb(t);this.uploaded=!0}}destroy(){for(const t of this.nodes)zb(t)}}function Ib(t,e,i=!1){t.uploaded||(t.gfxTexture=new My(e,t.image,i?e.gl.R8:e.gl.RGBA,{useMipmap:t.sampler.minFilter>=e.gl.NEAREST_MIPMAP_NEAREST}),t.uploaded=!0,t.image=null)}function Db(t,e,i){t.indexBuffer=e.createIndexBuffer(t.indexArray,!1,!0),t.vertexBuffer=e.createVertexBuffer(t.vertexArray,Nv.members,!1,!0),t.normalArray&&(t.normalBuffer=e.createVertexBuffer(t.normalArray,$v.members,!1,!0)),t.texcoordArray&&(t.texcoordBuffer=e.createVertexBuffer(t.texcoordArray,Uv.members,!1,!0)),t.colorArray&&(t.colorBuffer=e.createVertexBuffer(t.colorArray,(12===t.colorArray.bytesPerElement?jv:Vv).members,!1,!0)),t.featureArray&&(t.pbrBuffer=e.createVertexBuffer(t.featureArray,qv.members,!0)),t.segments=bl.simpleSegment(0,0,t.vertexArray.length,t.indexArray.length);const n=t.material;n.pbrMetallicRoughness.baseColorTexture&&Ib(n.pbrMetallicRoughness.baseColorTexture,e),n.pbrMetallicRoughness.metallicRoughnessTexture&&Ib(n.pbrMetallicRoughness.metallicRoughnessTexture,e),n.normalTexture&&Ib(n.normalTexture,e),n.occlusionTexture&&Ib(n.occlusionTexture,e,i),n.emissionTexture&&Ib(n.emissionTexture,e)}function Ob(t,e,i){if(t.meshes)for(const n of t.meshes)Db(n,e,i);if(t.children)for(const n of t.children)Ob(n,e,i)}function Lb(t){if(t.meshes)for(const e of t.meshes)e.indexArray.destroy(),e.vertexArray.destroy(),e.colorArray&&e.colorArray.destroy(),e.normalArray&&e.normalArray.destroy(),e.texcoordArray&&e.texcoordArray.destroy(),e.featureArray&&e.featureArray.destroy();if(t.children)for(const e of t.children)Lb(e)}function zb(t){if(t.meshes)for(const i of t.meshes)i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((e=i.material).pbrMetallicRoughness.baseColorTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),e.pbrMetallicRoughness.metallicRoughnessTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),e.normalTexture&&e.normalTexture.gfxTexture&&e.normalTexture.gfxTexture.destroy(),e.emissionTexture&&e.emissionTexture.gfxTexture&&e.emissionTexture.gfxTexture.destroy(),e.occlusionTexture&&e.occlusionTexture.gfxTexture&&e.occlusionTexture.gfxTexture.destroy()));var e;if(t.children)for(const e of t.children)zb(e)}class Rb{constructor(t,e){this.feature=t,this.instancedDataOffset=e,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class Fb{constructor(){this.instancedDataArray=new rl,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class Bb{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.projection=t.projection,this.index=t.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0}}populate(t,e,i,n){this.tileToMeter=lp(i);const r=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:s,id:o,index:a,sourceLayerIndex:l}of t){const t=yp(s,r);if(!this.layers[0]._featureFilter.filter(new oa(this.zoom),t,i))continue;const c={id:o,sourceLayerIndex:l,index:a,geometry:r?t.geometry:_p(s,i,n),properties:s.properties,type:s.type,patterns:{}},h=this.addFeature(c,c.geometry,t);h&&e.featureIndex.insert(s,c.geometry,a,l,this.index,this.instancesPerModel[h].instancedDataArray.length)}this.lookup=null}update(t,e,i,n){for(const e in this.instancesPerModel){const i=this.instancesPerModel[e];for(const e in t)i.idToFeaturesIndex.hasOwnProperty(e)&&this.evaluate(i.features[i.idToFeaturesIndex[e]],t[e],i,!0)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let t=!1;for(const e in this.instancesPerModel){const i=this.instancesPerModel[e];for(const e of i.features){const n=this.layers[0],r=e.feature,s=this.canonical,o=n.paint.get("model-rotation").evaluate(r,{},s),a=n.paint.get("model-scale").evaluate(r,{},s),l=n.paint.get("model-translation").evaluate(r,{},s);Ou.exactEquals(e.rotation,o)&&Ou.exactEquals(e.scale,a)&&Ou.exactEquals(e.translation,l)||(this.evaluate(e,e.featureStates,i,!0),t=!0)}}return t}isEmpty(){for(const t in this.instancesPerModel)if(0!==this.instancesPerModel[t].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(t){if(!this.uploaded)for(const e in this.instancesPerModel){const i=this.instancesPerModel[e];i.instancedDataArray.length<0||0===i.instancedDataArray.length||(i.instancedDataBuffer?i.instancedDataBuffer.updateData(i.instancedDataArray):i.instancedDataBuffer=t.createVertexBuffer(i.instancedDataArray,Hv.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const t in this.instancesPerModel){const e=this.instancesPerModel[t];0!==e.instancedDataArray.length&&e.instancedDataBuffer&&e.instancedDataBuffer.destroy()}}addFeature(t,e,i){const n=this.layers[0],r=n.layout.get("model-id").evaluate(i,{},this.canonical);if(!r)return Y(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),r;this.instancesPerModel[r]||(this.instancesPerModel[r]=new Fb);const s=this.instancesPerModel[r],o=s.instancedDataArray,a=new Rb(i,o.length);for(const t of e)for(const e of t){if(e.x<0||e.x>=un||e.y<0||e.y>=un)continue;const t=(this.lookupDim-1)/un,i=this.lookupDim*(e.y*t|0)+e.x*t|0;if(this.lookup){if(0!==this.lookup[i])continue;this.lookup[i]=1}this.instanceCount++;const n=o.length;o.resize(n+1),s.instancesEvaluatedElevation.push(0),o.float32[16*n]=e.x,o.float32[16*n+1]=e.y}return a.instancedDataCount=s.instancedDataArray.length-a.instancedDataOffset,a.instancedDataCount>0&&(t.id&&(s.idToFeaturesIndex[t.id]=s.features.length),s.features.push(a),this.evaluate(a,{},s,!1)),r}evaluate(t,e,i,n){const r=this.layers[0],s=t.feature,o=this.canonical,a=t.rotation=r.paint.get("model-rotation").evaluate(s,e,o),l=t.scale=r.paint.get("model-scale").evaluate(s,e,o),c=t.translation=r.paint.get("model-translation").evaluate(s,e,o),h=r.paint.get("model-color").evaluate(s,e,o);h.a=r.paint.get("model-color-mix-intensity").evaluate(s,e,o);const u=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),Tb(u,a,l);const d=Math.round(100*h.a)+h.b/1.05;for(let e=0;e<t.instancedDataCount;++e){const r=t.instancedDataOffset+e,s=16*r,a=i.instancedDataArray.float32;let l=0;n&&(l=a[s+6]-i.instancesEvaluatedElevation[r]);const p=0|a[s+1];a[s]=(0|a[s])+h.r/1.05,a[s+1]=p+h.g/1.05,a[s+2]=d,a[s+3]=1/(o.z>10?this.tileToMeter:lp(o,p)),a[s+4]=c[0],a[s+5]=c[1],a[s+6]=c[2]+l,a[s+7]=u[0],a[s+8]=u[1],a[s+9]=u[2],a[s+10]=u[4],a[s+11]=u[5],a[s+12]=u[6],a[s+13]=u[8],a[s+14]=u[9],a[s+15]=u[10],i.instancesEvaluatedElevation[r]=c[2]}}}Lo(Bb,"ModelBucket",{omit:["layers"]}),Lo(Fb,"PerModelAttributes"),Lo(Rb,"ModelFeature");const Nb=new ya({visibility:new ma(De.layout_model.visibility),"model-id":new ga(De.layout_model["model-id"])});var jb={paint:new ya({"model-opacity":new ma(De.paint_model["model-opacity"]),"model-rotation":new ga(De.paint_model["model-rotation"]),"model-scale":new ga(De.paint_model["model-scale"]),"model-translation":new ga(De.paint_model["model-translation"]),"model-color":new ga(De.paint_model["model-color"]),"model-color-mix-intensity":new ga(De.paint_model["model-color-mix-intensity"]),"model-type":new ma(De.paint_model["model-type"]),"model-cast-shadows":new ma(De.paint_model["model-cast-shadows"]),"model-receive-shadows":new ma(De.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new ma(De.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new ga(De.paint_model["model-emissive-strength"]),"model-roughness":new ga(De.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new ga(De.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new ma(De.paint_model["model-cutoff-fade-range"])}),layout:Nb};const Vb=new Float32Array(262144),Ub=new Uint8Array(262144);function $b(t){let e=0;if(t.meshes)for(const i of t.meshes)e=Math.max(e,i.aabb.max[2]);if(t.children)for(const i of t.children)e=Math.max(e,$b(i));return e}const Hb=["","wall","door","roof","window","lamp","logo"];class qb{constructor(t){this.node=t,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.feature={type:"Point",id:t.id,geometry:[],properties:{height:$b(t)}}}}class Wb{constructor(t,e,i,n){this.nodes=t,this.id=e,this.modelTraits|=1,this.uploaded=!1,this.hasPattern=!1,i&&(this.modelTraits|=4),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=n,this.dirty=!0,this.needsUpload=!1}update(){console.log("Update 3D model bucket")}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(t){if(!this.needsUpload)return;const e=this.getNodesInfo();for(const i of e){const e=i.node;this.uploaded?this.updatePbrBuffer(e):Ob(e,t,!0)}for(const t of e)Lb(t.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(t){let e=!1;if(!t.meshes)return e;for(const i of t.meshes)i.pbrBuffer&&(i.pbrBuffer.updateData(i.featureArray),e=!0);return e}needsReEvaluation(t,e,i){const n=t.transform.projectionOptions,r=t.style.getBrightness(),s=this.brightness!==r;return!!(!this.uploaded||this.dirty||n.name!==this.projection.name||Gb(i.paint.get("model-color").value,s)||Gb(i.paint.get("model-color-mix-intensity").value,s)||Gb(i.paint.get("model-roughness").value,s)||Gb(i.paint.get("model-emissive-strength").value,s)||Gb(i.paint.get("model-height-based-emissive-strength-multiplier").value,s))&&(this.projection=n,this.brightness=r,!0)}evaluateScale(t,e){if(t.transform.zoom===this.zoom)return;this.zoom=t.transform.zoom;const i=this.getNodesInfo(),n=this.id.canonical;for(const t of i){const i=t.feature;t.evaluatedScale=e.paint.get("model-scale").evaluate(i,{},n)}}evaluate(t){const e=this.getNodesInfo();for(const i of e){if(!i.node.meshes)continue;const e=i.feature,n=i.node.meshes&&i.node.meshes[0].featureData,r=i.evaluatedColor[2],s=i.evaluatedRMEA[2],o=this.id.canonical;if(i.hasTranslucentParts=!1,n){for(let n=0;n<Hb.length;n++){const r=Hb[n];r.length&&(e.properties.part=r);const s=t.paint.get("model-color").evaluate(e,{},o),a=t.paint.get("model-color-mix-intensity").evaluate(e,{},o);i.evaluatedColor[n]=[s.r,s.g,s.b,a],i.evaluatedRMEA[n][0]=t.paint.get("model-roughness").evaluate(e,{},o),i.evaluatedRMEA[n][2]=t.paint.get("model-emissive-strength").evaluate(e,{},o),i.evaluatedRMEA[n][3]=s.a,i.emissionHeightBasedParams[n]=t.paint.get("model-height-based-emissive-strength-multiplier").evaluate(e,{},o),!i.hasTranslucentParts&&s.a<1&&(i.hasTranslucentParts=!0)}delete e.properties.part,Yb(i,r!==i.evaluatedColor[2]||s!==i.evaluatedRMEA[2])}i.evaluatedScale=t.paint.get("model-scale").evaluate(e,{},o),this.updatePbrBuffer(i.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(t,e,i,n){const r=t.findDEMTileFor(i);if(r&&(r.tileID.canonical!==this.terrainTile||e!==this.terrainExaggeration)){if(r.dem&&r.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=r.tileID.overscaledZ;const e=Jm.create(t,i,r);if(!e)return;4&this.modelTraits&&this.updateDEM(t,e,i,n);for(const t of this.getNodesInfo()){const i=t.node;if(!i.footprint||!i.footprint.vertices||!i.footprint.vertices.length)continue;const n=i.footprint.vertices;let r=e.getElevationAt(n[0].x,n[0].y,!0,!0);for(let t=1;t<n.length;t++)r=Math.min(r,e.getElevationAt(n[t].x,n[t].y,!0,!0));i.elevation=r}}this.terrainTile=r.tileID.canonical,this.terrainExaggeration=e}}updateDEM(t,e,i,n){let r=e._dem._modifiedForSources[n];if(void 0===r&&(e._dem._modifiedForSources[n]=[],r=e._dem._modifiedForSources[n]),r.includes(i.canonical))return;const s=e._dem.dim;r.push(i.canonical);let o=!1;for(const t of this.getNodesInfo()){const i=t.node;if(!i.footprint||!i.footprint.grid)continue;const n=i.footprint.grid,r=e.tileCoordToPixel(n.min.x,n.min.y),a=e.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(s-a.y,r.x),Math.min(r.y,s-a.x));if(l<0)continue;const c=I(l,2,5);let h=Math.max(0,r.x-c),u=Math.max(0,r.y-c),d=Math.min(a.x+c,s-1),p=Math.min(a.y+c,s-1);for(let t=u;t<=p;++t)for(let e=h;e<=d;++e)Ub[t*s+e]=255;let f=0,m=0;for(let t=0;t<n.cellsY;++t)for(let i=0;i<n.cellsX;++i){if(!n.cells[t*n.cellsX+i])continue;const r=e.tileCoordToPixel(n.min.x+i/n.xScale,n.min.y+t/n.yScale),o=e.tileCoordToPixel(n.min.x+(i+1)/n.xScale,n.min.y+(t+1)/n.yScale);for(let t=r.y;t<=Math.min(o.y+1,s-1);++t)for(let i=r.x;i<=Math.min(o.x+1,s-1);++i)255===Ub[t*s+i]&&(Ub[t*s+i]=0,f+=e.getElevationAtPixel(i,t),m++)}const g=f/m;h=Math.max(1,r.x-c),u=Math.max(1,r.y-c),d=Math.min(a.x+c,s-2),p=Math.min(a.y+c,s-2),o=!0;for(let t=u;t<=p;++t)for(let i=h;i<=d;++i)0===Ub[t*s+i]&&(Vb[t*s+i]=e._dem.set(i,t,g));for(let t=1;t<c;++t){h=Math.max(1,r.x-t),u=Math.max(1,r.y-t),d=Math.min(a.x+t,s-2),p=Math.min(a.y+t,s-2);for(let i=u;i<=p;++i)for(let n=h;n<=d;++n){const r=i*s+n;if(255===Ub[r]){let o=0,a=0,l=-1,h=-1;for(let e=-1;e<=1;++e)for(let r=-1;r<=1;++r){const c=(i+e)*s+n+r;if(Ub[c]>=t)continue;const u=Vb[c],d=Math.abs(u);d>a&&(o=u,a=d,l=r,h=e)}if(a>.1){const s=1-(t+.5*Math.abs(l*h))/c;let a=e._dem.get(n,i)+o*s;const u=e._dem.get(n+l,i+h),d=e._dem.get(n-l,i-h,!0);(a-u)*(a-d)>0&&(a=(u+d)/2),Vb[r]=e._dem.set(n,i,a),Ub[r]=t}}}}}o&&(e._demTile.needsDEMTextureUpload=!0,e._dem._timestamp=pe.now())}getNodesInfo(){if(!this.nodesInfo){this.nodesInfo=[];for(const t of this.nodes)this.nodesInfo.push(new qb(t));this.freeNodes()}return this.nodesInfo}freeNodes(){if(this.nodes){for(const t of this.nodes)zb(t);this.nodes.splice(0,this.nodes.length)}}destroy(){this.freeNodes();const t=this.getNodesInfo();for(const e of t)Lb(e.node),zb(e.node)}isEmpty(){return!this.nodes.length}updateReplacement(t,e){if(e.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=e.updateTime;const i=e.getReplacementRegionsForTile(t.toUnwrapped()),n=this.getNodesInfo();for(let t=0;t<this.nodesInfo.length;t++){const e=n[t].node;n[t].hiddenByReplacement=!!e.footprint&&!i.find((t=>t.footprint===e.footprint))}}getHeightAtTileCoord(t,e){const i=this.getNodesInfo(),n=[];for(let r=0;r<this.nodesInfo.length;r++){const s=i[r],o=s.node.meshes[0];if(t<o.aabb.min[0]||e<o.aabb.min[1]||t>o.aabb.max[0]||e>o.aabb.max[1])continue;const a=(t-o.aabb.min[0])/(o.aabb.max[0]-o.aabb.min[0])*Cb|0,l=Math.min(63,(e-o.aabb.min[1])/(o.aabb.max[1]-o.aabb.min[1])*Cb|0)*Cb+Math.min(63,a);if(!(o.heightmap[l]<0&&s.node.footprint)){if(s.hiddenByReplacement)return;return{height:o.heightmap[l],maxHeight:s.feature.properties.height,hidden:!1,verticalScale:s.evaluatedScale[2]}}if(s.node.footprint.grid.query(new v(t,e),new v(t,e),n),n.length>0)return{height:void 0,maxHeight:s.feature.properties.height,hidden:s.hiddenByReplacement,verticalScale:s.evaluatedScale[2]}}}}function Gb(t,e){return!t.isLightConstant&&e}function Zb(t,e,i,n,r,s,o,a){let l=(61440&e|(61440&e)>>4)>>8,c=(3840&e|(3840&e)>>4)>>4,h=240&e|(240&e)>>4;i[3]>0&&(l=Jn(l,255*i[0],i[3]),c=Jn(c,255*i[1],i[3]),h=Jn(h,255*i[2],i[3]));const u=l<<8|c,d=h<<8|Math.floor(255*n[3]),p=function(t){const e=I(t,0,2);return Math.min(Math.round(.5*e*255),255)}(n[2])<<8|15*n[0]<<4|15*n[1],f=I(r[0],0,1),m=I(r[1],0,1),g=I(r[2],0,1),_=I(r[3],0,1);let y,v,b,x;if(f!==m&&o!==s&&m!==f){const t=o-s;v=1/(t*(m-f)),b=-(s+t*f)/(t*(m-f));const e=I(r[4],-1,1);x=Math.pow(10,e),y=255*g<<8|255*_}else y=65535,v=0,b=1,x=1;if(t.emplaceBack(u,d,p,y,v,b,x),a){const t=a.length;a.clear();for(let e=0;e<t;e++)a.emplaceBack(u,d,p,y,v,b,x)}}function Yb(t,e){const i=t.node;let n=0;for(const r of i.meshes){if(i.lights&&i.lightMeshIndex===n)continue;if(!r.featureData)continue;r.featureArray=new sl,r.featureArray.reserve(r.featureData.length);let s=e;for(const e of r.featureData){let n;const o=65535&e,a=(15&o)<8?15&o:0,l=e>>16&65535,c=t.evaluatedRMEA[a],h=t.evaluatedColor[a],u=t.emissionHeightBasedParams[a];if(s&&2===a&&i.lights&&(n=new sl,n.resize(10*i.lights.length)),Zb(r.featureArray,l,h,c,u,r.aabb.min[2],r.aabb.max[2],n),n&&s){s=!1;const t=i.meshes[i.lightMeshIndex];t.featureArray=n,t.featureArray._trim()}}r.featureArray._trim(),n++}}Lo(Wb,"Tiled3dModelBucket",{omit:["layers"]}),Lo(qb,"Tiled3dModelFeature");class Xb{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[]}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(t){const e=tx(new v(0,0),new v(un,un),t),i=[];for(const n of this._activeRegions){if(n.hiddenByOverlap)continue;if(!Jb(e,n))continue;const r=ex(n.min,n.max,t);i.push({min:r.min,max:r.max,sourceId:this._sourceIds[n.priority],footprint:n.footprint,footprintTileId:n.tileId})}return i}setSources(t){this._setSources(t.map((t=>({getSourceId:()=>t.cache.id,getFootprints:()=>{const e=[];for(const i of t.cache.getVisibleCoordinates()){const n=t.cache.getTile(i).buckets[t.layer];if(n)for(const t of n.getNodesInfo()){const n=t.node;n.footprint&&e.push({footprint:n.footprint,id:i.toUnwrapped()})}}return e}}))))}_addSource(t){const e=t.getFootprints();if(0!==e.length){for(const t of e){if(!t.footprint)continue;const e=tx(t.footprint.min,t.footprint.max,t.id);this._activeRegions.push({min:e.min,max:e.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:t.id,footprint:t.footprint})}this._sourceIds.push(t.getSourceId())}}_computeReplacement(){this._activeRegions.sort(((t,e)=>t.priority-e.priority||Kb(t.min,e.min)||Kb(t.max,e.max)));let t=this._activeRegions.length!==this._prevRegions.length;if(!t){let e=0,i=0;for(;!t&&e!==this._activeRegions.length;){const n=this._activeRegions[e],r=this._prevRegions[i];t=n.priority!==r.priority||!Qb(n,r),++e,++i}}if(t){++this._updateTime;const t=t=>{const e=this._activeRegions;if(t>=e.length)return t;const i=e[t].priority;for(;t<e.length&&e[t].priority===i;)++t;return t};if(this._sourceIds.length>1){let e=0,i=t(e);for(;e!==i;){let n=e;const r=e;for(;n!==i;){const t=this._activeRegions[n];t.hiddenByOverlap=!1;for(let e=0;e<r;e++){const i=this._activeRegions[e];if(!i.hiddenByOverlap&&Jb(t,i)&&(t.hiddenByOverlap=nx(t.footprint,t.tileId,i.footprint,i.tileId),t.hiddenByOverlap))break}++n}e=i,i=t(e)}}}}_setSources(t){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let e=t.length-1;e>=0;e--)this._addSource(t[e]);this._computeReplacement()}}function Kb(t,e){return t.x-e.x||t.y-e.y}function Qb(t,e){return 0===Kb(t.min,e.min)&&0===Kb(t.max,e.max)}function Jb(t,e){return!(t.min.x>e.max.x||t.max.x<e.min.x||t.min.y>e.max.y||t.max.y<e.min.y)}function tx(t,e,i){const n=1/un,r=1/(1<<i.canonical.z),s=(e.x*n+i.canonical.x)*r+i.wrap,o=(e.y*n+i.canonical.y)*r;return{min:new v((t.x*n+i.canonical.x)*r+i.wrap,(t.y*n+i.canonical.y)*r),max:new v(s,o)}}function ex(t,e,i){const n=1<<i.canonical.z,r=((e.x-i.wrap)*n-i.canonical.x)*un,s=(e.y*n-i.canonical.y)*un;return{min:new v(((t.x-i.wrap)*n-i.canonical.x)*un,(t.y*n-i.canonical.y)*un),max:new v(r,s)}}function ix(t,e,i,n,r,s,o){const a=t.indices,l=t.vertices,c=[];for(let h=n;h<n+r;h+=3){const n=e[i[h+0]+s],r=e[i[h+1]+s],u=e[i[h+2]+s],d=Math.min(n.x,r.x,u.x),p=Math.max(n.x,r.x,u.x),f=Math.min(n.y,r.y,u.y),m=Math.max(n.y,r.y,u.y);c.length=0,t.grid.query(new v(d,f),new v(p,m),c);for(let t=0;t<c.length;t++){const e=c[t];if(zp(l[a[3*e+0]],l[a[3*e+1]],l[a[3*e+2]],n,r,u,o))return!0}}return!1}function nx(t,e,i,n){if(!t||!i)return!1;let r=t.vertices;if(!e.canonical.equals(n.canonical)||e.wrap!==n.wrap){if(i.vertices.length<t.vertices.length)return nx(i,n,t,e);const s=e.canonical,o=n.canonical,a=Math.pow(2,o.z-s.z);r=t.vertices.map((t=>new v(t.x*s.x*un*a-o.x*un,t.y*s.y*un*a-o.y*un)))}return ix(i,r,t.indices,0,t.indices.length,0,0)}const rx=um.types,sx=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius"],ox=["fill-extrusion-flood-light-ground-radius"],ax=Math.pow(2,13),lx=Math.pow(2,15)-1,cx=new v(0,1),hx=2147483648;function ux(t,e,i,n,r,s,o,a){t.emplaceBack((e<<1)+o,(i<<1)+s,(Math.floor(n*ax)<<1)+r,Math.round(a))}function dx(t,e,i,n,r,s){t.emplaceBack(e.x,e.y,(i.x<<1)+n,(i.y<<1)+r,s)}function px(t,e,i){const n=16384;t.emplaceBack(e.x,e.y,e.z,i[0]*n,i[1]*n,i[2]*n)}class fx{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class mx{constructor(){this.centroidXY=new v(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new v(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new v(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new v(this.max.x-this.min.x,this.max.y-this.min.y)}}class gx{constructor(){this.acc=new v(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(t,e){t.min.x===Number.MAX_VALUE&&(t.min.x=t.max.x=e.x,t.min.y=t.max.y=e.y)}appendEdge(t,e,i){this.accCount++,this.acc._add(e);let n=!!this.borders;e.x<t.min.x?(t.min.x=e.x,n=!0):e.x>t.max.x&&(t.max.x=e.x,n=!0),e.y<t.min.y?(t.min.y=e.y,n=!0):e.y>t.max.y&&(t.max.y=e.y,n=!0),((0===e.x||e.x===un)&&e.x===i.x)!=((0===e.y||e.y===un)&&e.y===i.y)&&this.processBorderOverlap(e,i),n&&this.checkBorderIntersection(e,i)}checkBorderIntersection(t,e){e.x<0!=t.x<0&&this.addBorderIntersection(0,Jn(e.y,t.y,(0-e.x)/(t.x-e.x))),e.x>un!=t.x>un&&this.addBorderIntersection(1,Jn(e.y,t.y,(un-e.x)/(t.x-e.x))),e.y<0!=t.y<0&&this.addBorderIntersection(2,Jn(e.x,t.x,(0-e.y)/(t.y-e.y))),e.y>un!=t.y>un&&this.addBorderIntersection(3,Jn(e.x,t.x,(un-e.y)/(t.y-e.y)))}addBorderIntersection(t,e){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const i=this.borders[t];e<i[0]&&(i[0]=e),e>i[1]&&(i[1]=e)}processBorderOverlap(t,e){if(t.x===e.x){if(t.y===e.y)return;const i=0===t.x?0:1;this.addBorderIntersection(i,e.y),this.addBorderIntersection(i,t.y)}else{const i=0===t.y?2:3;this.addBorderIntersection(i,e.x),this.addBorderIntersection(i,t.x)}}centroid(){return 0===this.accCount?new v(0,0):new v(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((t,e)=>t+ +(e[0]!==Number.MAX_VALUE)),0):0}}function _x(t,e){const i=t.add(e)._unit(),n=I(t.x*i.x+t.y*i.y,-1,1);var r,s,o;return r=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(r)))/4*lx*((s=t).x*(o=e).y-s.y*o.x<0?-1:1)}const yx=[t=>t.x<0,t=>t.x>un,t=>t.y<0,t=>t.y>un];function vx(t,e,i,n){const r=[4];if(0===n)return r;i._mult(n);const s=t.sub(i),o=e.sub(i),a=[t,e,s,o];for(let t=0;t<4;t++)for(const e of a)if(yx[t](e)){r.push(t);break}return r}class bx{constructor(t){this.vertexArray=new La,this.indexArray=new Za,this.programConfigurations=new ec(t.layers,t.zoom,(t=>ox.includes(t))),this._segments=new bl,this.hiddenByLandmarkVertexArray=new ol,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new bl}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(t,e,i,n=!1){const r=t.length;if(r>2){let s=Math.max(0,this._segments.get().length-1);const o=this._segments._prepareSegment(4*r,this.vertexArray.length,2*this._segmentToGroundQuads[s].length);let a;s!==this._segments.get().length-1&&(s++,this._segmentToGroundQuads[s]=[],this._segmentToRegionTriCounts[s]=[0,0,0,0,0]);{const e=t[0],i=t[1];a=_x(e.sub(t[r-1])._perp()._unit(),i.sub(e)._perp()._unit())}for(let l=0;l<r;l++){const c=l===r-1?0:l+1,h=t[l],u=t[c],d=t[c===r-1?0:c+1],p=u.sub(h)._perp()._unit(),f=_x(p,d.sub(u)._perp()._unit()),m=a,g=f;if(Tx(h,u,e)||n&&Mx(h,e)&&Mx(u,e)){a=f;continue}const _=o.vertexLength;dx(this.vertexArray,h,u,1,1,m),dx(this.vertexArray,h,u,1,0,m),dx(this.vertexArray,h,u,0,1,g),dx(this.vertexArray,h,u,0,0,g),o.vertexLength+=4;const y=vx(h,u,p,i);for(const t of y)this._segmentToGroundQuads[s].push({id:_,region:t}),this._segmentToRegionTriCounts[s][t]+=2,o.primitiveLength+=2;a=f}}}prepareBorderSegments(){if(!this.hasData())return;const t=this._segments.get(),e=t.length;for(let t=0;t<e;t++)this._segmentToGroundQuads[t].sort(((t,e)=>t.region-e.region));for(let i=0;i<e;i++){const e=this._segmentToGroundQuads[i],n=t[i],r=this._segmentToRegionTriCounts[i];r.reduce(((t,e)=>t+e),0);let s=0;for(let t=0;t<=4;t++){const e=r[t];if(0!==e){let i=this.regionSegments[t];i||(i=this.regionSegments[t]=new bl);const r={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+s,vertexLength:n.vertexLength,primitiveLength:e};i.get().push(r)}s+=e}for(let t=0;t<e.length;t++){const i=e[t].id;this.indexArray.emplaceBack(i,i+1,i+3),this.indexArray.emplaceBack(i,i+3,i+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(t,e,i,n,r,s){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,t,e,i,n,r,s)}upload(t){this.hasData()&&(this.vertexBuffer=t.createVertexBuffer(this.vertexArray,Gf.members),this.indexBuffer=t.createIndexBuffer(this.indexArray))}uploadPaintProperties(t){this.hasData()&&this.programConfigurations.upload(t)}update(t,e,i,n,r,s){this.hasData()&&this.programConfigurations.updatePaintArrays(t,e,i,n,r,s)}updateHiddenByLandmark(t){if(!this.hasData())return;const e=t.groundVertexCount+t.groundVertexArrayOffset;if(0===t.groundVertexCount)return;const i=t.flags&hx?1:0;for(let n=t.groundVertexArrayOffset;n<e;++n)this.hiddenByLandmarkVertexArray.emplace(n,i);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(t){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=t.createVertexBuffer(this.hiddenByLandmarkVertexArray,Yf.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let t=0;t<=4;t++){const e=this.regionSegments[t];e&&e.destroy()}}}}class xx{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Za,this.footprintVertices=new Ia,this.footprintSegments=[],this.layoutVertexArray=new Oa,this.centroidVertexArray=new _l,this.indexArray=new Za,this.programConfigurations=new ec(t.layers,t.zoom,(t=>sx.includes(t))),this.segments=new bl,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.groundEffect=new bx(t),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}populate(t,e,i,n){this.features=[],this.hasPattern=Vf("fill-extrusion",this.layers,e),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=lp(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:r,id:s,index:o,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,l=yp(r,t);if(!this.layers[0]._featureFilter.filter(new oa(this.zoom),l,i))continue;const c={id:s,sourceLayerIndex:a,index:o,geometry:t?l.geometry:_p(r,i,n),properties:r.properties,type:r.type,patterns:{}},h=this.layoutVertexArray.length;this.hasPattern?this.features.push(Uf("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,c.geometry,o,i,{},e.availableImages,n,e.brightness),e.featureIndex.insert(r,c.geometry,o,a,this.index,h)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(t,e,i,n,r,s){for(const t of this.features){const{geometry:o}=t;this.addFeature(t,o,t.index,e,i,n,r,s)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(t,e,i,n,r){const s=0!==Object.keys(t).length;if(s&&!this.stateDependentLayers.length)return;const o=s?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(t,e,o,i,n,r),this.groundEffect.update(t,e,o,i,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Kf),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=t.createVertexBuffer(this.layoutVertexExtArray,Xf.members,!0)),this.groundEffect.upload(t)),this.groundEffect.uploadPaintProperties(t),this.programConfigurations.upload(t),this.uploaded=!0}uploadCentroid(t){this.groundEffect.uploadHiddenByLandmark(t),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Zf.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,n,r,s,o,a){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(t,{})/this.tileToMeter,c=[new v(0,0),new v(un,un)],h=o.projection,u="globe"===h.name,d="Polygon"===rx[t.type],p=new gx;p.centroidDataIndex=this.centroidData.length;const f=new mx,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(t,{},n)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(t,{},n);f.height=g,f.vertexArrayOffset=this.layoutVertexArray.length,f.groundVertexArrayOffset=this.groundEffect.vertexArray.length,u&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Na);const _=Nf(e,500);for(let t=_.length-1;t>=0;t--){const e=_[t];(0===e.length||(y=e[0]).every((t=>t.x<=0))||y.every((t=>t.x>=un))||y.every((t=>t.y<=0))||y.every((t=>t.y>=un)))&&_.splice(t,1)}var y;let b;if(u)b=Px(_,c,n);else{b=[];for(const t of _)b.push({polygon:t,bounds:c})}const x=d?this.edgeRadius:0,w=x>0&&this.zoom<17,E=(t,e)=>{if(0===t.length)return!1;const i=t[t.length-1];return e.x===i.x&&e.y===i.y};for(const{polygon:t,bounds:e}of b){let i=0,r=0;for(const e of t)d&&!e[0].equals(e[e.length-1])&&e.push(e[0]),r+=d?e.length-1:e.length;const s=this.segments.prepareSegment((d?5:4)*r,this.layoutVertexArray,this.indexArray);f.footprintSegIdx<0&&(f.footprintSegIdx=this.footprintSegments.length),f.polygonSegIdx<0&&(f.polygonSegIdx=this.polygonSegments.length);const o={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new fx;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],d){const r=[],o=[];i=s.vertexLength;for(let i=0;i<t.length;i++){const c=t[i];c.length&&0!==i&&o.push(r.length/2);const d=[];let p,f;p=c[1].sub(c[0])._perp()._unit(),a.ringIndices.push(c.length-1);for(let t=1;t<c.length;t++){const e=c[t],i=c[t===c.length-1?1:t+1],o=e.clone();if(x){f=i.sub(e)._perp()._unit();const t=p.add(f)._unit(),n=x*Math.min(4,1/(p.x*t.x+p.y*t.y));o.x+=n*t.x,o.y+=n*t.y,o.x=Math.round(o.x),o.y=Math.round(o.y),p=f}!m||0!==x&&!w||E(d,o)||d.push(o),ux(this.layoutVertexArray,o.x,o.y,0,0,1,1,0),s.vertexLength++,this.footprintVertices.emplaceBack(e.x,e.y),r.push(e.x,e.y),u&&px(this.layoutVertexExtArray,h.projectTilePoint(o.x,o.y,n),h.upVector(n,o.x,o.y))}m&&(0===x||w)&&(0!==d.length&&E(d,d[0])&&d.pop(),this.groundEffect.addData(d,e,l))}const c=Bf(r,o);for(let t=0;t<c.length;t+=3)this.footprintIndices.emplaceBack(a.vertexOffset+c[t+0],a.vertexOffset+c[t+1],a.vertexOffset+c[t+2]),this.indexArray.emplaceBack(i+c[t],i+c[t+2],i+c[t+1]),s.primitiveLength++;a.indexCount+=c.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let r=0;r<t.length;r++){const o=t[r];p.startRing(f,o[0]);let a=o.length>4&&Ax(o[o.length-2],o[0],o[1]),c=x?Ex(o[o.length-2],o[0],o[1],x):0;const g=[];let _,y,v;y=o[1].sub(o[0])._perp()._unit();let b=!0;for(let t=1,r=0;t<o.length;t++){let l=o[t-1],d=o[t];const w=o[t===o.length-1?1:t+1];if(p.appendEdge(f,d,l),Tx(d,l,e)){x&&(y=w.sub(d)._perp()._unit(),b=!b);continue}const S=d.sub(l)._perp(),T=S.x/(Math.abs(S.x)+Math.abs(S.y)),M=S.y>0?1:0,A=l.dist(d);if(r+A>32768&&(r=0),x){v=w.sub(d)._perp()._unit();let t=Sx(l,d,w,wx(y,v),x);isNaN(t)&&(t=0);const e=d.sub(l)._unit();l=l.add(e.mult(c))._round(),d=d.add(e.mult(-t))._round(),c=t,y=v,m&&this.zoom>=17&&(E(g,l)||g.push(l),E(g,d)||g.push(d))}const C=s.vertexLength,k=o.length>4&&Ax(l,d,w);let P=Cx(r,a,b);if(ux(this.layoutVertexArray,l.x,l.y,T,M,0,0,P),ux(this.layoutVertexArray,l.x,l.y,T,M,0,1,P),r+=A,P=Cx(r,k,!b),a=k,ux(this.layoutVertexArray,d.x,d.y,T,M,0,0,P),ux(this.layoutVertexArray,d.x,d.y,T,M,0,1,P),s.vertexLength+=4,this.indexArray.emplaceBack(C+0,C+1,C+2),this.indexArray.emplaceBack(C+1,C+3,C+2),s.primitiveLength+=2,x){const n=i+(1===t?o.length-2:t-2),r=1===t?i:n+1;if(this.indexArray.emplaceBack(C+1,n,C+3),this.indexArray.emplaceBack(n,r,C+3),s.primitiveLength+=2,void 0===_&&(_=C),!Tx(w,o[t],e)){const e=t===o.length-1?_:s.vertexLength;this.indexArray.emplaceBack(C+2,C+3,e),this.indexArray.emplaceBack(C+3,e+1,e),this.indexArray.emplaceBack(C+3,r,e+1),s.primitiveLength+=3}b=!b}if(u){const t=this.layoutVertexExtArray,e=h.projectTilePoint(l.x,l.y,n),i=h.projectTilePoint(d.x,d.y,n),r=h.upVector(n,l.x,l.y),s=h.upVector(n,d.x,d.y);px(t,e,r),px(t,e,r),px(t,i,s),px(t,i,s)}}d&&(i+=o.length-1),m&&x&&this.zoom>=17&&(0!==g.length&&E(g,g[0])&&g.pop(),this.groundEffect.addData(g,e,l,x>0))}this.footprintSegments.push(a),o.triangleCount=this.indexArray.length-o.triangleArrayOffset,this.polygonSegments.push(o),++f.footprintSegLen,++f.polygonSegLen}if(f.vertexCount=this.layoutVertexArray.length-f.vertexArrayOffset,f.groundVertexCount=this.groundEffect.vertexArray.length-f.groundVertexArrayOffset,0!==f.vertexCount){if(f.centroidXY=p.borders?cx:this.encodeCentroid(p,f),this.centroidData.push(f),p.borders){this.featuresOnBorder.push(p);const t=this.featuresOnBorder.length-1;for(let e=0;e<p.borders.length;e++)p.borders[e][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[e].push(t)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,s,n,a),this.groundEffect.addPaintPropertiesData(t,i,r,s,n,a),this.maxHeight=Math.max(this.maxHeight,g)}}sortBorders(){for(let t=0;t<this.borderFeatureIndices.length;t++)this.borderFeatureIndices[t].sort(((e,i)=>this.featuresOnBorder[e].borders[t][0]-this.featuresOnBorder[i].borders[t][0]))}splitToSubtiles(){const t=[];for(let e=0;e<this.centroidData.length;e++){const i=this.centroidData[e],n=+(i.min.y+i.max.y>un),r=2*n+(+(i.min.x+i.max.x>un)^n);for(let n=0;n<i.polygonSegLen;n++){const s=i.polygonSegIdx+n;t.push({centroidIdx:e,subtile:r,polygonSegmentIdx:s,triangleSegmentIdx:this.polygonSegments[s].triangleSegIdx})}}const e=new Za;t.sort(((t,e)=>t.triangleSegmentIdx===e.triangleSegmentIdx?t.subtile-e.subtile:t.triangleSegmentIdx-e.triangleSegmentIdx));let i=0,n=0,r=0;for(const e of t){if(e.triangleSegmentIdx!==i)break;r++}const s=t.length;for(;n!==t.length;){i=t[n].triangleSegmentIdx;let o=0,a=n,l=n;for(let e=a;e<r&&t[e].subtile===o;e++)l++;for(;a!==r;){const n=t[a];o=n.subtile;const s=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),h={vertexOffset:this.segments.segments[i].vertexOffset,primitiveOffset:e.length,vertexLength:this.segments.segments[i].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let i=a;i<l;i++){const n=t[i],r=this.polygonSegments[n.polygonSegmentIdx],o=this.centroidData[n.centroidIdx].min,a=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let t=r.triangleArrayOffset;t<r.triangleArrayOffset+r.triangleCount;t++)e.emplaceBack(l[3*t],l[3*t+1],l[3*t+2]);h.primitiveLength+=r.triangleCount,s.x=Math.min(s.x,o.x),s.y=Math.min(s.y,o.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}h.primitiveLength>0&&this.triangleSubSegments.push({segment:h,min:s,max:c}),a=l;for(let e=a;e<r&&t[e].subtile===t[a].subtile;e++)l++}n=r;for(let e=n;e<s&&t[e].triangleSegmentIdx===t[n].triangleSegmentIdx;e++)r++}e._trim(),this.indexArray=e}getVisibleSegments(t,e,i){let n=0,r=0;const s=1<<t.canonical.z;if(e){const i=e.getMinMaxForTile(t);i&&(n=i.min,r=i.max)}r+=this.maxHeight;const o=t.toUnwrapped();let a;const l=[o.canonical.x/s+o.wrap,o.canonical.y/s],c=[(o.canonical.x+1)/s+o.wrap,(o.canonical.y+1)/s],h=new bl,u=(t,e,i)=>[t[0]*(1-i[0])+e[0]*i[0],t[1]*(1-i[1])+e[1]*i[1]],d=[],p=[];for(const t of this.triangleSubSegments){d[0]=t.min.x/un,d[1]=t.min.y/un,p[0]=t.max.x/un,p[1]=t.max.y/un;const e=u(l,c,d),s=u(l,c,p);if(0===new ed([e[0],e[1],n],[s[0],s[1],r]).intersectsPrecise(i)){a&&(h.segments.push(a),a=void 0);continue}const o=t.segment;a&&a.vertexOffset!==o.vertexOffset&&(h.segments.push(a),a=void 0),a?(a.vertexLength+=o.vertexLength,a.primitiveLength+=o.primitiveLength):a={vertexOffset:o.vertexOffset,primitiveLength:o.primitiveLength,vertexLength:o.vertexLength,primitiveOffset:o.primitiveOffset,sortKey:void 0,vaos:{}}}return a&&h.segments.push(a),h}encodeCentroid(t,e){const i=t.centroid(),n=e.span(),r=Math.min(7,Math.round(n.x*this.tileToMeter/10)),s=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new v(I(i.x,1,un-1)<<3|r,I(i.y,1,un-1)<<3|s)}showCentroid(t){const e=this.centroidData[t.centroidDataIndex];e.flags&=hx,e.centroidXY.x=0,e.centroidXY.y=0,this.writeCentroidToBuffer(e)}writeCentroidToBuffer(t){this.groundEffect.updateHiddenByLandmark(t);const e=t.vertexArrayOffset,i=t.vertexCount+t.vertexArrayOffset,n=t.flags&hx?cx:t.centroidXY,r=this.centroidVertexArray.geta_centroid_pos0(e);if(this.centroidVertexArray.geta_centroid_pos1(e)!==n.y||r!==n.x){for(let t=e;t<i;++t)this.centroidVertexArray.emplace(t,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const t of this.centroidData)this.writeCentroidToBuffer(t)}updateReplacement(t,e){if(e.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=e.updateTime;const i=e.getReplacementRegionsForTile(t.toUnwrapped());if(function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].sourceId!==e[i].sourceId||!Qb(t[i],e[i]))return!1;return!0}(this.activeReplacements,i))return;if(this.activeReplacements=i,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const t of this.centroidData)t.flags&=2147483647;const n=[];for(const e of this.activeReplacements){const i=Math.pow(2,e.footprintTileId.canonical.z-t.canonical.z);for(const r of this.centroidData)if(!(r.flags&hx||e.min.x>r.max.x||r.min.x>e.max.x||e.min.y>r.max.y||r.min.y>e.max.y))for(let s=0;s<r.footprintSegLen;s++){const o=this.footprintSegments[r.footprintSegIdx+s];if(n.length=0,Ix(this.footprintVertices,o.vertexOffset,o.vertexCount,e.footprintTileId.canonical,t.canonical,n),ix(e.footprint,n,this.footprintIndices.uint16,o.indexOffset,o.indexCount,-o.vertexOffset,-i)){r.flags|=hx;break}}}for(const t of this.centroidData)this.writeCentroidToBuffer(t);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(t,e,i){let n=!1;for(let r=0;r<i.footprintSegLen;r++){const s=this.footprintSegments[i.footprintSegIdx+r];let o=0;for(const i of s.ringIndices){for(let r=o,a=i+o-1;r<i+o;a=r++){const i=this.footprintVertices.int16[2*(r+s.vertexOffset)+0],o=this.footprintVertices.int16[2*(r+s.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+s.vertexOffset)+1];o>e!=l>e&&t<(this.footprintVertices.int16[2*(a+s.vertexOffset)+0]-i)*(e-o)/(l-o)+i&&(n=!n)}o=i}}return n}getHeightAtTileCoord(t,e){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(t+un)*un+(e+un);if(this.partLookup.hasOwnProperty(r)){const t=this.partLookup[r];return t?{height:t.height,hidden:!!(t.flags&hx)}:void 0}for(const s of this.centroidData)t>s.max.x||s.min.x>t||e>s.max.y||s.min.y>e||this.footprintContainsPoint(t,e,s)&&s&&s.height>i&&(i=s.height,this.partLookup[r]=s,n=!!(s.flags&hx));if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.partLookup[r]=void 0}}function wx(t,e){const i=t.add(e)._unit();return t.x*i.x+t.y*i.y}function Ex(t,e,i,n){const r=e.sub(t)._perp()._unit(),s=i.sub(e)._perp()._unit();return Sx(t,e,i,wx(r,s),n)}function Sx(t,e,i,n,r){const s=Math.sqrt(1-n*n);return Math.min(t.dist(e)/3,e.dist(i)/3,r*s/n)}function Tx(t,e,i){return t.x<i[0].x&&e.x<i[0].x||t.x>i[1].x&&e.x>i[1].x||t.y<i[0].y&&e.y<i[0].y||t.y>i[1].y&&e.y>i[1].y}function Mx(t,e){return t.x<e[0].x||t.x>e[1].x||t.y<e[0].y||t.y>e[1].y}function Ax(t,e,i){if(t.x<0||t.x>=un||e.x<0||e.x>=un||i.x<0||i.x>=un)return!1;const n=i.sub(e),r=n.perp(),s=t.sub(e);return(n.x*s.x+n.y*s.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(s.x*s.x+s.y*s.y))>-.866&&r.x*s.x+r.y*s.y<0}function Cx(t,e,i){const n=e?2|t:-3&t;return i?1|n:-2&n}function kx(){const t=Math.PI/32,e=Math.tan(t),i=qd;return i*Math.sqrt(1+2*e*e)-i}function Px(t,e,i){const n=1<<i.z,r=ep(i.x/n),s=ep((i.x+1)/n),o=ip(i.y/n),a=ip((i.y+1)/n);return function(t,e,i,n,r=0,s){const o=[];if(!t.length||!i||!n)return o;const a=(t,e)=>{for(const i of t)o.push({polygon:i,bounds:e})},l=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(n)),h=l-c,u=[];for(let t=0;t<Math.abs(h);t++)u.push(h>0?0:1);for(let t=0;t<Math.min(l,c);t++)u.push(0),u.push(1);let d=t;if(d=dm(d,e[0].y-r,e[1].y+r,1),d=dm(d,e[0].x-r,e[1].x+r,0),!d.length)return o;const p=[];for(u.length?p.push({polygons:d,bounds:e,depth:0}):a(d,e);p.length;){const t=p.pop(),e=t.depth,i=u[e],n=t.bounds[0],o=t.bounds[1],l=0===i?n.x:n.y,c=0===i?o.x:o.y,h=s?s(i,l,c):.5*(l+c),d=dm(t.polygons,l-r,h+r,i),f=dm(t.polygons,h-r,c+r,i);if(d.length){const t=[n,new v(0===i?h:o.x,1===i?h:o.y)];u.length>e+1?p.push({polygons:d,bounds:t,depth:e+1}):a(d,t)}if(f.length){const t=[new v(0===i?h:n.x,1===i?h:n.y),o];u.length>e+1?p.push({polygons:f,bounds:t,depth:e+1}):a(f,t)}}return o}(t,e,Math.ceil((s-r)/11.25),Math.ceil((o-a)/11.25),1,((t,e,r)=>{if(0===t)return.5*(e+r);{const t=ip((i.y+e/un)/n);return(Jd(.5*(ip((i.y+r/un)/n)+t))*n-i.y)*un}}))}function Ix(t,e,i,n,r,s){const o=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=t.int16[2*(a+e)+0],l=t.int16[2*(a+e)+1];i=(i+r.x*un)*o-n.x*un,l=(l+r.y*un)*o-n.y*un,s.push(new v(i,l))}}Lo(xx,"FillExtrusionBucket",{omit:["layers","features"]}),Lo(mx,"PartData"),Lo(fx,"FootprintSegment"),Lo(gx,"BorderCentroidData"),Lo(bx,"GroundEffect");const Dx=new ya({visibility:new ma(De["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new ma(De["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Ox={paint:new ya({"fill-extrusion-opacity":new ma(De["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ga(De["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ma(De["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ma(De["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ga(De["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ga(De["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ga(De["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ma(De["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new ma(De["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new ma(De["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new ma(De["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new ma(De["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new ma(De["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new ma(De["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new ma(De["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new ga(De["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new ga(De["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new ma(De["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new ma(De["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new ma(De["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new ma(De["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new ma(De["paint_fill-extrusion"]["fill-extrusion-emissive-strength"])}),layout:Dx};class Lx extends v{constructor(t,e,i){super(t,e),this.z=i}}function zx(t,e){return t.x*e.x+t.y*e.y}function Rx(t,e){if(1===t.length){let i=0;const n=e[i++];let r;for(;!r||n.equals(r);)if(r=e[i++],!r)return 1/0;for(;i<e.length;i++){const s=e[i],o=t[0],a=r.sub(n),l=s.sub(n),c=o.sub(n),h=zx(a,a),u=zx(a,l),d=zx(l,l),p=zx(c,a),f=zx(c,l),m=h*d-u*u,g=(d*p-u*f)/m,_=(h*f-u*p)/m,y=n.z*(1-g-_)+r.z*g+s.z*_;if(isFinite(y))return y}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}function Fx(t,e,i,n,r,s,o,a){const l=o*r.getElevationAt(t,e,!0,!0),c=0!==s[0],h=c?0===s[1]?o*(s[0]/7-450):o*function(t,e,i){const n=Math.floor(e[0]/8),r=Math.floor(e[1]/8),s=10*(e[0]-8*n),o=10*(e[1]-8*r),a=t.getElevationAt(n,r,!0,!0),l=t.getMeterToDEM(i),c=Math.floor(.5*(s*l-1)),h=Math.floor(.5*(o*l-1)),u=t.tileCoordToPixel(n,r),d=2*c+1,p=2*h+1,f=function(t,e,i,n,r){return[t.getElevationAtPixel(e,i,!0),t.getElevationAtPixel(e+r,i,!0),t.getElevationAtPixel(e,i+r,!0),t.getElevationAtPixel(e+n,i+r,!0)]}(t,u.x-c,u.y-h,d,p),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),_=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),y=Math.min(.25,.5*l*(m+g)/d),v=Math.min(.25,.5*l*_/p);return a+Math.max(y*s,v*o)}(r,s,a):l;return{base:l+(0===i)?-1:i,top:c?Math.max(h+n,l+i+2):l+n}}const Bx=new ya({"line-cap":new ga(De.layout_line["line-cap"]),"line-join":new ga(De.layout_line["line-join"]),"line-miter-limit":new ma(De.layout_line["line-miter-limit"]),"line-round-limit":new ma(De.layout_line["line-round-limit"]),"line-sort-key":new ga(De.layout_line["line-sort-key"]),visibility:new ma(De.layout_line.visibility)});var Nx={paint:new ya({"line-opacity":new ga(De.paint_line["line-opacity"]),"line-color":new ga(De.paint_line["line-color"]),"line-translate":new ma(De.paint_line["line-translate"]),"line-translate-anchor":new ma(De.paint_line["line-translate-anchor"]),"line-width":new ga(De.paint_line["line-width"]),"line-gap-width":new ga(De.paint_line["line-gap-width"]),"line-offset":new ga(De.paint_line["line-offset"]),"line-blur":new ga(De.paint_line["line-blur"]),"line-dasharray":new ga(De.paint_line["line-dasharray"]),"line-pattern":new ga(De.paint_line["line-pattern"]),"line-gradient":new _a(De.paint_line["line-gradient"]),"line-trim-offset":new ma(De.paint_line["line-trim-offset"]),"line-emissive-strength":new ma(De.paint_line["line-emissive-strength"]),"line-border-width":new ga(De.paint_line["line-border-width"]),"line-border-color":new ga(De.paint_line["line-border-color"])}),layout:Bx};const jx=(t,e,i,n,r,s,o)=>{const a=t.transform,l=a.calculatePixelsToTileUnitsMatrix(e);return{u_matrix:$x(t,e,i,n),u_pixels_to_tile_units:l,u_device_pixel_ratio:s,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:r,u_texsize:qx(i)&&e.lineAtlasTexture?e.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Ux(e,t.transform),u_alpha_discard_threshold:0,u_trim_offset:o,u_emissive_strength:i.paint.get("line-emissive-strength")}},Vx=(t,e,i,n,r)=>{const s=t.transform;return{u_matrix:$x(t,e,i,n),u_texsize:e.imageAtlasTexture?e.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:s.calculatePixelsToTileUnitsMatrix(e),u_device_pixel_ratio:r,u_image:0,u_tile_units_to_pixels:Ux(e,s),u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Ux(t,e){return 1/rb(t,1,e.tileZoom)}function $x(t,e,i,n){return t.translatePosMatrix(n||e.tileID.projMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const Hx=t=>{const e=[];qx(t)&&e.push("RENDER_LINE_DASH"),t.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const i=t.paint.get("line-trim-offset");return 0===i[0]&&0===i[1]||e.push("RENDER_LINE_TRIM_OFFSET"),0!==t.paint.get("line-border-width").constantOr(1)&&e.push("RENDER_LINE_BORDER"),e};function qx(t){const e=t.paint.get("line-dasharray").value;return e.value||"constant"!==e.kind}const Wx=new class extends ga{possiblyEvaluate(t,e){return e=new oa(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=R({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(Nx.paint.properties["line-width"].specification);function Gx(t,e){return e>0?e+2*t:t}Wx.useIntegerZoom=!0;const Zx=new ya({visibility:new ma(De.layout_background.visibility)});var Yx={paint:new ya({"background-color":new ma(De.paint_background["background-color"]),"background-pattern":new ma(De.paint_background["background-pattern"]),"background-opacity":new ma(De.paint_background["background-opacity"]),"background-emissive-strength":new ma(De.paint_background["background-emissive-strength"])}),layout:Zx};const Xx=new ya({visibility:new ma(De.layout_raster.visibility)});var Kx={paint:new ya({"raster-opacity":new ma(De.paint_raster["raster-opacity"]),"raster-color":new _a(De.paint_raster["raster-color"]),"raster-color-mix":new ma(De.paint_raster["raster-color-mix"]),"raster-color-range":new ma(De.paint_raster["raster-color-range"]),"raster-hue-rotate":new ma(De.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ma(De.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ma(De.paint_raster["raster-brightness-max"]),"raster-saturation":new ma(De.paint_raster["raster-saturation"]),"raster-contrast":new ma(De.paint_raster["raster-contrast"]),"raster-resampling":new ma(De.paint_raster["raster-resampling"]),"raster-fade-duration":new ma(De.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new ma(De.paint_raster["raster-emissive-strength"]),"raster-array-band":new ma(De.paint_raster["raster-array-band"]),"raster-elevation":new ma(De.paint_raster["raster-elevation"])}),layout:Xx};function Qx(t,e,i,n,r,s,o,a){const l=[t,i,r,e,n,s,1,1,1],c=[o,a,1],h=Tu.adjoint([],l),[u,d,p]=Ou.transformMat3(c,c,Tu.transpose(h,h));return Tu.multiply(l,[u,0,0,0,d,0,0,0,p],l)}class Jx extends Ie{constructor(t,e,i,n){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=e,this._dirty=!1}load(t,i){if(this._loaded=i||!1,this.fire(new ke("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return t&&(this.coordinates=t),this._loaded=!0,void this._finishLoading();this._imageRequest=kt(this.map._requestManager.transformRequest(this.url,vt.Image),((i,n)=>{if(this._imageRequest=null,this._loaded=!0,i)this.fire(new Pe(i));else if(n){const{HTMLImageElement:i}=e;this.image=n instanceof i?pe.getImageData(n):n,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,t&&(this.coordinates=t),this._finishLoading()}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._imageRequest&&t.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=t.url,this.load(t.coordinates,this._loaded),this):this}setTexture(t){if(!(t.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new Ay(this.map.painter.context,t.handle),this.width=t.dimensions[0],this.height=t.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new ke("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof Ay||this.texture.destroy()}setCoordinates(t){if(this.coordinates=t,this._boundsArray=void 0,!t.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let e=t[0][1],i=t[0][1];for(const n of t)n[1]>i&&(i=n[1]),n[1]<e&&(e=n[1]);const n=(i+e)/2;if(n>rp?this.onNorthPole=!0:n<-rp&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const e=t.map(cp.fromLngLat);this.tileID=function(t){let e=1/0,i=1/0,n=-1/0,r=-1/0;for(const s of t)e=Math.min(e,s.x),i=Math.min(i,s.y),n=Math.max(n,s.x),r=Math.max(r,s.y);const s=Math.max(n-e,r-i),o=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),a=Math.pow(2,o);return new $u(o,Math.floor((e+n)/2*a),Math.floor((i+r)/2*a))}(e),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new ke("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(t){for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}if(this._boundsArray)return;const e=D_(this.tileID,this.map.transform.projection),[i,n,r,s]=this.coordinates.map((t=>{const i=e.projection.project(t[0],t[1]);return L_(e,i)._round()}));this.perspectiveTransform=function(t,e,i,n,r,s,o,a,l,c){const h=Qx(0,0,t,0,0,e,t,e),u=Qx(i,n,r,s,o,a,l,c);return Tu.multiply(u,Tu.adjoint(h,h),u),[u[6]/u[8]*t/un,u[7]/u[8]*e/un]}(this.width,this.height,i.x,i.y,n.x,n.y,s.x,s.y,r.x,r.y);const o=this._boundsArray=new Oa;o.emplaceBack(i.x,i.y,0,0),o.emplaceBack(n.x,n.y,un,0),o.emplaceBack(s.x,s.y,0,un),o.emplaceBack(r.x,r.y,un,un),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=t.createVertexBuffer(o,zy.members),this.boundsSegments=bl.simpleSegment(0,0,4,2)}prepare(){const t=0!==Object.keys(this.tiles).length;if(this.tileID&&!t)return;const e=this.map.painter.context,i=e.gl;!this._dirty||this.texture instanceof Ay||(this.texture?this.texture.update(this.image):(this.texture=new My(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this._dirty=!1),t&&this._prepareData(e)}loadTile(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class tw extends Sa{constructor(t){super(t,{}),this.implementation=t,t.slot&&(this.slot=t.slot)}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(t){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}const ew=new ya({visibility:new ma(De.layout_sky.visibility)});var iw={paint:new ya({"sky-type":new ma(De.paint_sky["sky-type"]),"sky-atmosphere-sun":new ma(De.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ma(De.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ma(De.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ma(De.paint_sky["sky-gradient-radius"]),"sky-gradient":new _a(De.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ma(De.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ma(De.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ma(De.paint_sky["sky-opacity"])}),layout:ew};function nw(t,e,i){const n=[0,0,1],r=ku.identity([]);return ku.rotateY(r,r,i?-E(t)+Math.PI:E(t)),ku.rotateX(r,r,-E(e)),Ou.transformQuat(n,n,r),Ou.normalize(n,n)}var rw={paint:new ya({})};const sw={circle:class extends Sa{constructor(t,e){super(t,Vp,e)}createBucket(t){return new xp(t)}queryRadius(t){const e=t;return Rp("circle-radius",this,e)+Rp("circle-stroke-width",this,e)+Fp(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,r,s,o,a){const l=Np(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return qp(t,n,s,o,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(t,e){const i=Hp(this);return{config:new tc(this,e),defines:i,overrideFog:!1}}},heatmap:class extends Sa{createBucket(t){return new Xp(t)}constructor(t,e){super(t,sf,e),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=of({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(t){return Rp("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,r,s,o,a){const l=this.paint.get("heatmap-radius").evaluate(e,i);return qp(t,n,s,o,a,!0,!0,new v(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(t,e){return"heatmap"===t?{config:new tc(this,e),overrideFog:!1}:{}}},hillshade:class extends Sa{constructor(t,e){super(t,lf,e)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(t,e){return{overrideFog:!1}}},fill:class extends Sa{constructor(t,e){super(t,qf,e)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getDefaultProgramParams(t,e){return{config:new tc(this,e),overrideFog:!1}}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new $f(t)}queryRadius(){return Fp(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,r,s){return!t.queryGeometry.isAboveHorizon&&Sp(Bp(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends Sa{constructor(t,e){super(t,Ox,e),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(t){return new xx(t)}queryRadius(){return Fp(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}hasShadowPass(){return!0}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(t,e,i,n,r,s,o,a,l){const c=Np(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),h=this.paint.get("fill-extrusion-height").evaluate(e,i),u=this.paint.get("fill-extrusion-base").evaluate(e,i),d=[0,0],p=a&&s.elevation,f=s.elevation?s.elevation.exaggeration():1,m=t.tile.getBucket(this);if(p&&m instanceof xx){const t=m.centroidVertexArray,e=l+1;e<t.length&&(d[0]=t.geta_centroid_pos0(e),d[1]=t.geta_centroid_pos1(e))}if(0===d[0]&&1===d[1])return!1;"globe"===s.projection.name&&(n=Px([n],[new v(0,0),new v(un,un)],t.tileID.canonical).map((t=>t.polygon)).flat());const g=p?a:null,[_,y]=function(t,e,i,n,r,s,o,a,l,c,h){return"globe"===t.projection.name?function(t,e,i,n,r,s,o,a,l,c,h){const u=[],d=[],p=t.projection.upVectorScale(h,t.center.lat,t.worldSize).metersToTile,f=[0,0,0,1],m=[0,0,0,1],g=(t,e,i,n)=>{t[0]=e,t[1]=i,t[2]=n,t[3]=1},_=kx();i>0&&(i+=_),n+=_;for(const _ of e){const e=[],y=[];for(const u of _){const d=u.x+r.x,_=u.y+r.y,v=t.projection.projectTilePoint(d,_,h),b=t.projection.upVector(h,u.x,u.y);let x=i,w=n;if(o){const t=Fx(d,_,i,n,o,a,l,c);x+=t.base,w+=t.top}0!==i?g(f,v.x+b[0]*p*x,v.y+b[1]*p*x,v.z+b[2]*p*x):g(f,v.x,v.y,v.z),g(m,v.x+b[0]*p*w,v.y+b[1]*p*w,v.z+b[2]*p*w),Ou.transformMat4(f,f,s),Ou.transformMat4(m,m,s),e.push(new Lx(f[0],f[1],f[2])),y.push(new Lx(m[0],m[1],m[2]))}u.push(e),d.push(y)}return[u,d]}(t,e,i,n,r,s,o,a,l,c,h):o?function(t,e,i,n,r,s,o,a,l){const c=[],h=[],u=[0,0,0,1];for(const d of t){const t=[],p=[];for(const c of d){const h=c.x+n.x,d=c.y+n.y,f=Fx(h,d,e,i,s,o,a,l);u[0]=h,u[1]=d,u[2]=f.base,u[3]=1,vu.transformMat4(u,u,r),u[3]=Math.max(u[3],1e-5);const m=new Lx(u[0]/u[3],u[1]/u[3],u[2]/u[3]);u[0]=h,u[1]=d,u[2]=f.top,u[3]=1,vu.transformMat4(u,u,r),u[3]=Math.max(u[3],1e-5);const g=new Lx(u[0]/u[3],u[1]/u[3],u[2]/u[3]);t.push(m),p.push(g)}c.push(t),h.push(p)}return[c,h]}(e,i,n,r,s,o,a,l,c):function(t,e,i,n,r){const s=[],o=[],a=r[8]*e,l=r[9]*e,c=r[10]*e,h=r[11]*e,u=r[8]*i,d=r[9]*i,p=r[10]*i,f=r[11]*i;for(const e of t){const t=[],i=[];for(const s of e){const e=s.x+n.x,o=s.y+n.y,m=r[0]*e+r[4]*o+r[12],g=r[1]*e+r[5]*o+r[13],_=r[2]*e+r[6]*o+r[14],y=r[3]*e+r[7]*o+r[15],v=m+a,b=g+l,x=_+c,w=Math.max(y+h,1e-5),E=m+u,S=g+d,T=_+p,M=Math.max(y+f,1e-5);t.push(new Lx(v/w,b/w,x/w)),i.push(new Lx(E/M,S/M,T/M))}s.push(t),o.push(i)}return[s,o]}(e,i,n,r,s)}(s,n,u,h,c,o,g,d,f,s.center.lat,t.tileID.canonical),b=t.queryGeometry;return function(t,e,i){let n=1/0;Sp(i,e)&&(n=Rx(i,e[0]));for(let r=0;r<e.length;r++){const s=e[r],o=t[r];for(let t=0;t<s.length-1;t++){const e=s[t],r=[e,s[t+1],o[t+1],o[t],e];wp(i,r)&&(n=Math.min(n,Rx(i,r)))}}return n!==1/0&&n}(_,y,b.isPointQuery()?b.screenBounds:b.screenGeometry)}},line:class extends Sa{constructor(t,e){super(t,Nx,e),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression&&t._styleExpression.expression instanceof Qn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Wx.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Ty(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(t,e){const i=Hx(this);return{config:new tc(this,e),defines:i,overrideFog:!1}}queryRadius(t){const e=t,i=Gx(Rp("line-width",this,e),Rp("line-gap-width",this,e)),n=Rp("line-offset",this,e);return i/2+Math.abs(n)+Fp(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,n,r,s){if(t.queryGeometry.isAboveHorizon)return!1;const o=Bp(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),a=t.pixelToTileUnitsFactor/2*Gx(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),l=this.paint.get("line-offset").evaluate(e,i);return l&&(n=function(t,e){const i=[],n=new v(0,0);for(let r=0;r<t.length;r++){const s=t[r],o=[];for(let t=0;t<s.length;t++){const i=s[t],r=s[t+1],a=0===t?n:i.sub(s[t-1])._unit()._perp(),l=t===s.length-1?n:r.sub(i)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),o.push(c._mult(e)._add(i))}i.push(o)}return i}(n,l*t.pixelToTileUnitsFactor)),function(t,e,i){for(let n=0;n<e.length;n++){const r=e[n];if(t.length>=3)for(let e=0;e<r.length;e++)if(Ip(t,r[e]))return!0;if(Tp(t,r,i))return!0}return!1}(o,n,a)}isTileClipped(){return!0}},symbol:oy,background:class extends Sa{constructor(t,e){super(t,Yx,e)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(t,e){return{overrideFog:!1}}},raster:class extends Sa{constructor(t,e){super(t,Kx,e),this._updateColorRamp()}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}isLayerDraped(t){return!(t&&t._source instanceof Jx)||!t._source.onNorthPole&&!t._source.onSouthPole&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(t){"raster-color"!==t&&"raster-color-range"!==t||this._updateColorRamp()}_updateColorRamp(){if(!this.hasColorMap())return;const t=this._transitionablePaint._values["raster-color"].value.expression,[e,i]=this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0});this.colorRamp=of({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:e,end:i}],resolution:256}),this.colorRampTexture=null}},sky:class extends Sa{constructor(t,e){super(t,iw,e),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"sky-gradient"===t?this._updateColorRamp():"sky-atmosphere-sun"!==t&&"sky-atmosphere-halo-color"!==t&&"sky-atmosphere-color"!==t&&"sky-atmosphere-sun-intensity"!==t||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=of({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(t,e){if("atmosphere"===this.paint.get("sky-type")){const i=this.paint.get("sky-atmosphere-sun"),n=!i,r=t.style.light,s=r.properties.get("position");return n&&"viewport"===r.properties.get("anchor")&&Y("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?nw(s.azimuthal,90-s.polar,e):nw(i[0],90-i[1],e)}const i=this.paint.get("sky-gradient-center");return nw(i[0],90-i[1],e)}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return"atmosphere"===t?["skyboxCapture","skybox"]:"gradient"===t?["skyboxGradient"]:null}},slot:class extends Sa{constructor(t,e){super(t,rw)}},model:class extends Sa{constructor(t,e){super(t,jb,e)}createBucket(t){return new Bb(t)}getProgramIds(){return["model"]}is3D(){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(){return 0}queryIntersectsFeature(){return!1}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven()||"model-color"!==t&&"model-color-mix-intensity"!==t&&"model-rotation"!==t&&"model-scale"!==t&&"model-translation"!==t&&"model-emissive-strength"!==t)}_isPropertyZoomDependent(t){const e=this._transitionablePaint._values[t];return null!=e&&null!=e.value&&null!=e.value.expression&&e.value.expression instanceof Ms}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}}};function ow(t,e){return"custom"===t.type?new tw(t):new sw[t.type](t,e)}function aw(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class lw extends Ie{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded={},this.requestors=[],this.patterns={},this.atlasImage={},this.atlasTexture={},this.dirty=!0}createScope(t){this.images[t]={},this.loaded[t]=!1,this.updatedImages[t]={},this.patterns[t]={},this.callbackDispatchedThisFrame[t]={},this.atlasImage[t]=new ef({width:1,height:1})}isLoaded(){for(const t in this.loaded)if(!this.loaded[t])return!1;return!0}setLoaded(t,e){if(this.loaded[e]!==t&&(this.loaded[e]=t,t)){for(const{ids:t,callback:i}of this.requestors)this._notify(t,e,i);this.requestors=[]}}hasImage(t,e){return!!this.getImage(t,e)}getImage(t,e){return this.images[e][t]}addImage(t,e,i){this._validate(t,i)&&(this.images[e][t]=i)}_validate(t,e){let i=!0;return this._validateStretch(e.stretchX,e.data&&e.data.width)||(this.fire(new Pe(new Error(`Image "${t}" has invalid "stretchX" value`))),i=!1),this._validateStretch(e.stretchY,e.data&&e.data.height)||(this.fire(new Pe(new Error(`Image "${t}" has invalid "stretchY" value`))),i=!1),this._validateContent(e.content,e)||(this.fire(new Pe(new Error(`Image "${t}" has invalid "content" value`))),i=!1),i}_validateStretch(t,e){if(!t)return!0;let i=0;for(const n of t){if(n[0]<i||n[1]<n[0]||e<n[1])return!1;i=n[1]}return!0}_validateContent(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))}updateImage(t,e,i){i.version=this.images[e][t].version+1,this.images[e][t]=i,this.updatedImages[e][t]=!0}removeImage(t,e){const i=this.images[e][t];delete this.images[e][t],delete this.patterns[e][t],i.userImage&&i.userImage.onRemove&&i.userImage.onRemove()}listImages(t){return Object.keys(this.images[t])}getImages(t,e,i){let n=!0;const r=!!this.loaded[e];if(!r)for(const i of t)this.images[e][i]||(n=!1);r||n?this._notify(t,e,i):this.requestors.push({ids:t,scope:e,callback:i})}getUpdatedImages(t){return this.updatedImages[t]}_notify(t,e,i){const n={};for(const i of t){this.images[e][i]||this.fire(new ke("styleimagemissing",{id:i}));const t=this.images[e][i];t?n[i]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:Y(`Image "${i}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}i(null,n)}getPixelSize(t){const{width:e,height:i}=this.atlasImage[t];return{width:e,height:i}}getPattern(t,e){const i=this.patterns[e][t],n=this.getImage(t,e);if(!n)return null;if(i&&i.position.version===n.version)return i.position;if(i)i.position.version=n.version;else{const i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},r=new t_(i,n);this.patterns[e][t]={bin:i,position:r}}return this._updatePatternAtlas(e),this.patterns[e][t].position}bind(t,e){const i=t.gl;let n=this.atlasTexture[e];n?this.dirty&&(n.update(this.atlasImage[e]),this.dirty=!1):(n=new My(t,this.atlasImage[e],i.RGBA),this.atlasTexture[e]=n),n.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(t){const e=[];for(const i in this.patterns[t])e.push(this.patterns[t][i].bin);const{w:i,h:n}=Qg(e),r=this.atlasImage[t];r.resize({width:i||1,height:n||1});for(const e in this.patterns[t]){const{bin:i}=this.patterns[t][e],n=i.x+1,s=i.y+1,o=this.images[t][e].data,a=o.width,l=o.height;ef.copy(o,r,{x:0,y:0},{x:n,y:s},{width:a,height:l}),ef.copy(o,r,{x:0,y:l-1},{x:n,y:s-1},{width:a,height:1}),ef.copy(o,r,{x:0,y:0},{x:n,y:s+l},{width:a,height:1}),ef.copy(o,r,{x:a-1,y:0},{x:n-1,y:s},{width:1,height:l}),ef.copy(o,r,{x:0,y:0},{x:n+a,y:s},{width:1,height:l})}this.dirty=!0}beginFrame(){for(const t in this.images)this.callbackDispatchedThisFrame[t]={}}dispatchRenderCallbacks(t,e){for(const i of t){if(this.callbackDispatchedThisFrame[e][i])continue;this.callbackDispatchedThisFrame[e][i]=!0;const t=this.images[e][i];aw(t)&&this.updateImage(i,e,t)}}}const cw=new ya({anchor:new ma(De.light.anchor),position:new class{constructor(t){this.specification=t}possiblyEvaluate(t,e){return Q(t.expression.evaluate(e))}interpolate(t,e,i){return{x:Jn(t.x,e.x,i),y:Jn(t.y,e.y,i),z:Jn(t.z,e.z,i),azimuthal:Jn(t.azimuthal,e.azimuthal,i),polar:Jn(t.polar,e.polar,i)}}}(De.light.position),color:new ma(De.light.color),intensity:new ma(De.light.intensity)});class hw extends Ie{constructor(t,e="flat"){super(),this._transitionable=new ca(cw),this.setLight(t,e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,e,i={}){this._validate(yo,t,i)||(this._transitionable.setTransitionOrValue(t),this.id=e)}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,e,i){return(!i||!1!==i.validate)&&Co(this,t.call(go,R({value:e,style:{glyphs:!0,sprite:!0},styleSpec:De})))}}const uw=new ya({source:new ma(De.terrain.source),exaggeration:new ma(De.terrain.exaggeration)});let dw=class extends Ie{constructor(t,e,i,n){super(),this.scope=i,this._transitionable=new ca(uw,n),this._transitionable.setTransitionOrValue(t,n),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=e}get(){return this._transitionable.serialize()}set(t,e){this._transitionable.setTransitionOrValue(t,e)}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new oa(t)).get("exaggeration")}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof Ms}};const pw=45,fw=65,mw=.05;function gw(t,e,i,n){const r=D(pw,fw,i),[s,o]=_w(t,n);let a=1-Math.min(1,Math.exp((e-s)/(o-s)*-6));return a*=a*a,a=Math.min(1,1.00747*a),a*r*t.alpha}function _w(t,e){const i=.5/Math.tan(.5*e);return[t.range[0]+i,t.range[1]+i]}function yw(t,e,i,n,r){const s=Ou.transformMat4([],[e,i,n],r.mercatorFogMatrix);return gw(t,Ou.length(s),r.pitch,r._fov)}function vw(t,e,i,n,r,s,o){const a=[[i,n,0],[r,n,0],[r,s,0],[i,s,0]];let l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(const t of a){const i=Ou.transformMat4([],t,e),n=Ou.length(i);l=Math.min(l,n),c=Math.max(c,n)}return[gw(t,l,o.pitch,o._fov),gw(t,c,o.pitch,o._fov)]}const bw=new ya({range:new ma(De.fog.range),color:new ma(De.fog.color),"high-color":new ma(De.fog["high-color"]),"space-color":new ma(De.fog["space-color"]),"horizon-blend":new ma(De.fog["horizon-blend"]),"star-intensity":new ma(De.fog["star-intensity"]),"vertical-range":new ma(De.fog["vertical-range"])});class xw extends Ie{constructor(t,e){super(),this._transitionable=new ca(bw),this.set(t),this._transitioning=this._transitionable.untransitioned(),this._transform=e}get state(){const t=this._transform,e="globe"===t.projection.name,i=Od(t.zoom),n=this.properties.get("range"),r=[.5,3];return{range:e?[Jn(r[0],n[0],i),Jn(r[1],n[1],i)]:n,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,e={}){if(this._validate(xo,t,e))return;const i=R({},t);for(const t of Object.keys(De.fog))void 0===i[t]&&(i[t]=De.fog[t].default);this._transitionable.setTransitionOrValue(i)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const e=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:D(pw,fw,t))*e.a}getOpacityAtLatLng(t,e){return this._transform.projection.supportsFog?function(t,e,i){const n=cp.fromLngLat(e),r=i.elevation?i.elevation.getAtPointOrZero(n):0;return yw(t,n.x,n.y,r,i)}(this.state,t,e):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const e=this._transform.calculateFogTileMatrix(t.toUnwrapped());return vw(this.state,e,0,0,un,un,this._transform)}getOpacityForBounds(t,e,i,n,r){return this._transform.projection.supportsFog?vw(this.state,t,e,i,n,r,this._transform):[1,1]}getFovAdjustedRange(t){return this._transform.projection.supportsFog?_w(this.state,t):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const e=[4,5,6,7];for(const i of e){const e=t.points[i];let n;if(e[2]>=0)n=e;else{const r=t.points[i-4];n=tr(r,e,r[2]/(r[2]-e[2]))}if(yw(this.state,n[0],n[1],0,this._transform)>=mw)return!0}return!1}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,e,i){return(!i||!1!==i.validate)&&Co(this,t.call(go,R({value:e,style:{glyphs:!0,sprite:!0},styleSpec:De})))}}class ww{constructor(t){this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class Ew{constructor(){this.tasks={},this.taskQueue=[],$(["process"],this),this.invoker=new ww(this.process),this.nextId=0}add(t,e){const i=this.nextId++,n=function({type:t,isSymbolTile:e,zoom:i}){return i=i||0,"message"===t?0:"maybePrepare"!==t||e?"parseTile"!==t||e?"parseTile"===t&&e?300-i:"maybePrepare"===t&&e?400-i:500:200-i:100-i}(e);if(0===n){tt();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[i]={fn:t,metadata:e,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){tt();try{if(this.taskQueue=this.taskQueue.filter((t=>!!this.tasks[t])),!this.taskQueue.length)return;const t=this.pick();if(null===t)return;const e=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!e)return;e.fn()}finally{}}pick(){let t=null,e=1/0;for(let i=0;i<this.taskQueue.length;i++){const n=this.tasks[this.taskQueue[i]];n.priority<e&&(e=n.priority,t=i)}if(null===t)return null;const i=this.taskQueue[t];return this.taskQueue.splice(t,1),i}remove(){this.invoker.remove()}}class Sw{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},$(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new Ew}send(t,e,i,n,r=!1,s){const o=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=s,this.callbacks[o]=i);const a=new Set;return this.target.postMessage({id:o,type:t,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:Fo(e,a)},a),{cancel:()=>{i&&delete this.callbacks[o],this.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){const t=this.cancelCallbacks[i];delete this.cancelCallbacks[i],t&&t.cancel()}else if(e.mustQueue||tt()){const t=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add((()=>this.processTask(i,e)),t&&t.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if("<response>"===e.type){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(Bo(e.error)):i(null,Bo(e.data)))}else{const i=new Set,n=e.hasCallback?(e,n)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:e?Fo(e):null,data:Fo(n,i)},i)}:t=>{},r=Bo(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,r,n);else if(this.parent.getWorkerSource){const t=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,t[0],r.source,r.scope)[t[1]](r,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}class Tw{constructor(t,e){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=N();const i=this.workerPool.acquire(this.id);for(let t=0;t<i.length;t++){const n=new Tw.Actor(i[t],e,this.id);n.name=`Worker ${t}`,this.actors.push(n)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(t,e,i){L(this.actors,((i,n)=>{i.send(t,e,n)}),i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((t=>{t.remove()})),this.actors=[],this.workerPool.release(this.id)}}Tw.Actor=Sw;class Mw extends Ie{constructor(t,e,i,n){super(),this.scope=i,this._options=t,this.properties=new fa(e),this._transitionable=new ca(e,new Map(n)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(t){this._transitionable.setTransitionOrValue(this._options.properties,new Map(t))}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(t,e){this._options=t,this._transitionable.setTransitionOrValue(t.properties,e)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}const Aw=new ya({color:new ma(De.properties_light_ambient.color),intensity:new ma(De.properties_light_ambient.intensity)}),Cw=new ya({direction:new class{constructor(t){this.specification=t}possiblyEvaluate(t,e){return function([t,e]){const i=Q([1,t,e]);return{x:i.x,y:i.y,z:i.z}}(t.expression.evaluate(e))}interpolate(t,e,i){return{x:Jn(t.x,e.x,i),y:Jn(t.y,e.y,i),z:Jn(t.z,e.z,i)}}}(De.properties_light_directional.direction),color:new ma(De.properties_light_directional.color),intensity:new ma(De.properties_light_directional.intensity),"cast-shadows":new ma(De.properties_light_directional["cast-shadows"]),"shadow-intensity":new ma(De.properties_light_directional["shadow-intensity"])});class kw{constructor(t,e,i,n){this.screenBounds=t,this.cameraPoint=e,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=i,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,n)}static createFromScreenPoints(t,e){let i,n;if(t instanceof v||"number"==typeof t[0]){const r=v.convert(t);i=[r],n=e.isPointAboveHorizon(r)}else{const r=v.convert(t[0]),s=v.convert(t[1]);i=[r,s],n=C(r,s).every((t=>e.isPointAboveHorizon(t)))}return new kw(i,e.getCameraPoint(),n,e)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return C(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const e=this.screenBounds[0],i=1===this.screenBounds.length?this.screenBounds[0].add(new v(1,1)):this.screenBounds[1],n=C(e,i,0,!1);return this.cameraPoint.y>i.y&&(this.cameraPoint.x>e.x&&this.cameraPoint.x<i.x?n.splice(3,0,this.cameraPoint):this.cameraPoint.x>=i.x?n[2]=this.cameraPoint:this.cameraPoint.x<=e.x&&(n[3]=this.cameraPoint)),function(t,e){const i=[];for(let n=0;n<t.length;n++){const r=O(n-1,-1,t.length-1),s=O(n+1,-1,t.length-1),o=t[n],a=t[s],l=t[r].sub(o).unit(),c=a.sub(o).unit(),h=c.angleWithSep(l.x,l.y),u=l.add(c).unit().mult(-1*e/Math.sin(h/2));i.push(o.add(u))}return i}(n,t)}bufferedCameraGeometryGlobe(t){const e=this.screenBounds[0],i=1===this.screenBounds.length?this.screenBounds[0].add(new v(1,1)):this.screenBounds[1],n=C(e,i,t),r=this.cameraPoint.clone();switch(3*((r.y>e.y)+(r.y>i.y))+((r.x>e.x)+(r.x>i.x))){case 0:n[0]=r,n[4]=r.clone();break;case 1:n.splice(1,0,r);break;case 2:n[1]=r;break;case 3:n.splice(4,0,r);break;case 5:n.splice(2,0,r);break;case 6:n[3]=r;break;case 7:n.splice(3,0,r);break;case 8:n[2]=r}return n}containsTile(t,e,i,n=0){const r=t.queryPadding/e._pixelsPerMercatorPixel+1,s=i?this._bufferedCameraMercator(r,e):this._bufferedScreenMercator(r,e);let o=t.tileID.wrap+(s.unwrapped?n:0);const a=s.polygon.map((e=>L_(t.tileTransform,e,o)));if(!Dp(a,0,0,un,un))return;o=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?n:0);const l=this.screenGeometryMercator.polygon.map((e=>z_(t.tileTransform,e,o))),c=l.map((t=>new v(t[0],t[1]))),h=e.getFreeCameraOptions().position||new cp(0,0,0),u=z_(t.tileTransform,h,o),d=l.map((t=>{const e=Ou.sub(t,t,u);return Ou.normalize(e,e),new Zu(u,e)})),p=rb(t,1,e.zoom)*e._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:c,tilespaceRays:d,bufferedTilespaceGeometry:a,bufferedTilespaceBounds:(f=A(a),f.min.x=I(f.min.x,0,un),f.min.y=I(f.min.y,0,un),f.max.x=I(f.max.x,0,un),f.max.y=I(f.max.y,0,un),f),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var f}_bufferedScreenMercator(t,e){const i=Dw(t);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let n;return n="globe"===e.projection.name?this._projectAndResample(this.bufferedScreenGeometry(t),e):{polygon:this.bufferedScreenGeometry(t).map((t=>e.pointCoordinate3D(t))),unwrapped:!0},this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(t,e){const i=Dw(t);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let n;return n="globe"===e.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(t),e):{polygon:this.bufferedCameraGeometry(t).map((t=>e.pointCoordinate3D(t))),unwrapped:!0},this._cameraRaycastCache[i]=n,n}}_projectAndResample(t,e){const i=function(t,e){const i=Au.multiply([],e.pixelMatrix,e.globeMatrix),n=[0,-rd,0,1],r=[0,rd,0,1],s=[0,0,0,1];vu.transformMat4(n,n,i),vu.transformMat4(r,r,i),vu.transformMat4(s,s,i);const o=new v(n[0]/n[3],n[1]/n[3]),a=new v(r[0]/r[3],r[1]/r[3]),l=Ip(t,o)&&n[3]<s[3],c=Ip(t,a)&&r[3]<s[3];if(!l&&!c)return null;const h=function(t,e,i){for(let n=1;n<t.length;n++){const r=Iw(e.pointCoordinate3D(t[n-1]).x),s=Iw(e.pointCoordinate3D(t[n]).x);if(i<0){if(r<s)return{idx:n,t:-r/(s-1-r)}}else if(s<r)return{idx:n,t:(1-r)/(s+1-r)}}return null}(t,e,l?-1:1);if(!h)return null;const{idx:u,t:d}=h;let p=u>1?Pw(t.slice(0,u),e):[],f=u<t.length?Pw(t.slice(u),e):[];p=p.map((t=>new v(Iw(t.x),t.y))),f=f.map((t=>new v(Iw(t.x),t.y)));const m=[...p];0===m.length&&m.push(f[f.length-1]);const g=Jn(m[m.length-1].y,(0===f.length?p[0]:f[0]).y,d);let _;return _=l?[new v(0,g),new v(0,0),new v(1,0),new v(1,g)]:[new v(1,g),new v(1,1),new v(0,1),new v(0,g)],m.push(..._),0===f.length?m.push(p[0]):m.push(...f),{polygon:m.map((t=>new cp(t.x,t.y))),unwrapped:!1}}(t,e);if(i)return i;const n=function(t,e){let i=!1,n=-1/0,r=0;for(let e=0;e<t.length-1;e++)t[e].x>n&&(n=t[e].x,r=e);for(let e=0;e<t.length-1;e++){const n=(r+e)%(t.length-1),s=t[n],o=t[n+1];Math.abs(s.x-o.x)>.5&&(s.x<o.x?(s.x+=1,0===n&&(t[t.length-1].x+=1)):(o.x+=1,n+1===t.length-1&&(t[0].x+=1)),i=!0)}const s=Qd(e.center.lng);return i&&s<Math.abs(s-1)&&t.forEach((t=>{t.x-=1})),{polygon:t,unwrapped:i}}(Pw(t,e).map((t=>new v(Iw(t.x),t.y))),e);return{polygon:n.polygon.map((t=>new cp(t.x,t.y))),unwrapped:n.unwrapped}}}function Pw(t,e){return up(t,(t=>{const i=e.pointCoordinate3D(t);t.x=i.x,t.y=i.y}),1/256)}function Iw(t){return t<0?1+t%1:t%1}function Dw(t){return 100*t|0}function Ow(t,e,i,n,r){const s=function(i,n){if(i)return r(i);if(n){t.url&&n.tiles&&t.tiles&&delete t.tiles;const i=F(R(n,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(i.vectorLayers=n.vector_layers,i.vectorLayerIds=i.vectorLayers.map((t=>t.id))),i.tiles=e.canonicalizeTileset(i,t.url),r(null,i)}};return t.url?Et(e.transformRequest(e.normalizeSourceURL(t.url,null,i,n),vt.Source),s):pe.frame((()=>s(null,t)))}class Lw{constructor(t,e,i){this.bounds=ac.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const e=Math.pow(2,t.z),i=Math.floor(Qd(this.bounds.getWest())*e),n=Math.floor(Jd(this.bounds.getNorth())*e),r=Math.ceil(Qd(this.bounds.getEast())*e),s=Math.ceil(Jd(this.bounds.getSouth())*e);return t.x>=i&&t.x<r&&t.y>=n&&t.y<s}}class zw{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.image=new tf({width:t,height:e}),this.positions={},this.uploaded=!1}getDash(t,e){const i=this.getKey(t,e);return this.positions[i]}trim(){const t=this.width,e=this.height=V(this.nextRow);this.image.resize({width:t,height:e})}getKey(t,e){return t.join(",")+e}getDashRanges(t,e,i){const n=[];let r=t.length%2==1?-t[t.length-1]*i:0,s=t[0]*i,o=!0;n.push({left:r,right:s,isDash:o,zeroLength:0===t[0]});let a=t[0];for(let e=1;e<t.length;e++){o=!o;const l=t[e];r=a*i,a+=l,s=a*i,n.push({left:r,right:s,isDash:o,zeroLength:0===l})}return n}addRoundDash(t,e,i){const n=e/2;for(let e=-i;e<=i;e++){const r=this.width*(this.nextRow+i+e);let s=0,o=t[s];for(let a=0;a<this.width;a++){a/o.right>1&&(o=t[++s]);const l=Math.abs(a-o.left),c=Math.abs(a-o.right),h=Math.min(l,c);let u;const d=e/i*(n+1);if(o.isDash){const t=n-Math.abs(d);u=Math.sqrt(h*h+t*t)}else u=n-Math.sqrt(h*h+d*d);this.image.data[r+a]=Math.max(0,Math.min(255,u+128))}}}addRegularDash(t,e){for(let e=t.length-1;e>=0;--e){const i=t[e],n=t[e+1];i.zeroLength?t.splice(e,1):n&&n.isDash===i.isDash&&(n.left=i.left,t.splice(e,1))}const i=t[0],n=t[t.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let s=0,o=t[s];for(let i=0;i<this.width;i++){i/o.right>1&&(o=t[++s]);const n=Math.abs(i-o.left),a=Math.abs(i-o.right),l=Math.min(n,a);this.image.data[r+i]=Math.max(0,Math.min(255,(o.isDash?l:-l)+e+128))}}addDash(t,e){const i=this.getKey(t,e);if(this.positions[i])return this.positions[i];const n="round"===e,r=n?7:0,s=2*r+1;if(this.nextRow+s>this.height)return Y("LineAtlas out of space"),null;0===t.length&&t.push(1);let o=0;for(let e=0;e<t.length;e++)t[e]<0&&(Y("Negative value is found in line dasharray, replacing values with 0"),t[e]=0),o+=t[e];if(0!==o){const i=this.width/o,s=this.getDashRanges(t,this.width,i);n?this.addRoundDash(s,i,r):this.addRegularDash(s,"square"===e?.5*i:0)}const a=this.nextRow+r;this.nextRow+=s;const l={tl:[a,r],br:[o,0]};return this.positions[i]=l,l}}Lo(zw,"LineAtlas");const Rw=1*s_;class Fw{constructor(t){const e={},i=[];for(const n in t){const r=t[n],s=e[n]={};for(const t in r.glyphs){const e=r.glyphs[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const n=e.metrics.localGlyph?Rw:1,o={x:0,y:0,w:e.bitmap.width+2*n,h:e.bitmap.height+2*n};i.push(o),s[t]=o}}const{w:n,h:r}=Qg(i),s=new tf({width:n||1,height:r||1});for(const i in t){const n=t[i];for(const t in n.glyphs){const r=n.glyphs[+t];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const o=e[i][t],a=r.metrics.localGlyph?Rw:1;tf.copy(r.bitmap,s,{x:0,y:0},{x:o.x+a,y:o.y+a},r.bitmap)}}this.image=s,this.positions=e}}Lo(Fw,"GlyphAtlas");class Bw{constructor(t){this.tileID=new qu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=D_(t.tileID.canonical,t.projection),this.projection=t.projection,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster}parse(t,e,i,n,r){this.status="parsing",this.data=t,this.collisionBoxArray=new ll;const s=new pm(Object.keys(t.layers).sort()),o=new tg(this.tileID,this.promoteId);o.bucketLayerIDs=[];const a={},l=new zw(256,256),c={featureIndex:o,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:i,brightness:this.brightness},h=e.familiesBySource[this.source];for(const e in h){const n=t.layers[e];if(!n)continue;let r=!1,l=!1,u=!1;for(const t of h[e])"symbol"===t[0].type?r=!0:l=!0,t[0].is3D()&&"model"!==t[0].type&&(u=!0);if(this.extraShadowCaster&&!u)continue;if(!0===this.isSymbolTile&&!r)continue;if(!1===this.isSymbolTile&&!l)continue;1===n.version&&Y(`Vector tile source "${this.source}" layer "${e}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const d=s.encode(e),p=[];for(let t=0;t<n.length;t++){const i=n.feature(t),r=o.getId(i,e);p.push({feature:i,id:r,index:t,sourceLayerIndex:d})}for(const t of h[e]){const e=t[0];(!this.extraShadowCaster||e.is3D()&&"model"!==e.type)&&(void 0!==this.isSymbolTile&&"symbol"===e.type!==this.isSymbolTile||e.minzoom&&this.zoom<Math.floor(e.minzoom)||e.maxzoom&&this.zoom>=e.maxzoom||"none"!==e.visibility&&(Nw(t,this.zoom,c.brightness,i),(a[e.id]=e.createBucket({index:o.bucketLayerIDs.length,layers:t,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:d,sourceID:this.source,projection:this.projection.spec})).populate(p,c,this.tileID.canonical,this.tileTransform),o.bucketLayerIDs.push(t.map((t=>t.id)))))}}let u,d,p,f;l.trim();const m={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=()=>{if(u)return this.status="done",r(u);if(this.extraShadowCaster)this.status="done",r(null,{buckets:z(a).filter((t=>!t.isEmpty())),featureIndex:o,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:c.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(d&&p&&f){const t=new Fw(d),e=new e_(p,f);for(const n in a){const r=a[n];r instanceof yy?(Nw(r.layers,this.zoom,c.brightness,i),x_(r,d,t.positions,p,e.iconPositions,this.showCollisionBoxes,i,this.tileID.canonical,this.tileZoom,this.projection,this.brightness)):r.hasPattern&&(r instanceof Ty||r instanceof $f||r instanceof xx)&&(Nw(r.layers,this.zoom,c.brightness,i),r.addFeatures(c,this.tileID.canonical,e.patternPositions,i,this.tileTransform,this.brightness))}this.status="done",r(null,{buckets:z(a).filter((t=>!t.isEmpty())),featureIndex:o,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:l,imageAtlas:e,brightness:c.brightness})}};if(!this.extraShadowCaster){const t=q(c.glyphDependencies,(t=>Object.keys(t).map(Number)));Object.keys(t).length?n.send("getGlyphs",{uid:this.uid,stacks:t,scope:this.scope},((t,e)=>{u||(u=t,d=e,g())}),void 0,!1,m):d={};const e=Object.keys(c.iconDependencies);e.length?n.send("getImages",{icons:e,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},((t,e)=>{u||(u=t,p=e,g())}),void 0,!1,m):p={};const i=Object.keys(c.patternDependencies);i.length?n.send("getImages",{icons:i,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},((t,e)=>{u||(u=t,f=e,g())}),void 0,!1,m):f={}}g()}}function Nw(t,e,i,n){const r=new oa(e,{brightness:i});for(const e of t)e.recalculate(r,n)}class jw{constructor(t){this.entries={},this.scheduler=t}request(t,e,i,n){const r=this.entries[t]=this.entries[t]||{callbacks:[]};if(r.result){const[t,i]=r.result;return this.scheduler?this.scheduler.add((()=>{n(t,i)}),e):n(t,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i(((i,n)=>{r.result=[i,n];for(const t of r.callbacks)this.scheduler?this.scheduler.add((()=>{t(i,n)}),e):t(i,n);setTimeout((()=>delete this.entries[t]),3e3)}))),()=>{r.result||(r.callbacks=r.callbacks.filter((t=>t!==n)),r.callbacks.length||(r.cancel(),delete this.entries[t]))}}}function Vw(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},(e=>{const n=St(t.request,((t,n,r,s)=>{t?e(t):n&&e(null,{vectorTile:i?void 0:new hm(new Rm(n)),rawData:n,cacheControl:r,expires:s})}));return()=>{n.cancel(),e()}}),e)}class Uw extends Ie{constructor(t,e,i,n){if(super(),this.id=t,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,R(this,F(e,["url","scheme","tileSize","promoteId"])),this._options=R({type:"vector"},e),this._collectResourceTiming=!!e.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n),this._tileWorkers={},this._deduped=new jw}load(t){this._loaded=!1,this.fire(new ke("dataloading",{dataType:"source"}));const e=Array.isArray(this.map._language)?this.map._language.join():this.map._language,i=this.map._worldview;this._tileJSONRequest=Ow(this._options,this.map._requestManager,e,i,((n,r)=>{this._tileJSONRequest=null,this._loaded=!0,n?(e&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${e}`),i&&2!==i.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${i}`),this.fire(new Pe(n))):r&&(R(this,r),r.bounds&&(this.tileBounds=new Lw(r.bounds,this.minzoom,this.maxzoom)),Ht(r.tiles,this.map._requestManager._customAccessToken),this.fire(new ke("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new ke("data",{dataType:"source",sourceDataType:"content"}))),t&&t(n)}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest();const t=xa(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return R({},this._options)}loadTile(t,e){const i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),n={request:this.map._requestManager.transformRequest(i,vt.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:pe.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster};if(n.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",n,r.bind(this));else if(t.actor=this._tileWorkers[i]=this._tileWorkers[i]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",n,r.bind(this),void 0,!0);else{const e=Vw.call({deduped:this._deduped},n,((e,i)=>{e||!i?r.call(this,e):(n.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},t.actor&&t.actor.send("loadTile",n,r.bind(this),void 0,!0))}),!0);t.request={cancel:e}}function r(i,n){return delete t.request,t.aborted?e(null):i&&404!==i.status?e(i):(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),yt(this.dispatcher),e(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(t){t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope}),t.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class $w extends Ie{constructor(t,e,i,n){super(),this.id=t,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=R({type:"raster"},e),R(this,F(e,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new ke("dataloading",{dataType:"source"})),this._tileJSONRequest=Ow(this._options,this.map._requestManager,null,null,((e,i)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new Pe(e)):i&&(R(this,i),i.bounds&&(this.tileBounds=new Lw(i.bounds,this.minzoom,this.maxzoom)),Ht(i.tiles),this.fire(new ke("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new ke("data",{dataType:"source",sourceDataType:"content"}))),t&&t(e)}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest();const t=xa(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return R({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,e){const i=pe.devicePixelRatio>=2,n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),i,this.tileSize);t.request=kt(this.map._requestManager.transformRequest(n,vt.Tile),((i,n,r,s)=>(delete t.request,t.aborted?(t.state="unloaded",e(null)):i?(t.state="errored",e(i)):n?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:r,expires:s}),t.setTexture(n,this.map.painter),t.state="loaded",yt(this.dispatcher),void e(null)):e(null))))}abortTile(t,e){t.request&&(t.request.cancel(),delete t.request),e()}unloadTile(t,e){t.texture&&t.texture instanceof My?(t.destroy(!0),t.texture&&t.texture instanceof My&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),e()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Hw(){return null!=bC.workerClass?new bC.workerClass:new e.Worker(bC.workerUrl)}const qw="mapboxgl_preloaded_worker_pool";class Ww{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Ww.workerCount;)this.workers.push(new Hw);return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.workers&&0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[qw]}numActive(){return Object.keys(this.active).length}}let Gw;function Zw(){return Gw||(Gw=new Ww),Gw}Ww.workerCount=2;let Yw,Xw,Kw,Qw=null;function Jw(){return tt()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:Xw||s.DRACO_URL}const tE=5123,eE=5126,iE={5120:Int8Array,5121:Uint8Array,5122:Int16Array,[tE]:Uint16Array,5125:Uint32Array,[eE]:Float32Array},nE={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",[tE]:"DT_UINT16",5125:"DT_UINT32",[eE]:"DT_FLOAT32"},rE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function sE(t,e,i){const n=i.json.bufferViews.length,r=i.buffers.length;e.bufferView=n,i.json.bufferViews[n]={buffer:r,byteLength:t.byteLength},i.buffers[r]=t}const oE="KHR_draco_mesh_compression";function aE(t,e){const i=t.extensions&&t.extensions[oE];if(!i)return;const n=new Kw.Decoder,r=dE(e,i.bufferView),s=new Kw.Mesh;if(!n.DecodeArrayToMesh(r,r.byteLength,s))throw new Error("Failed to decode Draco mesh");const o=e.json.accessors[t.indices],a=iE[o.componentType],l=o.count*a.BYTES_PER_ELEMENT,c=Kw._malloc(l);a===Uint16Array?n.GetTrianglesUInt16Array(s,l,c):n.GetTrianglesUInt32Array(s,l,c),sE(Kw.memory.buffer.slice(c,c+l),o,e),Kw._free(c);for(const r of Object.keys(i.attributes)){const o=n.GetAttributeByUniqueId(s,i.attributes[r]),a=e.json.accessors[t.attributes[r]],l=nE[a.componentType],c=a.count*rE[a.type]*iE[a.componentType].BYTES_PER_ELEMENT,h=Kw._malloc(c);n.GetAttributeDataArrayForAllPoints(s,o,Kw[l],c,h),sE(Kw.memory.buffer.slice(h,h+c),a,e),Kw._free(h)}n.destroy(),s.destroy(),delete t.extensions[oE]}const lE=1179937895,cE=new TextDecoder("utf8");function hE(t,e){return new URL(t,e).href}function uE(t,e,i,n){return fetch(hE(t.uri,n)).then((t=>t.arrayBuffer())).then((t=>{e.buffers[i]=t}))}function dE(t,e){const i=t.json.bufferViews[e];return new Uint8Array(t.buffers[i.buffer],i.byteOffset||0,i.byteLength)}function pE(t,i,n,r){if(t.uri){const s=hE(t.uri,r);return fetch(s).then((t=>t.blob())).then((t=>e.createImageBitmap(t))).then((t=>{i.images[n]=t}))}if(void 0!==t.bufferView){const r=dE(i,t.bufferView),s=new e.Blob([r],{type:t.mimeType});return e.createImageBitmap(s).then((t=>{i.images[n]=t}))}}function fE(t,e=0,i){const n={json:null,images:[],buffers:[]};if(new Uint32Array(t,e,1)[0]===lE){const i=new Uint32Array(t,e);let r=2;const s=(i[r++]>>2)-3,o=i[r++]>>2;if(r++,n.json=JSON.parse(cE.decode(i.subarray(r,r+o))),r+=o,r<s){const s=i[r++];r++;const o=e+(r<<2);n.buffers[0]=t.slice(o,o+s)}}else n.json=JSON.parse(cE.decode(new Uint8Array(t,e)));const{buffers:r,images:s,meshes:o,extensionsUsed:a}=n.json;let l=Promise.resolve();if(r){const t=[];for(let e=0;e<r.length;e++){const s=r[e];s.uri?t.push(uE(s,n,e,i)):n.buffers[e]||(n.buffers[e]=null)}l=Promise.all(t)}return l.then((()=>{const t=[],e=a&&a.includes(oE);if(e&&t.push(function(){if(!Kw)return Yw||(Yw=function(t){let e,i=null;function n(){e=new Uint8Array(i.buffer)}function r(){throw new Error("Unexpected Draco error.")}const s={a:{a:r,d:function(t,i,n){return e.copyWithin(t,i,i+n)},c:function(t){const r=e.length,s=Math.max(t>>>0,Math.ceil(1.2*r)),o=Math.ceil((s-r)/65536);try{return i.grow(o),n(),!0}catch(t){return!1}},b:r}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,s):t.then((t=>t.arrayBuffer())).then((t=>WebAssembly.instantiate(t,s)))).then((t=>{const{Rb:r,Qb:s,P:o,T:a,X:l,Ja:c,La:h,Qa:u,Va:d,Wa:p,eb:f,jb:m,f:g,e:_,yb:y,zb:v,Ab:b,Bb:x,Db:w,Gb:E}=t.instance.exports;i=_;const S=(()=>{let t=0,i=0,n=0,o=0;return a=>{n&&(r(o),r(t),i+=n,n=t=0),t||(i+=128,t=s(i));const l=a.length+7&-8;let c=t;l>=i&&(n=l,c=o=s(l));for(let t=0;t<a.length;t++)e[c+t]=a[t];return c}})();return n(),g(),{memory:_,_free:r,_malloc:s,Mesh:class{constructor(){this.ptr=o()}destroy(){a(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){m(this.ptr)}DecodeArrayToMesh(t,e,i){const n=S(t),r=h(this.ptr,n,e,i.ptr);return!!l(r)}GetAttributeByUniqueId(t,e){return{ptr:u(this.ptr,t.ptr,e)}}GetTrianglesUInt16Array(t,e,i){d(this.ptr,t.ptr,e,i)}GetTrianglesUInt32Array(t,e,i){p(this.ptr,t.ptr,e,i)}GetAttributeDataArrayForAllPoints(t,e,i,n,r){f(this.ptr,t.ptr,e.ptr,i,n,r)}},DT_INT8:y(),DT_UINT8:v(),DT_INT16:b(),DT_UINT16:x(),DT_UINT32:w(),DT_FLOAT32:E()}}))}(fetch(Jw())),Yw.then((t=>{Kw=t,Yw=void 0})))}()),s)for(let e=0;e<s.length;e++)t.push(pE(s[e],n,e,i));return(t.length?Promise.all(t):Promise.resolve()).then((()=>{if(e&&o)for(const{primitives:t}of o)for(const e of t)aE(e,n);return n}))}))}function mE(t){return fetch(t).then((t=>t.arrayBuffer())).then((e=>fE(e,0,t)))}class gE{constructor(t,e,i){if(this.triangleCount=e.length/3,this.min=new v(0,0),this.max=new v(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===t.length||0===i)return;const n=t.map((t=>t.x)),r=t.map((t=>t.y));this.min=new v(Math.min(...n),Math.min(...r)),this.max=new v(Math.max(...n),Math.max(...r));const s=this.max.sub(this.min);s.x=Math.max(s.x,1),s.y=Math.max(s.y,1);const o=Math.max(s.x,s.y)/i;this.cellsX=Math.max(1,Math.ceil(s.x/o)),this.cellsY=Math.max(1,Math.ceil(s.y/o)),this.xScale=1/o,this.yScale=1/o;const a=[];for(let i=0;i<this.triangleCount;i++){const n=t[e[3*i+0]].sub(this.min),r=t[e[3*i+1]].sub(this.min),s=t[e[3*i+2]].sub(this.min),l=_E(Math.floor(Math.min(n.x,r.x,s.x)),this.xScale,this.cellsX),c=_E(Math.floor(Math.max(n.x,r.x,s.x)),this.xScale,this.cellsX),h=_E(Math.floor(Math.min(n.y,r.y,s.y)),this.yScale,this.cellsY),u=_E(Math.floor(Math.max(n.y,r.y,s.y)),this.yScale,this.cellsY),d=new v(0,0),p=new v(0,0),f=new v(0,0),m=new v(0,0);for(let t=h;t<=u;++t){d.y=p.y=t*o,f.y=m.y=(t+1)*o;for(let e=l;e<=c;++e)d.x=f.x=e*o,p.x=m.x=(e+1)*o,(zp(n,r,s,d,p,m)||zp(n,r,s,d,m,f))&&a.push({cellIdx:t*this.cellsX+e,triIdx:i})}}if(0===a.length)return;a.sort(((t,e)=>t.cellIdx-e.cellIdx||t.triIdx-e.triIdx));let l=0;for(;l<a.length;){const t=a[l].cellIdx,e={start:this.payload.length,len:0};for(;l<a.length&&a[l].cellIdx===t;)++e.len,this.payload.push(a[l++].triIdx);this.cells[t]=e}}query(t,e,i){if(0===this.triangleCount||0===this.cells.length)return;if(t.x>this.max.x||this.min.x>e.x)return;if(t.y>this.max.y||this.min.y>e.y)return;this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8)));for(let t=0;t<this.lookup.length;t++)this.lookup[t]=0;const n=_E(t.x-this.min.x,this.xScale,this.cellsX),r=_E(e.x-this.min.x,this.xScale,this.cellsX),s=_E(t.y-this.min.y,this.yScale,this.cellsY),o=_E(e.y-this.min.y,this.yScale,this.cellsY);for(let t=s;t<=o;t++)for(let e=n;e<=r;e++){const n=this.cells[t*this.cellsX+e];if(n)for(let t=0;t<n.len;t++){const e=this.payload[n.start+t],r=Math.floor(e/8),s=1<<e%8;if(!(this.lookup[r]&s)&&(this.lookup[r]|=s,i.push(e),i.length===this.triangleCount))return}}}}function _E(t,e,i){return Math.max(0,Math.min(i-1,Math.floor(t*e)))}function yE(t,e){const i=t.json.bufferViews[e.bufferView];return new(0,iE[e.componentType])(t.buffers[i.buffer],(e.byteOffset||0)+(i.byteOffset||0),e.count*rE[e.type])}function vE(t,e,i){const n=t.indices,r=t.attributes,s={};s.indexArray=new Za;const o=e.json.accessors[n],a=o.count/3;s.indexArray.reserve(a);const l=yE(e,o);for(let t=0;t<a;t++)s.indexArray.emplaceBack(l[3*t],l[3*t+1],l[3*t+2]);s.indexArray._trim(),s.vertexArray=new il;const c=e.json.accessors[r.POSITION];s.vertexArray.reserve(c.count);const h=yE(e,c);for(let t=0;t<c.count;t++)s.vertexArray.emplaceBack(h[3*t],h[3*t+1],h[3*t+2]);if(s.vertexArray._trim(),s.aabb=new ed(c.min,c.max),s.centroid=function(t,e){const i=[0,0,0],n=t.length;if(n>0){for(let r=0;r<n;r++){const n=3*t[r];i[0]+=e[n],i[1]+=e[n+1],i[2]+=e[n+2]}i[0]/=n,i[1]/=n,i[2]/=n}return i}(l,h),void 0!==r.COLOR_0){const t=e.json.accessors[r.COLOR_0],i=rE[t.type];if(t.componentType===eE){s.colorArray=3===i?new il:new Ra,s.colorArray.reserve(t.count);const n=yE(e,t);if(3===i)for(let e=0;e<t.count;e++)s.colorArray.emplaceBack(n[3*e],n[3*e+1],n[3*e+2]);else for(let e=0;e<t.count;e++)s.colorArray.emplaceBack(n[4*e],n[4*e+1],n[4*e+2],n[4*e+3]);s.colorArray._trim()}else if(t.componentType===tE&&4===i){s.colorArray=new Ra,s.colorArray.resize(t.count);const i=yE(e,t),n=1/65535,r=s.colorArray.float32;for(let t=0;t<4*i.length;++t)r[t]=i[t]*n}else Y(`glTF color buffer parsing for accessor ${JSON.stringify(t)} is not supported`)}if(void 0!==r.NORMAL){s.normalArray=new il;const t=e.json.accessors[r.NORMAL];s.normalArray.reserve(t.count);const i=yE(e,t);for(let e=0;e<t.count;e++)s.normalArray.emplaceBack(i[3*e],i[3*e+1],i[3*e+2]);s.normalArray._trim()}if(void 0!==r.TEXCOORD_0&&i.length>0){s.texcoordArray=new nl;const t=e.json.accessors[r.TEXCOORD_0];s.texcoordArray.reserve(t.count);const i=yE(e,t);for(let e=0;e<t.count;e++)s.texcoordArray.emplaceBack(i[2*e],i[2*e+1]);s.texcoordArray._trim()}const u=t.material;return s.material=function(t,e){const{emissiveFactor:i=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:r=.5,normalTexture:s,occlusionTexture:o,emissiveTexture:a,doubleSided:l}=t,{baseColorFactor:c=[1,1,1,1],metallicFactor:h=1,roughnessFactor:u=1,baseColorTexture:d,metallicRoughnessTexture:p}=t.pbrMetallicRoughness||{};return{pbrMetallicRoughness:{baseColorFactor:new ui(...c),metallicFactor:h,roughnessFactor:u,baseColorTexture:d?e[d.index]:void 0,metallicRoughnessTexture:p?e[p.index]:void 0},doubleSided:l,emissiveFactor:i,alphaMode:n,alphaCutoff:r,normalTexture:s?e[s.index]:void 0,occlusionTexture:o?e[o.index]:void 0,emissionTexture:a?e[a.index]:void 0,defined:void 0===t.defined}}(void 0!==u?e.json.materials[u]:{defined:!1},i),void 0!==r._FEATURE_RGBA4444&&(s.featureData=new Uint32Array(yE(e,e.json.accessors[r._FEATURE_RGBA4444]).buffer)),s}function bE(t,e,i){const{matrix:n,rotation:r,translation:s,scale:o,mesh:a,extras:l,children:c}=t,h={};if(h.matrix=n||Au.fromRotationTranslationScale([],r||[0,0,0,1],s||[0,0,0],o||[1,1,1]),void 0!==a){h.meshes=i[a];const t=h.anchor=[0,0];for(const e of h.meshes){const{min:i,max:n}=e.aabb;t[0]+=i[0]+n[0],t[1]+=i[1]+n[1]}t[0]=Math.floor(t[0]/h.meshes.length/2),t[1]=Math.floor(t[1]/h.meshes.length/2)}if(l&&(l.id&&(h.id=l.id),l.lights&&(h.lights=function(t){if(!t.length)return[];const e=function(t){const e=atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.codePointAt(t);return i}(t),i=[],n=e.length/24,r=new Uint16Array(e.buffer),s=new Float32Array(e.buffer);for(let t=0;t<n;t++){const e=r[2*t*6]/30,n=r[2*t*6+1]/30,o=r[2*t*6+10]/100,a=s[6*t+1],l=s[6*t+2],c=s[6*t+3],h=s[6*t+4],u=c-a,d=h-l,p=Math.hypot(u,d);i.push({pos:[a+.5*u,l+.5*d,n],normal:[d/p,-u/p,0],width:p,height:e,depth:o,points:[a,l,c,h]})}return i}(l.lights))),c){const t=[];for(const n of c)t.push(bE(e.json.nodes[n],e,i));h.children=t}return h}function xE(t){if(0===t.vertices.length||0===t.indices.length)return null;const[e,i]=[t.vertices[0].clone(),t.vertices[0].clone()];for(let n=1;n<t.vertices.length;++n){const r=t.vertices[n];e.x=Math.min(e.x,r.x),e.y=Math.min(e.y,r.y),i.x=Math.max(i.x,r.x),i.y=Math.max(i.y,r.y)}const n=Math.ceil(Math.max(i.x-e.x,i.y-e.y)/256),r=Math.max(8,n),s=new gE(t.vertices,t.indices,r);return{vertices:t.vertices,indices:t.indices,grid:s,min:e,max:i}}function wE(t){if(!t.extras||!t.extras.ground)return null;const e=t.extras.ground;if(!e||!Array.isArray(e)||0===e.length)return null;const i=e[0];if(!i||!Array.isArray(i)||0===i.length)return null;const n=[];for(const t of i){if(!Array.isArray(t)||2!==t.length)continue;const e=t[0],i=t[1];"number"==typeof e&&"number"==typeof i&&n.push(new v(e,i))}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let r=0;for(let t=0;t<n.length;t++){const e=n[t],i=n[(t+1)%n.length],s=n[(t+2)%n.length];r+=(e.x-i.x)*(s.y-i.y)-(s.x-i.x)*(e.y-i.y)}r>0&&n.reverse();const s=Bf(n.flatMap((t=>[t.x,t.y])),[]);return 0===s.length?null:{vertices:n,indices:s}}function EE(t){const e=[],i=[];let n=0;for(const r of t){n=e.length;const t=r.vertexArray.float32,s=r.indexArray.uint16;for(let i=0;i<r.vertexArray.length;i++)e.push(new v(t[3*i+0],t[3*i+1]));for(let t=0;t<3*r.indexArray.length;t++)i.push(s[t]+n)}if(i.length%3!=0)return null;for(let t=0;t<i.length;t+=3){const n=e[i[t+0]],r=e[i[t+1]],s=e[i[t+2]];(n.x-r.x)*(s.y-r.y)-(s.x-r.x)*(n.y-r.y)>0&&([i[t+1],i[t+2]]=[i[t+2],i[t+1]])}return{vertices:e,indices:i}}function SE(t){const i=function(t,i){const n=[],r=e.WebGL2RenderingContext;if(t.json.textures)for(const e of t.json.textures){const s={magFilter:r.LINEAR,minFilter:r.NEAREST,wrapS:r.REPEAT,wrapT:r.REPEAT};void 0!==e.sampler&&Object.assign(s,t.json.samplers[e.sampler]),n.push({image:i[e.source],sampler:s,uploaded:!1})}return n}(t,t.images),n=function(t,e){const i=[];for(const n of t.json.meshes){const r=[];for(const i of n.primitives)r.push(vE(i,t,e));i.push(r)}return i}(t,i),{scenes:r,scene:s,nodes:o}=t.json,a=r?r[s||0].nodes:o,l=[];for(const e of a)l.push(bE(o[e],t,n));return function(t,e,i){const n={},r=new Set;for(let s=0;s<t.length;s++){const t=i[e[s]];if(!t.extras)continue;const o=t.extras["mapbox:footprint:version"],a=t.extras["mapbox:footprint:id"];(o||a)&&r.add(s),"1.0.0"===o&&a&&(n[a]=s)}for(let s=0;s<t.length;s++){if(r.has(s))continue;const o=t[s],a=i[e[s]];if(!a.extras)continue;let l=null;o.id in n&&(l=EE(t[n[o.id]].meshes)),l||(l=wE(a)),l&&(o.footprint=xE(l))}if(r.size>0){const e=Array.from(r.values()).sort(((t,e)=>t-e));for(let i=e.length-1;i>=0;i--)t.splice(e[i],1)}}(l,a,t.json.nodes),l}function TE(t){t.heightmap=new Float32Array(4096),t.heightmap.fill(-1);const e=t.vertexArray.float32,i=t.aabb.min[0]-1,n=t.aabb.min[1]-1,r=Cb/(t.aabb.max[0]-i+2),s=Cb/(t.aabb.max[1]-n+2);for(let o=0;o<e.length;o+=3){const a=e[o+2],l=(e[o+0]-i)*r|0,c=(e[o+1]-n)*s|0;a>t.heightmap[c*Cb+l]&&(t.heightmap[c*Cb+l]=a)}}function ME(t,e){const i={};i.indexArray=new Za,i.indexArray.reserve(4*t.length),i.vertexArray=new il,i.vertexArray.reserve(10*t.length),i.colorArray=new Ra,i.vertexArray.reserve(10*t.length);let n=0;for(const r of t){const t=Math.min(10,Math.max(4,1.3*r.height))*e,s=[-r.normal[1],r.normal[0],0],o=Math.min(.29,.1*r.width/r.depth),a=r.width-2*r.depth*e*(o+.01),l=Ou.scaleAndAdd([],r.pos,s,a/2),c=Ou.scaleAndAdd([],r.pos,s,-a/2),h=[l[0],l[1],l[2]+r.height],u=[c[0],c[1],c[2]+r.height],d=Ou.scaleAndAdd([],r.normal,s,o);Ou.scale(d,d,t);const p=Ou.scaleAndAdd([],r.normal,s,-o);Ou.scale(p,p,t),Ou.add(d,l,d),Ou.add(p,c,p),l[2]+=.1,c[2]+=.1,i.vertexArray.emplaceBack(d[0],d[1],d[2]),i.vertexArray.emplaceBack(p[0],p[1],p[2]),i.vertexArray.emplaceBack(l[0],l[1],l[2]),i.vertexArray.emplaceBack(c[0],c[1],c[2]),i.vertexArray.emplaceBack(h[0],h[1],h[2]),i.vertexArray.emplaceBack(u[0],u[1],u[2]),i.vertexArray.emplaceBack(l[0],l[1],l[2]),i.vertexArray.emplaceBack(c[0],c[1],c[2]),i.vertexArray.emplaceBack(d[0],d[1],d[2]),i.vertexArray.emplaceBack(p[0],p[1],p[2]);const f=a/t/2;i.colorArray.emplaceBack(-f-o,-1,f,.8),i.colorArray.emplaceBack(f+o,-1,f,.8),i.colorArray.emplaceBack(-f,0,f,1.3),i.colorArray.emplaceBack(f,0,f,1.3),i.colorArray.emplaceBack(f+o,-.8,f,.7),i.colorArray.emplaceBack(f+o,-.8,f,.7),i.colorArray.emplaceBack(0,0,f,1.3),i.colorArray.emplaceBack(0,0,f,1.3),i.colorArray.emplaceBack(f+o,-1.2,f,.8),i.colorArray.emplaceBack(f+o,-1.2,f,.8),i.indexArray.emplaceBack(6+n,4+n,8+n),i.indexArray.emplaceBack(7+n,9+n,5+n),i.indexArray.emplaceBack(0+n,1+n,2+n),i.indexArray.emplaceBack(1+n,3+n,2+n),n+=10}const r={defined:!0,emissiveFactor:[0,0,0]},s={};return s.baseColorFactor=ui.white,r.pbrMetallicRoughness=s,i.material=r,i.aabb=new ed([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),i}Lo(gE,"TriangleGridIndex");const AE={vector:Uw,raster:$w,"raster-dem":class extends $w{constructor(t,e,i,n){super(t,e,i,n),this.type="raster-dem",this.maxzoom=22,this._options=R({type:"raster-dem"},e),this.encoding=e.encoding||"mapbox"}loadTile(t,i){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(e,n){e&&(t.state="errored",i(e)),n&&(t.dem=n,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",i(null))}t.request=kt(this.map._requestManager.transformRequest(n,vt.Tile),function(n,s,o,a){if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(n)t.state="errored",i(n);else if(s){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:a});const i=e.ImageBitmap&&s instanceof e.ImageBitmap&&de(),n=1-(s.width-((l=s.width)<=1?1:Math.pow(2,Math.floor(Math.log(l)/Math.LN2))))/2;n<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const c=i?s:pe.getImageData(s,n),h={uid:t.uid,coord:t.tileID,source:this.id,scope:this.scope,rawImageData:c,encoding:this.encoding,padding:n};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",h,r.bind(this),void 0,!0))}var l}.bind(this))}_getNeighboringTiles(t){const e=t.canonical,i=Math.pow(2,e.z),n=(e.x-1+i)%i,r=0===e.x?t.wrap-1:t.wrap,s=(e.x+1+i)%i,o=e.x+1===i?t.wrap+1:t.wrap,a={};return a[new qu(t.overscaledZ,r,e.z,n,e.y).key]={backfilled:!1},a[new qu(t.overscaledZ,o,e.z,s,e.y).key]={backfilled:!1},e.y>0&&(a[new qu(t.overscaledZ,r,e.z,n,e.y-1).key]={backfilled:!1},a[new qu(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},a[new qu(t.overscaledZ,o,e.z,s,e.y-1).key]={backfilled:!1}),e.y+1<i&&(a[new qu(t.overscaledZ,r,e.z,n,e.y+1).key]={backfilled:!1},a[new qu(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},a[new qu(t.overscaledZ,o,e.z,s,e.y+1).key]={backfilled:!1}),a}},geojson:class extends Ie{constructor(t,e,i,n){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(n),this._data=e.data,this._options=R({},e),this._collectResourceTiming=e.collectResourceTiming,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type),e.attribution&&(this.attribution=e.attribution),this.promoteId=e.promoteId;const r=un/this.tileSize;this.workerOptions=R({source:this.id,scope:this.scope,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*r,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*r,extent:un,maxZoom:this.maxzoom,lineMetrics:e.lineMetrics||!1,generateId:e.generateId||!1},superclusterOptions:{maxZoom:void 0!==e.clusterMaxZoom?e.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,e.clusterMinPoints||2),extent:un,radius:(void 0!==e.clusterRadius?e.clusterRadius:50)*r,log:!1,generateId:e.generateId||!1},clusterProperties:e.clusterProperties,filter:e.filter},e.workerOptions)}onAdd(t){this.map=t,this.setData(this._data)}setData(t){return this._data=t,this._updateWorkerData(),this}getClusterExpansionZoom(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id,scope:this.scope},e),this}getClusterChildren(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id,scope:this.scope},e),this}getClusterLeaves(t,e,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:t,limit:e,offset:i},n),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new ke("dataloading",{dataType:"source"})),this._loaded=!1;const t=R({},this.workerOptions);t.scope=this.scope;const e=this._data;"string"==typeof e?(t.request=this.map._requestManager.transformRequest(pe.resolveURL(e),vt.Source),t.request.collectResourceTiming=this._collectResourceTiming):t.data=JSON.stringify(e),this._pendingLoad=this.actor.send(`${this.type}.loadData`,t,((t,e)=>{if(this._loaded=!0,this._pendingLoad=null,t)this.fire(new Pe(t));else{const t={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&e&&e.resourceTiming&&e.resourceTiming[this.id]&&(t.resourceTiming=e.resourceTiming[this.id]),this.fire(new ke("data",t)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(t,e){const i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const n={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,scope:this.scope,pixelRatio:pe.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0};t.request=this.actor.send(i,n,((n,r)=>(delete t.request,t.destroy(),t.aborted?e(null):n?e(n):(t.loadVectorData(r,this.map.painter,"reloadTile"===i),e(null)))),void 0,"loadTile"===i)}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope}),t.destroy()}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return R({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Jx{constructor(t,e,i,n){super(t,e,i,n),this.roundZoom=!0,this.type="video",this.options=e}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,vt.Source).url);!function(t,i){const n=e.document.createElement("video");n.muted=!0,n.onloadstart=function(){i(null,n)};for(let i=0;i<t.length;i++){const r=e.document.createElement("source");Tt(t[i])||(n.crossOrigin="Anonymous"),r.src=t[i],n.appendChild(r)}}(this.urls,((t,e)=>{this._loaded=!0,t?this.fire(new Pe(t)):e&&(this.video=e,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const e=this.video.seekable;t<e.start(0)||t>e.end(0)?this.fire(new Pe(new Oe(`sources.${this.id}`,null,`Playback for this video can be set only between the ${e.start(0)} and ${e.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,e=t.gl;this.texture?this.video.paused||(this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.video)):(this.texture=new My(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Jx,model:class extends Ie{constructor(t,e,i,n){super(),this.id=t,this.type="model",this.models=[],this._loaded=!1,this._options=e}load(){const t=[];for(const e in this._options.models){const i=this._options.models[e],n=mE(this.map._requestManager.transformRequest(i.uri,vt.Model).url).then((t=>{if(!t)return;const n=SE(t),r=new Pb(e,i.position,i.orientation,n);r.computeBoundsAndApplyParent(),this.models.push(r)})).catch((t=>{this.fire(new Pe(new Error(`Could not load model ${e} from ${i.uri}: ${t.message}`)))}));t.push(n)}return Promise.allSettled(t).then((()=>{this._loaded=!0,this.fire(new ke("data",{dataType:"source",sourceDataType:"metadata"}))})).catch((t=>{this.fire(new Pe(new Error(`Could not load models: ${t.message}`)))}))}onAdd(t){this.map=t,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(t,e){}serialize(){return{type:"model"}}},"batched-model":class extends Ie{constructor(t,e,i,n){super(),this.type="batched-model",this.id=t,this.tileSize=512,this._options=e,this.tiles=this._options.tiles,this.maxzoom=e.maxzoom||19,this.minzoom=e.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(n)}onAdd(t){this.map=t,this.load()}load(t){this._loaded=!1,this.fire(new ke("dataloading",{dataType:"source"}));const e=Array.isArray(this.map._language)?this.map._language.join():this.map._language,i=this.map._worldview;this._tileJSONRequest=Ow(this._options,this.map._requestManager,e,i,((n,r)=>{this._tileJSONRequest=null,this._loaded=!0,n?(e&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${e}`),i&&2!==i.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${i}`),this.fire(new Pe(n))):r&&(R(this,r),r.bounds&&(this.tileBounds=new Lw(r.bounds,this.minzoom,this.maxzoom)),Ht(r.tiles,this.map._requestManager._customAccessToken),this.fire(new ke("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new ke("data",{dataType:"source",sourceDataType:"content"}))),t&&t(n)}))}hasTransition(){return!1}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loaded(){return this._loaded}loadTile(t,e){const i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),n={request:this.map._requestManager.transformRequest(i,vt.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=e;else{if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",n,r.bind(this))}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",n,r.bind(this),void 0,!0);function r(i,n){return t.aborted?e(null):i&&404!==i.status?e(i):(n&&(n.resourceTiming&&(t.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&t.setExpiryData(n),t.buckets={...t.buckets,...n.buckets}),t.state="loaded",void e(null))}}serialize(){return R({},this._options)}},canvas:class extends Jx{constructor(t,i,n,r){super(t,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new Pe(new Oe(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Pe(new Oe(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new Pe(new Oe(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof e.HTMLCanvasElement||this.fire(new Pe(new Oe(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Pe(new Oe(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.HTMLCanvasElement?this.options.canvas:e.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new Pe(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const e=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof Ay||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new My(e,this.canvas,e.gl.RGBA,{premultiply:!0}),this._prepareData(e)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}},custom:class extends Ie{constructor(t,e,i,n){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=i,this._implementation=e,this.setEventedParent(n),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new Pe(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new Pe(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Lw(this._implementation.bounds,this.minzoom,this.maxzoom)),e.update=this._update.bind(this),e.clearTiles=this._clearTiles.bind(this),e.coveringTiles=this._coveringTiles.bind(this),R(this,F(e,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return F(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new ke("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new ke("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this._map=t,this._loaded=!1,this.fire(new ke("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(t){this._implementation.onRemove&&this._implementation.onRemove(t)}hasTile(t){if(this._implementation.hasTile){const{x:e,y:i,z:n}=t.canonical;return this._implementation.hasTile({x:e,y:i,z:n})}return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,i){const{x:n,y:r,z:s}=t.tileID.canonical,o=new e.AbortController;t.request=Promise.resolve(this._implementation.loadTile({x:n,y:r,z:s},{signal:o.signal})).then(function(n){return delete t.request,t.aborted?(t.state="unloaded",i(null)):void 0===n?(t.state="errored",i(null)):null===n?(this.loadTileData(t,{width:this.tileSize,height:this.tileSize,data:null}),t.state="loaded",i(null)):function(t){return t instanceof e.ImageData||t instanceof e.HTMLCanvasElement||t instanceof e.ImageBitmap||t instanceof e.HTMLImageElement}(n)?(this.loadTileData(t,n),t.state="loaded",void i(null)):(t.state="errored",i(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((e=>{20!==e.code&&(t.state="errored",i(e))})),t.request.cancel=()=>o.abort()}loadTileData(t,e){t.setTexture(e,this._map.painter)}unloadTile(t,e){if(t.texture&&t.texture instanceof My?(t.destroy(!0),t.texture&&t.texture instanceof My&&this._map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:i,z:n}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:n})}e()}abortTile(t,e){t.request&&t.request.cancel&&(t.request.cancel(),delete t.request),e()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((t=>({x:t.canonical.x,y:t.canonical.y,z:t.canonical.z})))}_clearTiles(){const t=xa(this.id,this.scope);this._map.style.clearSource(t)}_update(){this.fire(new ke("data",{dataType:"source",sourceDataType:"content"}))}}},CE=function(t,e,i,n){const r=new AE[e.type](t,e,i,n);if(r.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${r.id}`);return $(["load","abort","unload","serialize","prepare"],r),r};function kE(t,e){const i=Au.identity([]);return Au.scale(i,i,[.5*t.width,.5*-t.height,1]),Au.translate(i,i,[1,-1,0]),Au.multiply(i,i,t.calculateProjMatrix(e.toUnwrapped())),Float32Array.from(i)}function PE(t,e,i,n,r,s,o,a=!1){const l=t.tilesIn(n,o,a);l.sort(DE);const c=[];for(const n of l)c.push({wrappedTileID:n.tile.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,i,t._state,n,r,s,kE(t.transform,n.tile.tileID),a)});const h=function(t){const e={},i={};for(const n of t){const t=n.queryResults,r=n.wrappedTileID,s=i[r]=i[r]||{};for(const i in t){const n=t[i],r=s[i]=s[i]||{},o=e[i]=e[i]||[];for(const t of n)r[t.featureIndex]||(r[t.featureIndex]=!0,o.push(t))}}return e}(c);for(const e in h)h[e].forEach((e=>{const i=e.feature,n=i.layer;n&&"background"!==n.type&&"sky"!==n.type&&"slot"!==n.type&&(i.source=n.source,n["source-layer"]&&(i.sourceLayer=n["source-layer"]),i.state=void 0!==i.id?t.getFeatureState(n["source-layer"],i.id):{})}));return h}function IE(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],r={};for(let t=0;t<i.length;t++){const s=i[t],o=s.tileID.canonical.key;r[o]||(r[o]=!0,s.querySourceFeatures(n,e))}return n}function DE(t,e){const i=t.tileID,n=e.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}class OE{constructor(t){this.style=t}processLayersChanged(){this.layers=[];for(const t in this.style._mergedLayers){const e=this.style._mergedLayers[t];if("fill-extrusion"===e.type)this.layers.push(e);else if("model"===e.type){const t=this.style.getLayerSource(e);t&&"batched-model"===t.type&&this.layers.push(e)}}}updateZOffset(t,e){this.currentBuildingBuckets=[];for(let t=0;t<this.layers.length;++t){const i=this.layers[t],n=this.style.getLayerSourceCache(i);let r=1;"fill-extrusion"===i.type&&(r=i.paint.get("fill-extrusion-opacity")>0?i.paint.get("fill-extrusion-vertical-scale"):0);let s=n?n.getTile(e):null;if(!s&&n&&e.canonical.z>n.getSource().minzoom){let t=e.scaledTo(Math.min(n.getSource().maxzoom,e.overscaledZ-1));for(;t.overscaledZ>=n.getSource().minzoom&&(s=n.getTile(t),!s&&0!==t.overscaledZ);)t=t.scaledTo(t.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:s?s.getBucket(i):null,tileID:s?s.tileID:e,verticalScale:r})}t.hasAnyZOffset=!1;let i=!1;for(let n=0;n<t.symbolInstances.length;n++){const r=t.symbolInstances.get(n),s=r.zOffset,o=this._getHeightAtTileOffset(e,r.tileAnchorX,r.tileAnchorY);r.zOffset=-1!==o?o:s,i||s===r.zOffset||(i=!0),t.hasAnyZOffset||0===r.zOffset||(t.hasAnyZOffset=!0)}i&&(t.zOffsetBuffersNeedUpload=!0,t.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(t,e,i,n){let r=e,s=i;if(t.canonical.z!==n.canonical.z){const o=n.canonical,a=1/(1<<t.canonical.z-o.z);r=(e+t.canonical.x*un)*a-o.x*un|0,s=(i+t.canonical.y*un)*a-o.y*un|0}return{tileX:r,tileY:s}}_getHeightAtTileOffset(t,e,i){let n;for(let r=0;r<this.layers.length;++r){if("fill-extrusion"!==this.layers[r].type)continue;const{bucket:s,tileID:o,verticalScale:a}=this.currentBuildingBuckets[r];if(!s)continue;const{tileX:l,tileY:c}=this._mapCoordToOverlappingTile(t,e,i,o),h=s.getHeightAtTileCoord(l,c);if(h&&void 0!==h.height){if(!h.hidden)return h.height*a;n=h.height}}for(let r=0;r<this.layers.length;++r){if("model"!==this.layers[r].type)continue;const{bucket:s,tileID:o}=this.currentBuildingBuckets[r];if(!s)continue;const{tileX:a,tileY:l}=this._mapCoordToOverlappingTile(t,e,i,o),c=s.getHeightAtTileCoord(a,l);if(c&&!c.hidden)return void 0===c.height&&void 0!==n?Math.min(c.maxHeight,n)*c.verticalScale:(c.height||0)*c.verticalScale}return-1}}var LE=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function zE(t,e){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return LE.forEach((t=>{t in e&&(i[t]=e[t])})),i}function RE(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=zE(t[i],e[t[i].ref]));return t}const FE={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",setImportUrl:"setImportUrl",setImportData:"setImportData",setImportConfig:"setImportConfig"};function BE(t,e,i){i.push({command:FE.addSource,args:[t,e[t]]})}function NE(t,e,i){e.push({command:FE.removeSource,args:[t]}),i[t]=!0}function jE(t,e,i,n){NE(t,i,n),BE(t,e,i)}function VE(t,e,i){let n;for(n in t[i])if(t[i].hasOwnProperty(n)&&"data"!==n&&!b(t[i][n],e[i][n]))return!1;for(n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!b(t[i][n],e[i][n]))return!1;return!0}function UE(t,e,i,n,r,s){let o;for(o in e=e||{},t=t||{})t.hasOwnProperty(o)&&(b(t[o],e[o])||i.push({command:s,args:[n,o,e[o],r]}));for(o in e)e.hasOwnProperty(o)&&!t.hasOwnProperty(o)&&(b(t[o],e[o])||i.push({command:s,args:[n,o,e[o],r]}))}function $E(t){return t.id}function HE(t,e){return t[e.id]=e,t}class qE{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=I(t,0,1);let e=1,i=this._distances[e];const n=t*this.paddedLength+this.padding;for(;i<n&&e<this._distances.length;)i=this._distances[++e];const r=e-1,s=this._distances[r],o=i-s,a=o>0?(n-s)/o:0;return this.points[r].mult(1-a).add(this.points[e].mult(a))}}class WE{constructor(t,e,i){const n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)n.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)}insertCircle(t,e,i,n){this._forEachCell(e-n,i-n,e+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(n)}_insertBoxCell(t,e,i,n,r,s){this.boxCells[r].push(s)}_insertCircleCell(t,e,i,n,r,s){this.circleCells[r].push(s)}_query(t,e,i,n,r,s){if(i<0||t>this.width||n<0||e>this.height)return!r&&[];const o=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(let t=0;t<this.boxKeys.length;t++)o.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],n=this.circles[3*t+2];o.push({key:this.circleKeys[t],x1:e-n,y1:i-n,x2:e+n,y2:i+n})}return s?o.filter(s):o}return this._forEachCell(t,e,i,n,this._queryCell,o,{hitTest:r,seenUids:{box:{},circle:{}}},s),r?o.length>0:o}_queryCircle(t,e,i,n,r){const s=t-i,o=t+i,a=e-i,l=e+i;if(o<0||s>this.width||l<0||a>this.height)return!n&&[];const c=[];return this._forEachCell(s,a,o,l,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c}query(t,e,i,n,r){return this._query(t,e,i,n,!1,r)}hitTest(t,e,i,n,r){return this._query(t,e,i,n,!0,r)}hitTestCircle(t,e,i,n){return this._queryCircle(t,e,i,!0,n)}_queryCell(t,e,i,n,r,s,o,a){const l=o.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const h of c)if(!l.box[h]){l.box[h]=!0;const c=4*h;if(t<=r[c+2]&&e<=r[c+3]&&i>=r[c+0]&&n>=r[c+1]&&(!a||a(this.boxKeys[h]))){if(o.hitTest)return s.push(!0),!0;s.push({key:this.boxKeys[h],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const h=this.circleCells[r];if(null!==h){const r=this.circles;for(const c of h)if(!l.circle[c]){l.circle[c]=!0;const h=3*c;if(this._circleAndRectCollide(r[h],r[h+1],r[h+2],t,e,i,n)&&(!a||a(this.circleKeys[c]))){if(o.hitTest)return s.push(!0),!0;{const t=r[h],e=r[h+1],i=r[h+2];s.push({key:this.circleKeys[c],x1:t-i,y1:e-i,x2:t+i,y2:e+i})}}}}}_queryCellCircle(t,e,i,n,r,s,o,a){const l=o.circle,c=o.seenUids,h=this.boxCells[r];if(null!==h){const t=this.bboxes;for(const e of h)if(!c.box[e]){c.box[e]=!0;const i=4*e;if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!a||a(this.boxKeys[e])))return s.push(!0),!0}}const u=this.circleCells[r];if(null!==u){const t=this.circles;for(const e of u)if(!c.circle[e]){c.circle[e]=!0;const i=3*e;if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[e])))return s.push(!0),!0}}}_forEachCell(t,e,i,n,r,s,o,a){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(n);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++)if(r.call(this,t,e,i,n,this.xCellCount*l+d,s,o,a))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,n,r,s){const o=n-t,a=r-e,l=i+s;return l*l>o*o+a*a}_circleAndRectCollide(t,e,i,n,r,s,o){const a=(s-n)/2,l=Math.abs(t-(n+a));if(l>a+i)return!1;const c=(o-r)/2,h=Math.abs(e-(r+c));if(h>c+i)return!1;if(l<=a||h<=c)return!0;const u=l-a,d=h-c;return u*u+d*d<=i*i}}const GE=100;class ZE{constructor(t,e,i=new WE(t.width+200,t.height+200,25),n=new WE(t.width+200,t.height+200,25)){this.transform=t,this.grid=i,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+GE,this.screenBottomBoundary=t.height+GE,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.fogState=e}placeCollisionBox(t,e,i,n,r,s,o,a){let l=i.projectedAnchorX,c=i.projectedAnchorY,h=i.projectedAnchorZ;const u=i.elevation,d=i.tileID,p=t.getProjection();if(u&&d){const[t,e,n]=p.upVector(d.canonical,i.tileAnchorX,i.tileAnchorY),r=p.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=t*u*r,c+=e*u*r,h+=n*u*r}const f=this.projectAndGetPerspectiveRatio(o,l,c,h,i.tileID,"globe"===p.name||!!u||this.transform.pitch>0,p),m=s*f.perspectiveRatio,g=(i.x1*e+n.x-i.padding)*m+f.point.x,_=(i.y1*e+n.y-i.padding)*m+f.point.y,y=(i.x2*e+n.x+i.padding)*m+f.point.x,v=(i.y2*e+n.y+i.padding)*m+f.point.y,b=f.perspectiveRatio<=.55||f.occluded;return!this.isInsideGrid(g,_,y,v)||!r&&this.grid.hitTest(g,_,y,v,a)||b?{box:[],offscreen:!1,occluded:f.occluded}:{box:[g,_,y,v],offscreen:this.isOffscreen(g,_,y,v),occluded:!1}}placeCollisionCircles(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f){const m=[],g=this.transform.elevation,_=t.getProjection(),y=g?g.getAtTileOffsetFunc(f,this.transform.center.lat,this.transform.worldSize,_):null,b=new v(i.tileAnchorX,i.tileAnchorY);let{x:x,y:w,z:E}=_.projectTilePoint(b.x,b.y,f.canonical);if(y){const[t,e,i]=y(b);x+=t,w+=e,E+=i}const S="globe"===_.name,T=this.projectAndGetPerspectiveRatio(o,x,w,E,f,S||!!g||this.transform.pitch>0,_),{perspectiveRatio:M}=T,A=(h?s/M:s*M)/dg,C=hb(x,w,E,a),k=T.signedDistanceFromCamera>0?fb(A,r,i.lineOffsetX*A,i.lineOffsetY*A,!1,C,b,i,n,a,{},g&&!h?y:null,h&&!!g,_,f,h):null;let P=!1,I=!1,D=!0;if(k&&!T.occluded){const t=.5*d*M+p,i=new v(-100,-100),n=new v(this.screenRightBoundary,this.screenBottomBoundary),r=new qE,{first:s,last:o}=k,a=s.path.length;let h=[];for(let t=a-1;t>=1;t--)h.push(s.path[t]);for(let t=1;t<o.path.length;t++)h.push(o.path[t]);const f=2.5*t;l&&(h=h.map((([t,e,i],n)=>(y&&!S&&(i=y(n<a-1?s.tilePath[a-1-n]:o.tilePath[n-a+2])[2]),hb(t,e,i,l)))),h.some((t=>t[3]<=0))&&(h=[]));let g=[];if(h.length>0){let t=1/0,e=-1/0,r=1/0,s=-1/0;for(const i of h)t=Math.min(t,i[0]),r=Math.min(r,i[1]),e=Math.max(e,i[0]),s=Math.max(s,i[1]);e>=i.x&&t<=n.x&&s>=i.y&&r<=n.y&&(g=[h.map((t=>new v(t[0],t[1])))],(t<i.x||e>n.x||r<i.y||s>n.y)&&(g=Kg(g,i.x,i.y,n.x,n.y)))}for(const i of g){r.reset(i,.25*t);let n=0;n=r.length<=.5*t?1:Math.ceil(r.paddedLength/f)+1;for(let i=0;i<n;i++){const s=i/Math.max(n-1,1),o=r.lerp(s),a=o.x+GE,l=o.y+GE;m.push(a,l,t,0);const h=a-t,d=l-t,p=a+t,f=l+t;if(D=D&&this.isOffscreen(h,d,p,f),I=I||this.isInsideGrid(h,d,p,f),!e&&this.grid.hitTestCircle(a,l,t,u)&&(P=!0,!c))return{circles:[],offscreen:!1,collisionDetected:P,occluded:!1}}}}return{circles:!c&&P||!I?[]:m,offscreen:D,collisionDetected:P,occluded:T.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const e=[];let i=1/0,n=1/0,r=-1/0,s=-1/0;for(const o of t){const t=new v(o.x+GE,o.y+GE);i=Math.min(i,t.x),n=Math.min(n,t.y),r=Math.max(r,t.x),s=Math.max(s,t.y),e.push(t)}const o=this.grid.query(i,n,r,s).concat(this.ignoredGrid.query(i,n,r,s)),a={},l={};for(const t of o){const i=t.key;void 0===a[i.bucketInstanceId]&&(a[i.bucketInstanceId]={}),a[i.bucketInstanceId][i.featureIndex]||wp(e,[new v(t.x1,t.y1),new v(t.x2,t.y1),new v(t.x2,t.y2),new v(t.x1,t.y2)])&&(a[i.bucketInstanceId][i.featureIndex]=!0,void 0===l[i.bucketInstanceId]&&(l[i.bucketInstanceId]=[]),l[i.bucketInstanceId].push(i.featureIndex))}return l}insertCollisionBox(t,e,i,n,r){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,n,r){const s=e?this.ignoredGrid:this.grid,o={bucketInstanceId:i,featureIndex:n,collisionGroupID:r};for(let e=0;e<t.length;e+=4)s.insertCircle(o,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(t,e,i,n,r,s,o){const a=[e,i,n,1];let l=!1;if(n||this.transform.pitch>0){if(vu.transformMat4(a,a,t),this.fogState&&r&&"globe"!==o.name){const t=function(t,e,i,n,r,s){const o=s.calculateFogTileMatrix(r),a=[e,i,n];return Ou.transformMat4(a,a,o),gw(t,Ou.length(a),s.pitch,s._fov)}(this.fogState,e,i,n,r.toUnwrapped(),this.transform);l=t>.9}}else xb(a,a,t);const c=a[3];return{point:new v((a[0]/c+1)/2*this.transform.width+GE,(-a[1]/c+1)/2*this.transform.height+GE),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(o)/c*.5,1.5),signedDistanceFromCamera:c,occluded:s&&a[2]>c||l}}isOffscreen(t,e,i,n){return i<GE||t>=this.screenRightBoundary||n<GE||e>this.screenBottomBoundary}isInsideGrid(t,e,i,n){return i>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=Au.identity([]);return Au.translate(t,t,[-100,-100,0]),t}}function YE(t,e,i){const n=e.createTileMatrix(t,t.worldSize,i.toUnwrapped());return Au.multiply(new Float32Array(16),t.projMatrix,n)}function XE(t,e,i){if(e.projection.name===i.projection.name)return t.projMatrix;const n=i.clone();return n.setProjection(e.projection),YE(n,e.getProjection(),t)}function KE(t,e,i){return e.name===i.projection.name?t.projMatrix:YE(i,e,t)}class QE{constructor(t,e,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class JE{constructor(t,e,i,n,r,s=!1){this.text=new QE(t?t.text:null,e,i,r),this.icon=new QE(t?t.icon:null,e,n,r),this.clipped=s}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class tS{constructor(t,e,i,n=!1){this.text=t,this.icon=e,this.skipFade=i,this.clipped=n}}class eS{constructor(){this.invProjMatrix=Au.create(),this.viewportMatrix=Au.create(),this.circles=[]}}class iS{constructor(t,e,i,n,r){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r}}class nS{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function rS(t,e,i,n,r){const{horizontalAlign:s,verticalAlign:o}=Ng(t),a=-(s-.5)*e,l=-(o-.5)*i,c=b_(t,n);return new v(a+c[0]*r,l+c[1]*r)}function sS(t,e,i,n,r){const s=new v(t,e);return i&&s._rotate(n?r:-r),s}class oS{constructor(t,e,i,n,r,s){this.transform=t.clone(),this.projection=t.projection.name,this.collisionIndex=new ZE(this.transform,r),this.buildingIndex=s,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new nS(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,e,i,n){const r=i.getBucket(e),s=i.latestFeatureIndex;if(!r||!s||e.fqid!==r.layerIds[0])return;const o=r.layers[0].layout,a=i.collisionBoxArray,l=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),c=i.tileSize/un,h=i.tileID.toUnwrapped();this.transform.setProjection(r.projection);const u=(d=i.tileID,p=r.getProjection(),f=this.transform,p.name===this.projection?f.calculateProjMatrix(d.toUnwrapped()):YE(f,p,d));var d,p,f;const m="map"===o.get("text-pitch-alignment"),g="map"===o.get("text-rotation-alignment");e.compileFilter();const _=e.dynamicFilter(),y=e.dynamicFilterNeedsFeature(),v=this.transform.calculatePixelsToTileUnitsMatrix(i),b=lb(u,i.tileID.canonical,m,g,this.transform,r.getProjection(),v);let x=null;if(m){const t=cb(u,i.tileID.canonical,m,g,this.transform,r.getProjection(),v);x=Au.multiply([],this.transform.labelPlaneMatrix,t)}let w=null;_&&i.latestFeatureIndex&&(w={unwrappedTileID:h,dynamicFilter:_,dynamicFilterNeedsFeature:y,featureIndex:i.latestFeatureIndex}),this.retainedQueryData[r.bucketInstanceId]=new iS(r.bucketInstanceId,s,r.sourceLayerIndex,r.index,i.tileID);const E={bucket:r,layout:o,posMatrix:u,textLabelPlaneMatrix:b,labelToScreenMatrix:x,clippingData:w,scale:l,textPixelRatio:c,holdingForFade:i.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:gg(r.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:gg(r.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(r.sourceID)};if(n)for(const e of r.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=e;t.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:E})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:r.symbolInstances.length,parameters:E})}attemptAnchorPlacement(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_){const{textOffset0:y,textOffset1:v,crossTileID:b}=u,x=[y,v],w=rS(t,i,n,x,r),E=this.collisionIndex.placeCollisionBox(p,r,e,sS(w.x,w.y,s,o,this.transform.angle),h,a,l,c.predicate);if(m){const t=p.getSymbolInstanceIconSize(_,this.transform.zoom,u.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(p,t,m,sS(w.x,w.y,s,o,this.transform.angle),h,a,l,c.predicate).box.length)return}if(E.box.length>0){let e;return this.prevPlacement&&this.prevPlacement.variableOffsets[b]&&this.prevPlacement.placements[b]&&this.prevPlacement.placements[b].text&&(e=this.prevPlacement.variableOffsets[b].anchor),this.variableOffsets[b]={textOffset:x,width:i,height:n,anchor:t,textScale:r,prevAnchor:e},this.markUsedJustification(p,t,u,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,u),this.placedOrientations[b]=f),{shift:w,placedGlyphBoxes:E}}}placeLayerBucketPart(t,e,i,n){const{bucket:r,layout:s,posMatrix:o,textLabelPlaneMatrix:a,labelToScreenMatrix:l,clippingData:c,textPixelRatio:h,holdingForFade:u,collisionBoxArray:d,partiallyEvaluatedTextSize:p,partiallyEvaluatedIconSize:f,collisionGroup:m}=t.parameters,g=s.get("text-optional"),_=s.get("icon-optional"),y=s.get("text-allow-overlap"),b=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),w="map"===s.get("text-pitch-alignment"),E="viewport-y"===s.get("symbol-z-order"),S=s.get("symbol-z-elevate");this.transform.setProjection(r.projection);let T=y&&(b||!r.hasIconData()||_),M=b&&(y||!r.hasTextData()||g);!r.collisionArrays&&d&&r.deserializeCollisionBoxes(d),i&&n&&r.updateCollisionDebugBuffers(this.transform.zoom,d);const A=(t,n,d)=>{const{crossTileID:E,numVerticalGlyphVertices:S}=t;if(c){const i={zoom:this.transform.zoom,pitch:this.transform.pitch};let n=null;if(c.dynamicFilterNeedsFeature){const e=this.retainedQueryData[r.bucketInstanceId];n=c.featureIndex.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,c.dynamicFilter)(i,n,this.retainedQueryData[r.bucketInstanceId].tileID.canonical,new v(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(c.unwrappedTileID)))return this.placements[E]=new tS(!1,!1,!1,!0),void e.add(E)}if(e.has(E))return;if(u)return void(this.placements[E]=new tS(!1,!1,!1));let A=!1,C=!1,k=!0,P=!1,I=!1,D=null,O={box:null,offscreen:null,occluded:null},L={box:null,offscreen:null,occluded:null},z=null,R=null,F=null,B=0,N=0,j=0;d.textFeatureIndex?B=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(B=t.featureIndex),d.verticalTextFeatureIndex&&(N=d.verticalTextFeatureIndex);const V=e=>{e.tileID=this.retainedQueryData[r.bucketInstanceId].tileID;const i=this.transform.elevation;e.elevation=t.zOffset+(i?i.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},U=d.textBox;if(U){V(U);const e=e=>{let i=Ag.horizontal;if(r.allowVerticalPlacement&&!e&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[E];e&&(this.placedOrientations[E]=e,i=e,this.markUsedOrientation(r,i,t))}return i},i=(t,e)=>{if(r.allowVerticalPlacement&&S>0&&d.verticalTextBox){for(const i of r.writingModes)if(i===Ag.vertical?(O=e(),L=O):O=t(),O&&O.box&&O.box.length)break}else O=t()};if(s.get("text-variable-anchor")){let a=s.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[E]){const t=this.prevPlacement.variableOffsets[E];a.indexOf(t.anchor)>0&&(a=a.filter((e=>e!==t.anchor)),a.unshift(t.anchor))}const l=(e,i,s)=>{const l=r.getSymbolInstanceTextSize(p,t,this.transform.zoom,n),c=(e.x2-e.x1)*l+2*e.padding,u=(e.y2-e.y1)*l+2*e.padding,d=t.hasIconTextFit&&!b?i:null;d&&V(d);let g={box:[],offscreen:!1,occluded:!1};const _=y?2*a.length:a.length;for(let i=0;i<_;++i){const _=this.attemptAnchorPlacement(a[i%a.length],e,c,u,l,x,w,h,o,m,i>=a.length,t,n,r,s,d,p,f);if(_&&(g=_.placedGlyphBoxes,g&&g.box&&g.box.length)){A=!0,D=_.shift;break}}return g};i((()=>l(U,d.iconBox,Ag.horizontal)),(()=>{const t=d.verticalTextBox;return t&&V(t),r.allowVerticalPlacement&&!(O&&O.box&&O.box.length)&&S>0&&t?l(t,d.verticalIconBox,Ag.vertical):{box:null,offscreen:null,occluded:null}})),O&&(A=O.box,k=O.offscreen,P=O.occluded);const c=e(!(!O||!O.box));if(!A&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[E];e&&(this.variableOffsets[E]=e,this.markUsedJustification(r,e.anchor,t,c))}}else{const s=(e,i)=>{const s=r.getSymbolInstanceTextSize(p,t,this.transform.zoom,n),a=this.collisionIndex.placeCollisionBox(r,s,e,new v(0,0),y,h,o,m.predicate);return a&&a.box&&a.box.length&&(this.markUsedOrientation(r,i,t),this.placedOrientations[E]=i),a};i((()=>s(U,Ag.horizontal)),(()=>{const t=d.verticalTextBox;return r.allowVerticalPlacement&&S>0&&t?(V(t),s(t,Ag.vertical)):{box:null,offscreen:null,occluded:null}})),e(!!(O&&O.box&&O.box.length))}}if(z=O,A=z&&z.box&&z.box.length>0,k=z&&z.offscreen,P=z&&z.occluded,t.useRuntimeCollisionCircles){const e=r.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),n=mg(r.textSizeData,p,e),c=s.get("text-padding");R=this.collisionIndex.placeCollisionCircles(r,y,e,r.lineVertexArray,r.glyphOffsetArray,n,o,a,l,i,w,m.predicate,t.collisionCircleDiameter*n/dg,c,this.retainedQueryData[r.bucketInstanceId].tileID),A=y||R.circles.length>0&&!R.collisionDetected,k=k&&R.offscreen,P=R.occluded}if(d.iconFeatureIndex&&(j=d.iconFeatureIndex),d.iconBox){const e=e=>{V(e);const i=t.hasIconTextFit&&D?sS(D.x,D.y,x,w,this.transform.angle):new v(0,0),n=r.getSymbolInstanceIconSize(f,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(r,n,e,i,b,h,o,m.predicate)};L&&L.box&&L.box.length&&d.verticalIconBox?(F=e(d.verticalIconBox),C=F.box.length>0):(F=e(d.iconBox),C=F.box.length>0),k=k&&F.offscreen,I=F.occluded}const $=g||0===t.numHorizontalGlyphVertices&&0===S,H=_||0===t.numIconVertices;if($||H?H?$||(C=C&&A):A=C&&A:C=A=C&&A,A&&z&&z.box&&this.collisionIndex.insertCollisionBox(z.box,s.get("text-ignore-placement"),r.bucketInstanceId,L&&L.box&&N?N:B,m.ID),C&&F&&this.collisionIndex.insertCollisionBox(F.box,s.get("icon-ignore-placement"),r.bucketInstanceId,j,m.ID),R&&(A&&this.collisionIndex.insertCollisionCircles(R.circles,s.get("text-ignore-placement"),r.bucketInstanceId,B,m.ID),i)){const t=r.bucketInstanceId;let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new eS);for(let t=0;t<R.circles.length;t+=4)e.circles.push(R.circles[t+0]),e.circles.push(R.circles[t+1]),e.circles.push(R.circles[t+2]),e.circles.push(R.collisionDetected?1:0)}const q="globe"!==r.projection.name;T=T&&(q||!P),M=M&&(q||!I),this.placements[E]=new tS(A||T,C||M,k||r.justReloaded),e.add(E)};if(S&&this.buildingIndex&&(this.buildingIndex.updateZOffset(r,this.retainedQueryData[r.bucketInstanceId].tileID),r.updateZOffset()),E){const t=r.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];A(r.symbolInstances.get(i),i,r.collisionArrays[i])}r.hasAnyZOffset&&Y(`${r.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(r.hasAnyZOffset){const t=r.getSortedIndexesByZOffset();for(let e=0;e<t.length;++e){const i=t[e];A(r.symbolInstances.get(i),i,r.collisionArrays[i])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)A(r.symbolInstances.get(e),e,r.collisionArrays[e]);if(i&&r.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[r.bucketInstanceId];Au.invert(t.invProjMatrix,o),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}r.justReloaded=!1}markUsedJustification(t,e,i,n){const{leftJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:a,crossTileID:l}=i,c=w_(e),h=n===Ag.vertical?a:"left"===c?r:"center"===c?s:"right"===c?o:-1;r>=0&&(t.text.placedSymbolArray.get(r).crossTileID=h>=0&&r!==h?0:l),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:l),o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:l),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:l)}markUsedOrientation(t,e,i){const n=e===Ag.horizontal||e===Ag.horizontalOnly?e:0,r=e===Ag.vertical?e:0,{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:l}=i,c=t.text.placedSymbolArray;s>=0&&(c.get(s).placedOrientation=n),o>=0&&(c.get(o).placedOrientation=n),a>=0&&(c.get(a).placedOrientation=n),l>=0&&(c.get(l).placedOrientation=r)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},s=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],s=r[t];s?(this.opacities[t]=new JE(s,n,e.text,e.icon,null,e.clipped),i=i||e.text!==s.text.placed||e.icon!==s.icon.placed):(this.opacities[t]=new JE(null,n,e.text,e.icon,e.skipFade,e.clipped),i=i||e.text||e.icon)}for(const t in r){const e=r[t];if(!this.opacities[t]){const r=new JE(e,n,!1,!1);r.isHidden()||(this.opacities[t]=r,i=i||e.text.placed||e.icon.placed)}}for(const t in s)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=s[t]);for(const t in o)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=o[t]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i=new Set;for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.fqid===e.layerIds[0]&&(this.updateBucketOpacities(e,i,n.collisionBoxArray),e.layers[0].layout.get("symbol-z-elevate")&&this.buildingIndex&&(this.buildingIndex.updateZOffset(e,n.tileID),e.updateZOffset()))}}updateBucketOpacities(t,e,i){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const n=t.layers[0].layout,r=!!t.layers[0].dynamicFilter(),s=new JE(null,0,!1,!1,!0),o=n.get("text-allow-overlap"),a=n.get("icon-allow-overlap"),l=n.get("text-variable-anchor"),c="map"===n.get("text-rotation-alignment"),h="map"===n.get("text-pitch-alignment"),u=new JE(null,0,o&&(a||!t.hasIconData()||n.get("icon-optional")),a&&(o||!t.hasTextData()||n.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const d=(t,e,i)=>{for(let n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(i)};let p=0;for(let i=0;i<t.symbolInstances.length;i++){const n=t.symbolInstances.get(i),{numHorizontalGlyphVertices:o,numVerticalGlyphVertices:a,crossTileID:f,numIconVertices:m}=n,g=e.has(f);let _=this.opacities[f];g?_=s:_||(_=u,this.opacities[f]=_),e.add(f);const y=o>0||a>0,b=m>0,x=this.placedOrientations[f],w=x===Ag.vertical,E=x===Ag.horizontal||x===Ag.horizontalOnly;if(!y&&!b||_.isHidden()||p++,y){const e=mS(_.text);d(t.text,o,w?gS:e),d(t.text,a,E?gS:e);const i=_.text.isHidden(),{leftJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,h=t.text.placedSymbolArray,u=i||w?1:0;r>=0&&(h.get(r).hidden=u),s>=0&&(h.get(s).hidden=u),l>=0&&(h.get(l).hidden=u),c>=0&&(h.get(c).hidden=i||E?1:0);const p=this.variableOffsets[f];p&&this.markUsedJustification(t,p.anchor,n,x);const m=this.placedOrientations[f];m&&(this.markUsedJustification(t,"left",n,m),this.markUsedOrientation(t,m,n))}if(b){const e=mS(_.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:r}=n,s=t.icon.placedSymbolArray,o=_.icon.isHidden()?1:0;i>=0&&(d(t.icon,m,w?gS:e),s.get(i).hidden=o),r>=0&&(d(t.icon,n.numVerticalIconVertices,E?gS:e),s.get(r).hidden=o)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const e=t.collisionArrays[i];if(e){let i=new v(0,0),s=!0;if(e.textBox||e.verticalTextBox){if(l){const t=this.variableOffsets[f];t?(i=rS(t.anchor,t.width,t.height,t.textOffset,t.textScale),c&&i._rotate(h?this.transform.angle:-this.transform.angle)):s=!1}r&&(s=!_.clipped),e.textBox&&aS(t.textCollisionBox.collisionVertexArray,_.text.placed,!s||w,i.x,i.y),e.verticalTextBox&&aS(t.textCollisionBox.collisionVertexArray,_.text.placed,!s||E,i.x,i.y)}const o=s&&Boolean(!E&&e.verticalIconBox);e.iconBox&&aS(t.iconCollisionBox.collisionVertexArray,_.icon.placed,o,n.hasIconTextFit?i.x:0,n.hasIconTextFit?i.y:0),e.verticalIconBox&&aS(t.iconCollisionBox.collisionVertexArray,_.icon.placed,!o,n.hasIconTextFit?i.x:0,n.hasIconTextFit?i.y:0)}}}if(t.fullyClipped=0===p,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function aS(t,e,i,n,r){t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0)}const lS=Math.pow(2,25),cS=Math.pow(2,24),hS=Math.pow(2,17),uS=Math.pow(2,16),dS=Math.pow(2,9),pS=Math.pow(2,8),fS=Math.pow(2,1);function mS(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*lS+e*cS+i*hS+e*uS+i*dS+e*pS+i*fS+e}const gS=0;class _S{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(t,e,i,n,r){const s=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(s,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,s.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<s.length;){const t=s[this._currentPartIndex];if(e.placeLayerBucketPart(t,this._seenCrossTileIDs,i,0===t.symbolInstanceStart),this._currentPartIndex++,r())return!0}return!1}}class yS{constructor(t,e,i,n,r,s,o,a,l){this.placement=new oS(t,r,s,o,a,l),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,e,i,n){const r=pe.now(),s=()=>{const t=pe.now()-r;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const r=e[t[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if("symbol"===r.type&&(!r.minzoom||r.minzoom<=o)&&(!r.maxzoom||r.maxzoom>o)){const t=r,e=t.layout.get("symbol-z-elevate"),o=this._inProgressLayer=this._inProgressLayer||new _S(t),a=xa(r.source,r.scope);if(o.continuePlacement(e?n[a]:i[a],this.placement,this._showCollisionBoxes,r,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const vS=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class bS{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const n=i>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const r=vS[15&i];if(!r)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new bS(o,s,r,t)}constructor(t,e=64,i=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const r=vS.indexOf(this.ArrayType),s=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-o%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+s+o+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return xS(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:s,nodeSize:o}=this,a=[0,r.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,h=a.pop()||0,u=a.pop()||0;if(h-u<=o){for(let o=u;o<=h;o++){const a=s[2*o],c=s[2*o+1];a>=t&&a<=i&&c>=e&&c<=n&&l.push(r[o])}continue}const d=u+h>>1,p=s[2*d],f=s[2*d+1];p>=t&&p<=i&&f>=e&&f<=n&&l.push(r[d]),(0===c?t<=p:e<=f)&&(a.push(u),a.push(d-1),a.push(1-c)),(0===c?i>=p:n>=f)&&(a.push(d+1),a.push(h),a.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:r,nodeSize:s}=this,o=[0,n.length-1,0],a=[],l=i*i;for(;o.length;){const c=o.pop()||0,h=o.pop()||0,u=o.pop()||0;if(h-u<=s){for(let i=u;i<=h;i++)TS(r[2*i],r[2*i+1],t,e)<=l&&a.push(n[i]);continue}const d=u+h>>1,p=r[2*d],f=r[2*d+1];TS(p,f,t,e)<=l&&a.push(n[d]),(0===c?t-i<=p:e-i<=f)&&(o.push(u),o.push(d-1),o.push(1-c)),(0===c?t+i>=p:e+i>=f)&&(o.push(d+1),o.push(h),o.push(1-c))}return a}}function xS(t,e,i,n,r,s){if(r-n<=i)return;const o=n+r>>1;wS(t,e,o,n,r,s),xS(t,e,i,n,o-1,1-s),xS(t,e,i,o+1,r,1-s)}function wS(t,e,i,n,r,s){for(;r>n;){if(r-n>600){const o=r-n+1,a=i-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(o-c)/o)*(a-o/2<0?-1:1);wS(t,e,i,Math.max(n,Math.floor(i-a*c/o+h)),Math.min(r,Math.floor(i+(o-a)*c/o+h)),s)}const o=e[2*i+s];let a=n,l=r;for(ES(t,e,n,i),e[2*r+s]>o&&ES(t,e,n,r);a<l;){for(ES(t,e,a,l),a++,l--;e[2*a+s]<o;)a++;for(;e[2*l+s]>o;)l--}e[2*n+s]===o?ES(t,e,n,l):(l++,ES(t,e,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function ES(t,e,i,n){SS(t,i,n),SS(e,2*i,2*n),SS(e,2*i+1,2*n+1)}function SS(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function TS(t,e,i,n){const r=t-i,s=e-n;return r*r+s*s}const MS=512/un/2;class AS{constructor(t,e,i){this.tileID=t,this.bucketInstanceId=i,this.index=new bS(e.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const n=t.canonical.x*un,r=t.canonical.y*un;for(let t=0;t<e.length;t++){const{key:i,crossTileID:s,tileAnchorX:o,tileAnchorY:a}=e.get(t),l=Math.floor((n+o)*MS),c=Math.floor((r+a)*MS);this.index.add(l,c),this.keys.push(i),this.crossTileIDs.push(s)}this.index.finish()}findMatches(t,e,i){const n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),r=MS/Math.pow(2,e.canonical.z-this.tileID.canonical.z),s=e.canonical.x*un,o=e.canonical.y*un;for(let e=0;e<t.length;e++){const a=t.get(e);if(a.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:h}=a,u=Math.floor((s+c)*r),d=Math.floor((o+h)*r),p=this.index.range(u-n,d-n,u+n,d+n);for(const t of p){const e=this.crossTileIDs[t];if(this.keys[t]===l&&!i.has(e)){i.add(e),a.crossTileID=e;break}}}}}class CS{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class kS{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],n={};for(const t in i){const r=i[t];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),n[r.tileID.key]=r}this.indexes[t]=n}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]=new Set);const n=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in r){const s=r[i];s.tileID.isChildOf(t)&&s.findMatches(e.symbolInstances,t,n)}else{const s=r[t.scaledTo(Number(i)).key];s&&s.findMatches(e.symbolInstances,t,n)}}for(let t=0;t<e.symbolInstances.length;t++){const r=e.symbolInstances.get(t);r.crossTileID||(r.crossTileID=i.generate(),n.add(r.crossTileID))}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new AS(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i of e.crossTileIDs)this.usedCrossTileIDs[t].delete(i)}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const n=this.indexes[i];for(const r in n)t[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],e=!0)}return e}}class PS{constructor(){this.layerIndexes={},this.crossTileIDs=new CS,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i,n){let r=this.layerIndexes[t.fqid];void 0===r&&(r=this.layerIndexes[t.fqid]=new kS);let s=!1;const o={};"globe"!==n.name&&r.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.fqid===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,e,this.crossTileIDs)&&(s=!0),o[e.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(s=!0),s}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}var IS="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w-0.0001;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",DS="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",OS="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture(u_depth,uv-df.xz)),unpack_depth(texture(u_depth,uv+df.xz)),unpack_depth(texture(u_depth,uv-df.zy)),unpack_depth(texture(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",LS="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",zS="highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {\n#ifdef FOG_DITHERING\nvec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);\n#else\nreturn color;\n#endif\n}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",RS="#ifdef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);vec4 _raTexLinearCoord(vec2 texCoord,vec2 texResolution,out vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return (texCoord.xxyy+vec2(1.5,0.5).xyxy)/texResolution.xxyy;}vec2 _raTexLinearMix(vec2 fxy,vec4 colorMix,float colorOffset,vec4 t00,vec4 t10,vec4 t01,vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(vec2 texCoord,vec2 texResolution,vec4 colorMix,float colorOffset) {vec2 fxy;vec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texture(u_image0,c.yz),texture(u_image0,c.xz),texture(u_image0,c.yw),texture(u_image0,c.xw)\n);}vec2 raTexture2D_image1_linear(vec2 texCoord,vec2 texResolution,vec4 colorMix,float colorOffset) {vec2 fxy;vec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texture(u_image1,c.yz),texture(u_image1,c.xz),texture(u_image1,c.yw),texture(u_image1,c.xw)\n);}vec2 raTexture2D_image0_nearest(vec2 texCoord,vec2 texResolution,vec4 colorMix,float colorOffset) {vec4 t=texture(u_image0,texCoord);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(vec2 texCoord,vec2 texResolution,vec4 colorMix,float colorOffset) {vec4 t=texture(u_image1,texCoord);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",FS="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",BS="#ifdef RENDER_SHADOWS\n#ifdef DEPTH_TEXTURE\nuniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;\n#else\nuniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;\n#endif\nuniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_1,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_0,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;\n#ifdef NATIVE\nhighp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));\n#else\nhighp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(\nshadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)\n);\n#endif\nvec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return mix(lerpx.x,lerpx.y,f.y);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {\n#ifdef SHADOWS_SINGLE_CASCADE\nlight_view_pos0.xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);\n#else\nlight_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth));\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const NS=[];qS(IS,NS);const jS={"_prelude_fog.vertex.glsl":LS,"_prelude_terrain.vertex.glsl":OS,"_prelude_shadow.vertex.glsl":FS,"_prelude_fog.fragment.glsl":zS,"_prelude_shadow.fragment.glsl":BS,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":RS},VS={};WS("",OS),WS(zS,LS),WS(BS,FS),WS(RS,"");const US=WS("\nout vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec2 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color) {\n#ifdef INDICATOR_CUTOUT\nfloat holeMinOpacity=u_indicator_cutout_params.x;float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif","\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}"),$S=IS;var HS={background:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),circle:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:WS("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:WS('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:WS("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:WS("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in float a_size_scale;in vec2 a_padding;in float a_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(a_z_offset+elevation(a_anchor_pos)),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:WS("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:WS("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),fill:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutline:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;out vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;in vec2 v_pos;in vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;out vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;in vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nuniform float u_emissive_strength;in float v_height;void main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,v_depth);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,u_emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef RENDER_CUTOFF\ncolor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#ifdef RENDER_CUTOFF\ninvariant gl_Position;\n#endif\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);v_flat=vec4(linearProduct(color.rgb,vec3(calculate_NdotL(normal))),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),fillExtrusionDepth:WS("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_vertical_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base);pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nout vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:WS('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;in float v_depth;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,v_depth));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0)).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);v_depth=gl_Position.w;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:WS("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;HANDLE_WIREFRAME_DEBUG;\n#endif\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;\n#ifdef FORCE_ABS_FL_GROUND_RADIUS\nfl_ground_radius=abs(flood_light_ground_radius);\n#endif\nfloat flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(1.0,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:WS("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) { \nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color.rgb=mix(border_color.rgb*border_color.a*trimmed,out_color.rgb,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),linePattern:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_ground(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),raster:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform vec4 u_tl_br;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#elif defined(PROJECTION_GLOBE_VIEW)\nin vec2 a_pos;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;void main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec2 globe_tl=vec2(u_tl_br.x,u_tl_br.y);vec2 globe_br=vec2(u_tl_br.z,u_tl_br.w);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=1.0-((mercatorY-globe_br.y)/(globe_tl.y-globe_br.y));float mercatorX=mercatorXfromLng(latLng[1]);float uvX=(mercatorX-globe_br.x)/(globe_tl.x-globe_br.x);vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);uv=vec2(uvX,uvY);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\nuv=a_texture_pos/8192.0;\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),symbolIcon:WS('#include "_prelude_lighting.glsl"\nuniform sampler2D u_texture;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\nin float v_fade_opacity;in vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nuniform mediump float u_icon_saturation;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nlowp float alpha=opacity*v_fade_opacity;vec4 out_color;\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b)*alpha;\n#else\nout_color=texture(u_texture,v_tex_a)*alpha;\n#endif\n#ifdef SATURATION\nvec3 luma=vec3(dot(out_color.rgb,vec3(0.2126,0.7152,0.0722)));out_color.rgb=mix(luma,out_color.rgb,u_icon_saturation);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nv_tex_a=a_tex/u_texsize;\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\nv_fade_opacity=out_fade_opacity;}'),symbolSDF:WS('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\nuniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;in float v_draw_halo;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);vec4 out_color=color*(alpha*opacity*fade_opacity);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout float v_draw_halo;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,out_fade_opacity);}'),symbolTextAndIcon:WS('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_halo;in float v_draw_halo;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);vec4 out_color=color*(alpha*opacity*fade_opacity);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout float v_draw_halo;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nfloat out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,out_fade_opacity,is_sdf);}'),terrainRaster:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;in float v_depth;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,v_depth,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}'),terrainDepth:WS("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:WS('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',DS),skyboxGradient:WS('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',DS),skyboxCapture:WS("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(raster.rgb*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:WS('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;\n#ifndef NATIVE\nc=dither(c,gl_FragCoord.xy+u_temporal_offset);\n#endif\nglFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:WS('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform sampler2D u_depthTexture;uniform vec2 u_inv_depth_size;bool isOccluded() {vec2 coord=gl_FragCoord.xy*u_inv_depth_size;highp float depth=unpack_depth(texture(u_depthTexture,coord));return v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\ntexColor.rgb=sRGBToLinear(texColor.rgb);if(u_baseTextureIsAlpha) {if (texColor.w < 0.5) {discard;}albedo*=mix(vec4(texColor.rgb,texColor.a),vec4(texColor.a),float(u_baseTextureIsAlpha));} else {albedo*=texColor;}\n#endif\nreturn vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 diffuse=getDiffuseShadedColor(getBaseColor().rgb,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(diffuse,1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nao=(texture(u_occlusionTexture,uv_2f).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);color=mix(color,v_color_mix.rgb,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=u_matrix*pos;pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=local_pos;\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normalize(normal_3f));shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1);v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:WS("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=u_matrix*pos;\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:WS("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}")};function qS(t,e){const i=t.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let t of i)if(t=t.trim(),"#"===t[0]&&t.includes("if")&&!t.includes("endif")){t=t.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const i=t.split(" ");for(const t of i)e.includes(t)||e.push(t)}}function WS(t,e){const i=/#include\s+"([^"]+)"/g,n=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let r=e.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);r&&(r=r.map((t=>{const e=t.split(" ");return e[e.length-1]})),r=[...new Set(r)]);const s={},o=[],a=[];t=t.replace(i,((t,e)=>(a.push(e),""))),e=e.replace(i,((t,e)=>(o.push(e),"")));let l=[...NS];qS(t,l),qS(e,l);for(const t of[...o,...a])jS[t]||console.error(`Undefined include: ${t}`),VS[t]||(VS[t]=[],qS(jS[t],VS[t])),l=[...l,...VS[t]];return{fragmentSource:t=t.replace(n,((t,e,i,n,r)=>(s[r]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nin ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"initialize"===e?`\n#ifdef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = u_${r};\n#endif\n`:"define-attribute"===e?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n in ${i} ${n} ${r};\n#endif\n`:"initialize-attribute"===e?"":void 0))),vertexSource:e=e.replace(n,((t,e,i,n,r)=>{const o="float"===n?"vec2":n,a=r.match(/color/)?"color":o;return"define-attribute-vertex-shader-only"===e?`\n#ifdef HAS_ATTRIBUTE_a_${r}\nin ${i} ${n} a_${r};\n#endif\n`:s[r]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nin ${i} ${o} a_${r};\nout ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"initialize"===e?"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = unpack_mix_${a}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:"define-attribute"===e?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n in ${i} ${n} a_${r};\n out ${i} ${n} ${r};\n#endif\n`:"initialize-attribute"===e?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n ${r} = a_${r};\n#endif\n`:void 0:"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nin ${i} ${o} a_${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"define-instanced"===e?"mat4"===a?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${r}0;\nin vec4 a_${r}1;\nin vec4 a_${r}2;\nin vec4 a_${r}3;\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${i} ${o} a_${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"initialize-attribute-custom"===e?`\n#ifdef HAS_ATTRIBUTE_a_${r}\n ${i} ${n} ${r} = a_${r};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = unpack_mix_${a}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`})),staticAttributes:r,usedDefines:l,vertexIncludes:o,fragmentIncludes:a}}class GS{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(t,e,i,n,r,s,o,a){this.context=t;let l=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!l&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(l=!0);let c=this.boundDynamicVertexBuffers.length!==o.length;for(let t=0;!c&&t<o.length;t++)this.boundDynamicVertexBuffers[t]!==o[t]&&(c=!0);if(!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||l||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==s)this.freshBind(e,i,n,r,s,o,a);else{t.bindVertexArrayOES.set(this.vao);for(const i of o)i&&(i.bind(),a&&i.instanceCount&&i.setVertexAttribDivisor(t.gl,e,a));r&&r.dynamicDraw&&r.bind()}}freshBind(t,e,i,n,r,s,o){const a=t.numAttributes,l=this.context,c=l.gl;this.vao&&this.destroy(),this.vao=l.gl.createVertexArray(),l.bindVertexArrayOES.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffers=s,e.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,r);for(const e of i)e.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,r);for(const e of s)e&&(e.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,r),o&&e.instanceCount&&e.setVertexAttribDivisor(c,t,o));n&&n.bind(),l.currentNumAttributes=a}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function ZS(t,e){const i=Math.pow(2,e.canonical.z),n=e.canonical.y;return[new cp(0,n/i).toLngLat().lat,new cp(0,(n+1)/i).toLngLat().lat]}function YS(t,e,i,n,r,s,o){const a=t.context,l=a.gl,c=i.hillshadeFBO;if(!c)return;t.prepareDrawTile();const h=t.isTileAffectedByFog(e),u=t.getOrCreateProgram("hillshade",{overrideFog:h});a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());const d=((t,e,i,n)=>{const r=i.paint.get("hillshade-shadow-color"),s=i.paint.get("hillshade-highlight-color"),o=i.paint.get("hillshade-accent-color"),a=i.paint.get("hillshade-emissive-strength");let l=E(i.paint.get("hillshade-illumination-direction"));if("viewport"===i.paint.get("hillshade-illumination-anchor"))l-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const e=t.style.directionalLight.properties.get("direction");l=E(J(e.x,e.y,e.z)[1])}const c=!t.options.moving;return{u_matrix:n||t.transform.calculateProjMatrix(e.tileID.toUnwrapped(),c),u_image:0,u_latrange:ZS(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),l],u_shadow:r,u_highlight:s,u_emissive_strength:a,u_accent:o}})(t,i,n,t.terrain?e.projMatrix:null);t.uploadCommonUniforms(a,u,e.toUnwrapped());const{tileBoundsBuffer:p,tileBoundsIndexBuffer:f,tileBoundsSegments:m}=t.getTileBoundsBuffers(i);u.draw(t,l.TRIANGLES,r,s,o,Ov.disabled,d,n.id,p,f,m)}function XS(t,e,i){if(!e.needsDEMTextureUpload)return;const n=t.context,r=n.gl;n.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||t.getTileTexture(i.stride);const s=i.getPixels();e.demTexture?e.demTexture.update(s,{premultiply:!1}):e.demTexture=new My(n,s,r.R32F,{premultiply:!1}),e.needsDEMTextureUpload=!1}function KS(t,e,i){const n=t.context,r=n.gl;if(!e.dem)return;const s=e.dem;if(n.activeTexture.set(r.TEXTURE1),XS(t,e,s),!e.demTexture)return;e.demTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE);const o=s.dim;n.activeTexture.set(r.TEXTURE0);let a=e.hillshadeFBO;if(!a){const t=new My(n,{width:o,height:o,data:null},r.RGBA);t.bind(r.LINEAR,r.CLAMP_TO_EDGE),a=e.hillshadeFBO=n.createFramebuffer(o,o,!0,"renderbuffer"),a.colorAttachment.set(t.texture)}n.bindFramebuffer.set(a.framebuffer),n.viewport.set([0,0,o,o]);const{tileBoundsBuffer:l,tileBoundsIndexBuffer:c,tileBoundsSegments:h}=t.getMercatorTileBoundsBuffers(),u=[];t.linearFloatFilteringSupported()&&u.push("TERRAIN_DEM_FLOAT_FORMAT"),t.getOrCreateProgram("hillshadePrepare",{defines:u}).draw(t,r.TRIANGLES,Mv.disabled,Cv.disabled,Pv.unblended,Ov.disabled,((t,e)=>{const i=e.stride,n=Au.create();return Au.ortho(n,0,un,-un,0,0,1),Au.translate(n,n,[0,-un,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ}})(e.tileID,s),i.id,l,c,h),e.needsHillshadePrepare=!1}const QS=t=>({u_matrix:new $l(t),u_image0:new Rl(t),u_skirt_height:new Fl(t),u_ground_shadow_factor:new Nl(t)}),JS=(t,e,i)=>({u_matrix:t,u_image0:0,u_skirt_height:e,u_ground_shadow_factor:i}),tT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f)=>({u_proj_matrix:Float32Array.from(t),u_globe_matrix:e,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:i,u_zoom_transition:r,u_merc_center:s,u_image0:0,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:h,u_globe_radius:u,u_viewport:d,u_grid_matrix:f?Float32Array.from(f):new Float32Array(9),u_skirt_height:p}),eT=(t,e)=>{if(e>0&&t.terrain&&Y("Cutoff is currently disabled on terrain"),e<=0||t.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,0]}};const i=t.transform,n=Math.max(Math.abs(i._zoom-(t.minCutoffZoom-1)),1),r=i.isLODDisabled(!1)?D(60,45,i.pitch):D(30,15,i.pitch),s=i._farZ-i._nearZ,o=e*i.height,a=((1-(l=r))*(.75*i.cameraToCenterDistance)+l*(i._farZ+o))*n;var l;return{shouldRenderCutoff:r<1,uniformValues:{u_cutoff_params:[i._nearZ,i._farZ,(a-i._nearZ)/s,(a-o-i._nearZ)/s]}}};function iT(t,e){return null!=t&&null!=e&&!(!t.hasData()||!e.hasData())&&null!=t.demTexture&&null!=e.demTexture&&t.tileID.key!==e.tileID.key}const nT=new class{constructor(){this.operations={}}newMorphing(t,e,i,n,r){if(t in this.operations){const e=this.operations[t];e.to.tileID.key!==i.tileID.key&&(e.queued=i)}else this.operations[t]={startTime:n,phase:0,duration:r,from:e,to:i,queued:null}}getMorphValuesForProxy(t){if(!(t in this.operations))return null;const e=this.operations[t];return{from:e.from,to:e.to,phase:e.phase}}update(t){for(const e in this.operations){const i=this.operations[e];for(i.phase=(t-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,t)){delete this.operations[e];break}}}_nextOp(t,e){return!!t.queued&&(t.from=t.to,t.to=t.queued,t.queued=null,t.phase=0,t.startTime=e,!0)}_validOp(t){return t.from.hasData()&&t.to.hasData()}},rT={0:null,1:"TERRAIN_VERTEX_MORPHING"};function sT(t,e,i){if(0===e)return 0;const n=e<1&&514===i?.25/e:1;return 6*Math.pow(1.5,22-t)*Math.max(e,1)*n}function oT(t,e){const i=1<<t.z;return!e&&(0===t.x||t.x===i-1)||0===t.y||t.y===i-1}const aT=t=>({u_matrix:t});function lT(t,e,i,n,r){if(r>0){const s=pe.now(),o=(s-t.timeAdded)/r,a=e?(s-e.timeAdded)/r:-1,l=i.getSource(),c=n.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),h=!e||Math.abs(e.tileID.overscaledZ-c)>Math.abs(t.tileID.overscaledZ-c),u=h&&t.refreshedUponExpiration?1:I(h?o:1-a,0,1);return t.refreshedUponExpiration&&o>=1&&(t.refreshedUponExpiration=!1),e?{opacity:1,mix:1-u}:{opacity:u,mix:0}}return{opacity:1,mix:0}}class cT extends zv{constructor(t){const e={type:"raster-dem",maxzoom:t.transform.maxZoom},i=new Tw(Zw(),null),n=CE("mock-dem",e,i,t.style);super("mock-dem",n,!1),n.setEventedParent(this),this._sourceLoaded=!0}_loadTile(t,e){t.state="loaded",e(null)}}class hT extends zv{constructor(t){const e=CE("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new Tw(Zw(),null),t.style);super("proxy",e,!1),e.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,e,i){if(t.freezeTileCoverage)return;this.transform=t;const n=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((e,i)=>{if(e[i.key]="",!this._tiles[i.key]){const e=new Fy(i,this._source.tileSize*i.overscaleFactor(),t.tileZoom);e.state="loaded",this._tiles[i.key]=e}return e}),{});for(const t in this._tiles)t in n||(this.freeFBO(t),this._tiles[t].unloadVectorData(),delete this._tiles[t])}freeFBO(t){const e=this.proxyCachedFBO[t];if(void 0!==e){const i=Object.values(e);this.renderCachePool.push(...i),delete this.proxyCachedFBO[t]}}deallocRenderCache(){this.renderCache.forEach((t=>t.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class uT extends qu{constructor(t,e,i){super(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y),this.proxyTileKey=e,this.projMatrix=i}}class dT extends Qm{constructor(t,e){super(),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[i,n,r]=function(t){const e=new Ia,i=new Za,n=131;e.reserve(17161),i.reserve(33800);const r=un/128,s=un+r/2,o=s+r;for(let t=-r;t<o;t+=r)for(let i=-r;i<o;i+=r){const n=i<0||i>s||t<0||t>s?24575:0,r=I(Math.round(i),0,un),o=I(Math.round(t),0,un);e.emplaceBack(r+n,o)}const a=(t,e)=>{const r=e*n+t;i.emplaceBack(r+1,r,r+n),i.emplaceBack(r+n,r+n+1,r+1)};for(let t=1;t<129;t++)for(let e=1;e<129;e++)a(e,t);return[0,129].forEach((t=>{for(let e=0;e<130;e++)a(e,t),a(t,e)})),[e,i,32768]}(),s=t.context;this.gridBuffer=s.createVertexBuffer(i,ju.members),this.gridIndexBuffer=s.createIndexBuffer(n),this.gridSegments=bl.simpleSegment(0,0,i.length,n.length),this.gridNoSkirtSegments=bl.simpleSegment(0,0,i.length,r),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new hT(e.map),this.orthoMatrix=Au.create(),Au.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,un,0,un,0,1);const o=s.gl;this._overlapStencilMode=new Cv({func:o.GEQUAL,mask:255},0,255,o.KEEP,o.KEEP,o.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=e,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new cT(e.map),this._pendingGroundEffectLayers=[]}set style(t){t.on("data",this._onStyleDataEvent.bind(this)),this._style=t,this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(t,e,i){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const n=t.terrain.properties,r=0===t.terrain.drapeRenderMode,s=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=pe.now();const o=t.terrain&&t.terrain.scope,a=n.get("source"),l=r?this._mockSourceCache:t.getSourceCache(a,o);if(!l)return void Y(`Couldn't find terrain source "${a}".`);if(this.sourceCache=l,this._exaggeration=s?this.calculateExaggeration(e):n.get("exaggeration"),!e.projection.requiresDraping&&s&&0===this._exaggeration)return void this._disable();this.enabled=!0;const c=()=>{this.sourceCache.used&&Y(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(e,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,c(),this._initializing=!0),c(),e.updateElevation(!0,i),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(e),this._emptyDEMTextureDirty=!0,this._previousZoom=e.zoom}else this._disable()}calculateExaggeration(t){const e=this._previousCameraAltitude,i=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=i;const n=null!=e?i-e:Number.MAX_VALUE;if(Math.abs(n)<2)return this._exaggeration;const r=t.zoom,s=this._style.terrain;if(!this._previousUpdateTimestamp)return s.getExaggeration(r);let o=r-this._previousZoom;const a=this._previousUpdateTimestamp;let l=r;null!=this._evaluationZoom&&(l=this._evaluationZoom,Math.abs(r-l)>.5&&(o=.5*(r-l+o)),o*n<0&&(l+=o)),this._evaluationZoom=l;const c=s.getExaggeration(l),h=c===s.getExaggeration(Math.max(0,l-.1));if(h&&Math.abs(c-this._exaggeration)<.01)return c;let u=Math.min(.1,.00375*(this._updateTimestamp-a));return(h||c<.1||Math.abs(o)<1e-4)&&(u=Math.min(.2,4*u)),Jn(this._exaggeration,c,u)}resetTileLookupCache(t){this._findCoveringTileCache[t]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(t){t.coord&&"source"===t.dataType?this._clearRenderCacheForTile(t.sourceCacheId,t.coord):"style"===t.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const t in this._style._mergedSourceCaches)this._style._mergedSourceCaches[t].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((t=>t.fb.destroy())),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const t=2*this.proxySourceCache.getSource().tileSize;return[t,t]}set useVertexMorphing(t){this._useVertexMorphing=t}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const e=this.proxySourceCache,i=this.painter.transform;this._initializing&&(this._initializing=0===i._centerAltitude&&-1===this.getAtPointOrZero(cp.fromLngLat(i.center),-1),this._emptyDEMTextureDirty=!this._initializing);const n=this.proxyCoords=e.getIds().map((t=>{const n=e.getTileByID(t).tileID;return n.projMatrix=i.calculateProjMatrix(n.toUnwrapped()),n}));!function(t,e){const i=e.transform.pointCoordinate(e.transform.getCameraPoint()),n=new v(i.x,i.y);t.sort(((t,e)=>{if(e.overscaledZ-t.overscaledZ)return e.overscaledZ-t.overscaledZ;const i=new v(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),r=new v(e.canonical.x+(1<<e.canonical.z)*e.wrap,e.canonical.y),s=n.mult(1<<t.canonical.z);return s.x-=.5,s.y-=.5,s.distSqr(i)-s.distSqr(r)}))}(n,this.painter);const r=this.proxyToSource||{};this.proxyToSource={},n.forEach((t=>{this.proxyToSource[t.key]={}})),this.terrainTileForTile={};const s=this._style._mergedSourceCaches;for(const e in s){const i=s[e];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,t[e],r),i.usedForTerrain)continue;const n=t[e];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[e.id]=n.map((t=>new uT(t,t.key,this.orthoMatrix))),this._assignTerrainTiles(n),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(r),this.renderingToTexture=!1;const o={};this._visibleDemTiles=[];for(const t of this.proxyCoords){const e=this.terrainTileForTile[t.key];if(!e)continue;const i=e.tileID.key;i in o||(this._visibleDemTiles.push(e),o[i]=i)}}_assignTerrainTiles(t){this._initializing||t.forEach((t=>{if(this.terrainTileForTile[t.key])return;const e=this._findTileCoveringTileID(t,this.sourceCache);e&&(this.terrainTileForTile[t.key]=e)}))}_prepareDEMTextures(){const t=this.painter.context,e=t.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(t.activeTexture.set(e.TEXTURE1),XS(this.painter,n,r))}}_prepareDemTileUniforms(t,e,i,n){if(!e||null==e.demTexture)return!1;const r=t.tileID.canonical,s=Math.pow(2,e.tileID.canonical.z-r.z),o=n||"";return i[`u_dem_tl${o}`]=[r.x*s%1,r.y*s%1],i[`u_dem_scale${o}`]=s,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const t=this.painter.context,e=t.gl;if(!this._emptyDepthBufferTexture){const i=new ef({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new My(t,i,e.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let t=0;const e=this._visibleDemTiles.reduce(((e,i)=>{if(!i.dem)return e;const n=i.dem.tree.minimums[0];return n>0&&t++,e+n}),0);return t?e/t:0}_updateEmptyDEMTexture(){const t=this.painter.context,e=t.gl;t.activeTexture.set(e.TEXTURE2);const i=this._getLoadedAreaMinimum(),[n,r]=(()=>{const t=new nf({width:1,height:1},new Float32Array([i]));return[e.R32F,t]})();this._emptyDEMTextureDirty=!1;let s=this._emptyDEMTexture;return s?s.update(r,{premultiply:!1}):s=this._emptyDEMTexture=new My(t,r,n,{premultiply:!1}),s}setupElevationDraw(t,e,i){const n=this.painter.context,r=n.gl,s={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0};s.u_exaggeration=this.exaggeration();let o=null,a=null,l=1;if(i&&i.morphing&&this._useVertexMorphing){const e=i.morphing.srcDemTile,n=i.morphing.dstDemTile;l=i.morphing.phase,e&&n&&(this._prepareDemTileUniforms(t,e,s,"_prev")&&(a=e),this._prepareDemTileUniforms(t,n,s)&&(o=n))}const c=t=>t&&t.demTexture&&this.painter.linearFloatFilteringSupported()?r.LINEAR:r.NEAREST,h=t=>{s.u_dem_size=1===t.size[0]?1:t.size[0]-2};if(a&&o)n.activeTexture.set(r.TEXTURE2),o.demTexture.bind(c(o),r.CLAMP_TO_EDGE),n.activeTexture.set(r.TEXTURE4),a.demTexture.bind(c(a),r.CLAMP_TO_EDGE),o.demTexture&&h(o.demTexture),s.u_dem_lerp=l;else{o=this.terrainTileForTile[t.tileID.key],n.activeTexture.set(r.TEXTURE2);const e=this._prepareDemTileUniforms(t,o,s)?o.demTexture:this.emptyDEMTexture;e.bind(c(o),r.CLAMP_TO_EDGE),h(e)}if(n.activeTexture.set(r.TEXTURE3),i&&i.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),this._depthFBO&&(s.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),s.u_depth_size_inv=[1,1]),i&&i.useMeterToDem&&o){const t=(1<<o.tileID.canonical.z)*tp(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;s.u_meter_to_dem=t}if(i&&i.labelPlaneMatrixInv&&(s.u_label_plane_matrix_inv=i.labelPlaneMatrixInv),e.setTerrainUniformValues(n,s),"globe"===this.painter.transform.projection.name){const r=this.globeUniformValues(this.painter.transform,t.tileID.canonical,i&&i.useDenormalizedUpVectorScale);e.setGlobeUniformValues(n,r)}}globeUniformValues(t,e,i){const n=t.projection;return{u_tile_tl_up:n.upVector(e,0,0),u_tile_tr_up:n.upVector(e,un,0),u_tile_br_up:n.upVector(e,un,un),u_tile_bl_up:n.upVector(e,0,un),u_tile_up_scale:i?ud(1):n.upVectorScale(e,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const e=this.painter,i=this.painter.context;0!==t.length&&(i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height]),e.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,e,i,n,r){if("globe"===t.transform.projection.name)!function(t,e,i,n,r){const s=t.context,o=s.gl;let a,l;const c=t.transform,h=zd(t,s,c),u=(e,i)=>{if(l===i)return;const n=[rT[i],"PROJECTION_GLOBE_VIEW"];h&&n.push("CUSTOM_ANTIALIASING");const r=t.isTileAffectedByFog(e);a=t.getOrCreateProgram("globeRaster",{defines:n,overrideFog:r}),l=i},d=t.colorModeForRenderPass(),p=new Mv(o.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D);nT.update(r);const f=Dd(c),m=[Qd(c.center.lng),Jd(c.center.lat)],g=t.globeSharedBuffers,_=[c.width*pe.devicePixelRatio,c.height*pe.devicePixelRatio],y=Float32Array.from(c.globeMatrix),v={useDenormalizedUpVectorScale:!0};{const c=t.transform,h=sT(c.zoom,e.exaggeration(),e.sourceCache._source.tileSize);l=-1;const b=o.TRIANGLES;for(const l of n){const n=i.getTile(l),x=Cv.disabled,w=e.prevTerrainTileForTile[l.key],E=e.terrainTileForTile[l.key];iT(w,E)&&nT.newMorphing(l.key,w,E,r,250),s.activeTexture.set(o.TEXTURE0),n.texture&&n.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE);const S=nT.getMorphValuesForProxy(l.key),T=S?1:0;S&&ze(v,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:M(S.phase)}});const A=bd(l.canonical),C=Fd(A.getCenter().lat),k=Rd(l.canonical,A,C,c.worldSize/c._pixelsPerMercatorPixel),P=Ad(md(l.canonical)),I=tT(c.expandedFarZProjMatrix,y,f,P,Od(c.zoom),m,c.frustumCorners.TL,c.frustumCorners.TR,c.frustumCorners.BR,c.frustumCorners.BL,c.globeCenterInViewSpace,c.globeRadius,_,h,k);if(u(l,T),a&&(e.setupElevationDraw(n,a,v),t.uploadCommonUniforms(s,a,l.toUnwrapped()),g)){const[e,i,n]=g.getGridBuffers(C,0!==h);a.draw(t,b,p,x,d,Ov.backCCW,I,"globe_raster",e,i,n)}}}if(g&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const r=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];h&&r.push("CUSTOM_ANTIALIASING"),a=t.getOrCreateProgram("globeRaster",{defines:r});for(const r of n){const{x:n,y:l,z:h}=r.canonical,u=0===l,f=l===(1<<h)-1,[y,b,x,w]=g.getPoleBuffers(h,!1);if(w&&(u||f)){const l=i.getTile(r);s.activeTexture.set(o.TEXTURE0),l.texture&&l.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE);let g=Ld(h,n,c);const E=Ad(md(r.canonical)),S=(e,i)=>e.draw(t,o.TRIANGLES,p,Cv.disabled,d,Ov.disabled,tT(c.expandedFarZProjMatrix,g,g,E,0,m,c.frustumCorners.TL,c.frustumCorners.TR,c.frustumCorners.BR,c.frustumCorners.BL,c.globeCenterInViewSpace,c.globeRadius,_,0),"globe_pole_raster",i,x,w);e.setupElevationDraw(l,a,v),t.uploadCommonUniforms(s,a,r.toUnwrapped()),u&&t.renderDefaultNorthPole&&S(a,y),f&&t.renderDefaultSouthPole&&(g=Au.scale(Au.create(),g,[1,-1,1]),S(a,b))}}}}(t,e,i,n,r);else{const s=t.context,o=s.gl;let a,l;const c=t.shadowRenderer,h=eT(t,t.longestCutoffRange),u=e=>{if(l===e)return;const i=[];i.push(rT[e]),h.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),a=t.getOrCreateProgram("terrainRaster",{defines:i}),l=e},d=t.colorModeForRenderPass(),p=new Mv(o.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D);nT.update(r);const f=t.transform,m=sT(f.zoom,e.exaggeration(),e.sourceCache._source.tileSize);let g=[0,0,0];if(c){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(g=ZM(e,i))}{l=-1;const _=o.TRIANGLES,[y,v]=[e.gridIndexBuffer,e.gridSegments];for(const l of n){const n=i.getTile(l),b=Cv.disabled,x=e.prevTerrainTileForTile[l.key],w=e.terrainTileForTile[l.key];iT(x,w)&&nT.newMorphing(l.key,x,w,r,250),s.activeTexture.set(o.TEXTURE0),n.texture&&n.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE);const E=nT.getMorphValuesForProxy(l.key),S=E?1:0;let T;E&&(T={morphing:{srcDemTile:E.from,dstDemTile:E.to,phase:M(E.phase)}});const A=JS(l.projMatrix,oT(l.canonical,f.renderWorldCopies)?m/10:m,g);if(u(S),!a)continue;e.setupElevationDraw(n,a,T);const C=l.toUnwrapped();c&&c.setupShadows(C,a),t.uploadCommonUniforms(s,a,C,null,h),a.draw(t,_,p,b,d,Ov.backCCW,A,"terrain_raster",e.gridBuffer,y,v)}}}}(e,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,e.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const e=this.painter,i=this.painter.context,n=this.proxySourceCache,r=this.proxiedCoords[n.id],s=this._drapedRenderBatches.shift(),o=e.style.order,a=[];let l=0;for(const c of r){const r=n.getTileByID(c.proxyTileKey),h=n.proxyCachedFBO[c.key]?n.proxyCachedFBO[c.key][t]:void 0,u=void 0!==h?n.renderCache[h]:this.pool[l++],d=void 0!==h;if(r.texture=u.tex,d&&!u.dirty){a.push(r.tileID);continue}let p;i.bindFramebuffer.set(u.fb.framebuffer),this.renderedToTile=!1,u.dirty&&(i.clear({color:ui.transparent,stencil:0}),u.dirty=!1);for(let t=s.start;t<=s.end;++t){const n=e.style._mergedLayers[o[t]];if(n.isHidden(e.transform.zoom))continue;const r=e.style.getLayerSourceCache(n),s=r?this.proxyToSource[c.key][r.id]:[c];if(!s)continue;const a=s;i.viewport.set([0,0,u.fb.width,u.fb.height]),p!==(r?r.id:null)&&(this._setupStencil(u,s,n,r),p=r?r.id:null),e.renderLayer(e,r,n,a)}if(0===this._drapedRenderBatches.length)for(const t of this._pendingGroundEffectLayers){const n=e.style._mergedLayers[o[t]];if(n.isHidden(e.transform.zoom))continue;const r=e.style.getLayerSourceCache(n),s=r?this.proxyToSource[c.key][r.id]:[c];if(!s)continue;const a=s;i.viewport.set([0,0,u.fb.width,u.fb.height]),p!==(r?r.id:null)&&(this._setupStencil(u,s,n,r),p=r?r.id:null),e.renderLayer(e,r,n,a)}this.renderedToTile?(u.dirty=!0,a.push(r.tileID)):d||--l,5===l&&(l=0,this.renderToBackBuffer(a))}return this.renderToBackBuffer(a),this.renderingToTexture=!1,i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height]),s.end+1}postRender(){}isLayerOrderingCorrect(t){const e=t.order.length;let i=-1,n=e;for(let r=0;r<e;++r)this._style.isLayerDraped(t._mergedLayers[t.order[r]])?i=Math.max(i,r):n=Math.min(n,r);return n>i}getMinElevationBelowMSL(){let t=0;return this._visibleDemTiles.filter((t=>t.dem)).forEach((e=>{t=Math.min(t,e.dem.tree.minimums[0])})),0===t?t:(t-30)*this._exaggeration}raycast(t,e,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter((t=>t.dem)).map((n=>{const r=n.tileID,s=1<<r.overscaledZ,{x:o,y:a}=r.canonical,l=o/s,c=(o+1)/s,h=a/s,u=(a+1)/s;return{minx:l,miny:h,maxx:c,maxy:u,t:n.dem.tree.raycastRoot(l,h,c,u,t,e,i),tile:n}}));n.sort(((t,e)=>(null!==t.t?t.t:Number.MAX_VALUE)-(null!==e.t?e.t:Number.MAX_VALUE)));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,t,e,i);if(null!=n)return n}return null}_createFBO(){const t=this.painter.context,e=t.gl,i=this.drapeBufferSize;t.activeTexture.set(e.TEXTURE0);const n=new My(t,{width:i[0],height:i[1],data:null},e.RGBA);n.bind(e.LINEAR,e.CLAMP_TO_EDGE);const r=t.createFramebuffer(i[0],i[1],!0,null);return r.colorAttachment.set(n.texture),r.depthAttachment=new Sv(t,r.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,i[0],i[1]),this._stencilRef=0,r.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):r.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&e.texParameterf(e.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:r,tex:n,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.hasLightTransitions())return!0;for(const t in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[t].hasTransition())return!0;return this._style.order.some((t=>{const e=this._style._mergedLayers[t],i=e.isHidden(this.painter.transform.zoom);return"custom"===e.type?!i&&e.shouldRedrape():!i&&e.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof Uw){t=!0;break}if(!t)return;const e={};for(let t=0;t<this._style.order.length;++t){const i=this._style._mergedLayers[this._style.order[t]],n=this._style.getLayerSourceCache(i);if(n&&!e[n.id]&&!i.isHidden(this.painter.transform.zoom)&&"line"===i.type&&i.widthExpression()instanceof Ms){e[n.id]=!0;for(const t of this.proxyCoords){const e=this.proxyToSource[t.key][n.id];if(e)for(const t of e)this._clearRenderCacheForTile(n.id,t)}}}}_clearRasterLayersFromRenderCache(){let t=!1;for(const e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e]._source instanceof $w){t=!0;break}if(!t)return;const e={};for(let t=0;t<this._style.order.length;++t){const i=this._style._mergedLayers[this._style.order[t]],n=this._style.getLayerSourceCache(i);if(!n||e[n.id])continue;if(i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;const r=i.paint.get("raster-fade-duration");for(const t of this.proxyCoords){const e=this.proxyToSource[t.key][n.id];if(e)for(const t of e){const e=lT(n.getTile(t),n.findLoadedParent(t,0),n,this.painter.transform,r);(1!==e.opacity||0!==e.mix)&&this._clearRenderCacheForTile(n.id,t)}}}}_setupDrapedRenderBatches(){const t=this._style.order,e=t.length;if(0===e)return;const i=[];this._pendingGroundEffectLayers=[];let n,r=0,s=this._style._mergedLayers[t[r]];for(;!this._style.isLayerDraped(s)&&s.isHidden(this.painter.transform.zoom)&&++r<e;)s=this._style._mergedLayers[t[r]];for(;r<e;++r){const e=this._style._mergedLayers[t[r]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===n&&(n=r):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(r),void 0!==n&&(i.push({start:n,end:r-1}),n=void 0)))}if(void 0!==n&&i.push({start:n,end:r-1}),0!==i.length){const t=i[i.length-1];this._pendingGroundEffectLayers.every((e=>e>t.end))||Y("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=i}_setupRenderCache(t){const e=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,e.renderCache.length>e.renderCachePool.length){const t=Object.values(e.proxyCachedFBO);e.proxyCachedFBO={};for(let i=0;i<t.length;++i){const n=Object.values(t[i]);e.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const i=this.proxyCoords,n=this._tilesDirty;for(let r=i.length-1;r>=0;r--){const s=i[r];if(e.getTileByID(s.key),void 0!==e.proxyCachedFBO[s.key]){const i=t[s.key],r=this.proxyToSource[s.key];let o=0;for(const t in r){const e=r[t],s=i[t];if(!s||s.length!==e.length||e.some(((e,i)=>e!==s[i]||n[t]&&n[t].hasOwnProperty(e.key)))){o=-1;break}++o}for(const t in e.proxyCachedFBO[s.key])e.renderCache[e.proxyCachedFBO[s.key][t]].dirty=o<0||o!==Object.values(i).length}}const r=[...this._drapedRenderBatches];r.sort(((t,e)=>e.end-e.start-(t.end-t.start)));for(const t of r)for(const n of i){if(e.proxyCachedFBO[n.key])continue;let i=e.renderCachePool.pop();void 0===i&&e.renderCache.length<50&&(i=e.renderCache.length,e.renderCache.push(this._createFBO())),void 0!==i&&(e.proxyCachedFBO[n.key]={},e.proxyCachedFBO[n.key][t.start]=i,e.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(t,e,i,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,s=r.gl;if(e.length<=1)return void(this._overlapStencilType=!1);let o;if(i.isTileClipped())o=e.length,this._overlapStencilMode.test={func:s.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(e[0].overscaledZ>e[e.length-1].overscaledZ))return void(this._overlapStencilType=!1);o=1,this._overlapStencilMode.test={func:s.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+o>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=o,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(e,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):Cv.disabled}_renderTileClippingMasks(t,e){const i=this.painter,n=this.painter.context,r=n.gl;i._tileClippingMaskIDs={},n.setColorMode(Pv.disabled),n.setDepthMode(Mv.disabled);const s=i.getOrCreateProgram("clippingMask");for(const n of t){const t=i._tileClippingMaskIDs[n.key]=--e;s.draw(i,r.TRIANGLES,Mv.disabled,new Cv({func:r.ALWAYS,mask:0},t,255,r.KEEP,r.KEEP,r.REPLACE),Pv.disabled,Ov.disabled,aT(n.projMatrix),"$clipping",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}pointCoordinate(t){const e=this.painter.transform;if(t.x<0||t.x>e.width||t.y<0||t.y>e.height)return null;const i=[t.x,t.y,1,1];vu.transformMat4(i,i,e.pixelMatrixInverse),vu.scale(i,i,1/i[3]),i[0]/=e.worldSize,i[1]/=e.worldSize;const n=e._camera.position,r=tp(1,e.center.lat),s=[n[0],n[1],n[2]/r,0],o=Ou.subtract([],i.slice(0,3),s);Ou.normalize(o,o);const a=this.raycast(s,o,this._exaggeration);return null!==a&&a?(Ou.scaleAndAdd(s,s,o,a),s[3]=s[2],s[2]*=r,s):null}drawDepth(){const t=this.painter,e=t.context,i=this.proxySourceCache,n=Math.ceil(t.width),r=Math.ceil(t.height);if(!this._depthFBO||this._depthFBO.width===n&&this._depthFBO.height===r||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const t=e.gl,i=e.createFramebuffer(n,r,!0,"renderbuffer");e.activeTexture.set(t.TEXTURE0);const s=new My(e,{width:n,height:r,data:null},t.RGBA);s.bind(t.NEAREST,t.CLAMP_TO_EDGE),i.colorAttachment.set(s.texture);const o=e.createRenderbuffer(e.gl.DEPTH_COMPONENT16,n,r);i.depthAttachment.set(o),this._depthFBO=i,this._depthTexture=s}e.bindFramebuffer.set(this._depthFBO.framebuffer),e.viewport.set([0,0,n,r]),function(t,e,i,n){if("globe"===t.transform.projection.name)return;const r=t.context,s=r.gl;r.clear({depth:1});const o=t.getOrCreateProgram("terrainDepth"),a=new Mv(s.LESS,Mv.ReadWrite,t.depthRangeFor3D);for(const r of n){const n=i.getTile(r),l=JS(r.projMatrix,0,[0,0,0]);e.setupElevationDraw(n,o),o.draw(t,s.TRIANGLES,a,Cv.disabled,Pv.unblended,Ov.backCCW,l,"terrain_depth",e.gridBuffer,e.gridIndexBuffer,e.gridNoSkirtSegments)}}(t,this,i,this.proxyCoords)}_setupProxiedCoordsForOrtho(t,e,i){if(t.getSource()instanceof Jx)return this._setupProxiedCoordsForImageSource(t,e,i);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const n=this.proxiedCoords[t.id]=[],r=this.proxyCoords;for(let e=0;e<r.length;e++){const s=r[e],o=this._findTileCoveringTileID(s,t);if(o){const e=this._createProxiedId(s,o,i[s.key]&&i[s.key][t.id]);n.push(e),this.proxyToSource[s.key][t.id]=[e]}}let s=!1;for(let r=0;r<e.length;r++){const o=t.getTile(e[r]);if(!o||!o.hasData())continue;const a=this._findTileCoveringTileID(o.tileID,this.proxySourceCache);if(a&&a.tileID.canonical.z!==o.tileID.canonical.z){const e=this.proxyToSource[a.tileID.key][t.id],r=this._createProxiedId(a.tileID,o,i[a.tileID.key]&&i[a.tileID.key][t.id]);e?e.splice(e.length-1,0,r):this.proxyToSource[a.tileID.key][t.id]=[r],n.push(r),s=!0}}this._sourceTilesOverlap[t.id]=s}_setupProxiedCoordsForImageSource(t,e,i){if(!t.getSource().loaded())return;const n=this.proxiedCoords[t.id]=[],r=this.proxyCoords,s=t.getSource(),o=s.tileID;if(!o)return;const a=new v(o.x,o.y)._div(1<<o.z),l=s.coordinates.map(cp.fromLngLat).reduce(((t,e)=>(t.min.x=Math.min(t.min.x,e.x-a.x),t.min.y=Math.min(t.min.y,e.y-a.y),t.max.x=Math.max(t.max.x,e.x-a.x),t.max.y=Math.max(t.max.y,e.y-a.y),t)),{min:new v(Number.MAX_VALUE,Number.MAX_VALUE),max:new v(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(t,e)=>{const i=t.wrap+t.canonical.x/(1<<t.canonical.z),n=t.canonical.y/(1<<t.canonical.z),r=un/(1<<t.canonical.z),s=e.wrap+e.canonical.x/(1<<e.canonical.z),o=e.canonical.y/(1<<e.canonical.z);return i+r<s+l.min.x||i>s+l.max.x||n+r<o+l.min.y||n>o+l.max.y};for(let s=0;s<r.length;s++){const o=r[s];for(let r=0;r<e.length;r++){const s=t.getTile(e[r]);if(!s||!s.hasData())continue;if(c(o,s.tileID))continue;const a=this._createProxiedId(o,s,i[o.key]&&i[o.key][t.id]),l=this.proxyToSource[o.key][t.id];l?l.push(a):this.proxyToSource[o.key][t.id]=[a],n.push(a)}}}_createProxiedId(t,e,i){let n=this.orthoMatrix;if(i){const t=i.find((t=>t.key===e.tileID.key));if(t)return t}if(e.tileID.key!==t.key){const i=t.canonical.z-e.tileID.canonical.z;let r,s,o;n=Au.create();const a=e.tileID.wrap-t.wrap<<t.overscaledZ;i>0?(r=un>>i,s=r*((e.tileID.canonical.x<<i)-t.canonical.x+a),o=r*((e.tileID.canonical.y<<i)-t.canonical.y)):(r=un<<-i,s=un*(e.tileID.canonical.x-(t.canonical.x+a<<-i)),o=un*(e.tileID.canonical.y-(t.canonical.y<<-i))),Au.ortho(n,0,r,0,r,0,1),Au.translate(n,n,[s,o,0])}return new uT(e.tileID,t.key,n)}_findTileCoveringTileID(t,e){let i=e.getTile(t);if(i&&i.hasData())return i;const n=this._findCoveringTileCache[e.id],r=n[t.key];if(i=r?e.getTileByID(r):null,i&&i.hasData()||null===r)return i;let s=i?i.tileID:t,o=s.overscaledZ;const a=e.getSource().minzoom,l=[];if(!r){const n=e.getSource().maxzoom;if(t.canonical.z>=n){const i=t.canonical.z-n;e.getSource().reparseOverscaled?(o=Math.max(t.canonical.z+2,e.transform.tileZoom),s=new qu(o,t.wrap,n,t.canonical.x>>i,t.canonical.y>>i)):0!==i&&(o=n,s=new qu(o,t.wrap,n,t.canonical.x>>i,t.canonical.y>>i))}s.key!==t.key&&(l.push(s.key),i=e.getTile(s))}const c=t=>{l.forEach((e=>{n[e]=t})),l.length=0};for(o-=1;o>=a&&(!i||!i.hasData());o--){i&&c(i.tileID.key);const t=s.calculateScaledKey(o);if(i=e.getTileByID(t),i&&i.hasData())break;const r=n[t];if(null===r)break;void 0===r?l.push(t):i=e.getTileByID(r)}return c(i?i.tileID.key:null),i&&i.hasData()?i:null}findDEMTileFor(t){return this.enabled?this._findTileCoveringTileID(t,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(t,e){let i=this._tilesDirty[t];i||(i=this._tilesDirty[t]={}),i[e.key]=!0}}function pT(t,e,i){const n=function(t,e,i){const n=Ou.dot(e,t),r=Ou.dot(i,[.2126,.7152,.0722]),s=(t,e,i)=>(1-i)*t+i*e,o=s(1-.3*Math.min(r,1),1,Math.min(n+1,1));return s(.92,1,Math.asin(I(e[2],-1,1))/Math.PI+.5)*o}(t,[0,0,1],e),r=[0,0,0];Ou.scale(r,i.slice(0,3),n);const s=[0,0,0];Ou.scale(s,e.slice(0,3),t[2]);const o=[0,0,0];return Ou.add(o,r,s),lt(o)}const fT=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],mT=["stars","fillExtrusion","fillExtrusionGroundEffect","model","symbolSDF","symbolIcon","symbolTextAndIcon"];class gT{static cacheKey(t,e,i,n){let r=`${e}${n?n.cacheKey:""}`;for(const e of i)t.usedDefines.includes(e)&&(r+=`/${e}`);return r}constructor(t,e,i,n,r,s){const o=t.gl;this.program=o.createProgram(),this.configuration=n,this.name=e,this.fixedDefines=[...s];const a=n?n.getBinderAttributes():[],l=(i.staticAttributes||[]).concat(a);let c=n?n.defines():[];c=c.concat(s.map((t=>`#define ${t}`)));const h="#version 300 es\n";let u=h+c.concat("precision mediump float;",$S,US.fragmentSource).join("\n");for(const t of i.fragmentIncludes)u+=`\n${jS[t]}`;u+=`\n${i.fragmentSource}`;let d=h+c.concat("precision highp float;",$S,US.vertexSource).join("\n");for(const t of i.vertexIncludes)d+=`\n${jS[t]}`;d+=`\n${i.vertexSource}`;const p=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())return void(this.failedToCreate=!0);o.shaderSource(p,u),o.compileShader(p),o.attachShader(this.program,p);const f=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(f,d),o.compileShader(f),o.attachShader(this.program,f),this.attributes={},this.numAttributes=l.length;for(let t=0;t<this.numAttributes;t++)if(l[t]){const e=l[t].startsWith("a_")?l[t]:`a_${l[t]}`;o.bindAttribLocation(this.program,t,e),this.attributes[e]=t}o.linkProgram(this.program),o.deleteShader(f),o.deleteShader(p),this.fixedUniforms=r(t),this.binderUniforms=n?n.getUniforms(t):[],s.includes("TERRAIN")&&(this.terrainUniforms=(t=>({u_dem:new Rl(t),u_dem_prev:new Rl(t),u_dem_tl:new Bl(t),u_dem_scale:new Fl(t),u_dem_tl_prev:new Bl(t),u_dem_scale_prev:new Fl(t),u_dem_size:new Fl(t),u_dem_lerp:new Fl(t),u_exaggeration:new Fl(t),u_depth:new Rl(t),u_depth_size_inv:new Bl(t),u_meter_to_dem:new Fl(t),u_label_plane_matrix_inv:new $l(t)}))(t)),s.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new Nl(t),u_tile_tr_up:new Nl(t),u_tile_br_up:new Nl(t),u_tile_bl_up:new Nl(t),u_tile_up_scale:new Fl(t)}))(t)),s.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new $l(t),u_fog_range:new Bl(t),u_fog_color:new jl(t),u_fog_horizon_blend:new Fl(t),u_fog_vertical_limit:new Bl(t),u_fog_temporal_offset:new Fl(t),u_frustum_tl:new Nl(t),u_frustum_tr:new Nl(t),u_frustum_br:new Nl(t),u_frustum_bl:new Nl(t),u_globe_pos:new Nl(t),u_globe_radius:new Fl(t),u_globe_transition:new Fl(t),u_is_globe:new Rl(t),u_viewport:new Bl(t)}))(t)),s.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new jl(t)}))(t)),s.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new Nl(t),u_lighting_directional_dir:new Nl(t),u_lighting_directional_color:new Nl(t),u_ground_radiance:new Nl(t)}))(t)),s.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new $l(t),u_light_matrix_1:new $l(t),u_fade_range:new Bl(t),u_shadow_normal_offset:new Nl(t),u_shadow_intensity:new Fl(t),u_shadow_texel_size:new Fl(t),u_shadow_map_resolution:new Fl(t),u_shadow_direction:new Nl(t),u_shadow_bias:new Nl(t),u_shadowmap_0:new Rl(t),u_shadowmap_1:new Rl(t)}))(t))}}setTerrainUniformValues(t,e){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t]&&i[t].set(this.program,t,e[t])}}setGlobeUniformValues(t,e){if(!this.globeUniforms)return;const i=this.globeUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t]&&i[t].set(this.program,t,e[t])}}setFogUniformValues(t,e){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].set(this.program,t,e[t])}}setCutoffUniformValues(t,e){if(!this.cutoffUniforms)return;const i=this.cutoffUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].set(this.program,t,e[t])}}setLightsUniformValues(t,e){if(!this.lightsUniforms)return;const i=this.lightsUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].set(this.program,t,e[t])}}setShadowUniformValues(t,e){if(this.failedToCreate||!this.shadowUniforms)return;const i=this.shadowUniforms;t.program.set(this.program);for(const t in e)i[t].set(this.program,t,e[t])}_drawDebugWireframe(t,e,i,n,r,s,o,a,l,c){const h=t.options.wireframe;if(!1===h.terrain&&!1===h.layers2D&&!1===h.layers3D)return;const u=t.context;if(!(()=>!(!h.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!h.layers2D||t._terrain&&t._terrain.renderingToTexture||!fT.includes(this.name))||!(!h.layers3D||!mT.includes(this.name)))())return;const d=u.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,r,u);if(!p)return;const f=[...this.fixedDefines];f.push("DEBUG_WIREFRAME");const m=t.getOrCreateProgram(this.name,{config:this.configuration,defines:f});u.program.set(m.program);const g=(t,e,i)=>{if(e[t]&&i[t])for(const n in e[t])i[t][n]&&i[t][n].set(i.program,n,e[t][n].current)};l&&l.setUniforms(m.program,u,m.binderUniforms,o,{zoom:a}),g("fixedUniforms",this,m),g("terrainUniforms",this,m),g("globeUniforms",this,m),g("fogUniforms",this,m),g("lightsUniforms",this,m),g("shadowUniforms",this,m),p.bind(),u.setColorMode(new Pv([d.ONE,d.ONE_MINUS_SRC_ALPHA,d.ZERO,d.ONE],ui.transparent,[!0,!0,!0,!1])),u.setDepthMode(new Mv(e.func===d.LESS?d.LEQUAL:e.func,Mv.ReadOnly,e.range)),u.setStencilMode(Cv.disabled);const _=3*s.primitiveLength*2,y=3*s.primitiveOffset*2*2;c&&c>1?d.drawElementsInstanced(d.LINES,_,d.UNSIGNED_SHORT,y,c):d.drawElements(d.LINES,_,d.UNSIGNED_SHORT,y),r.bind(),u.program.set(this.program),u.setDepthMode(e),u.setStencilMode(i),u.setColorMode(n)}draw(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m){const g=t.context,_=g.gl;if(this.failedToCreate)return;g.program.set(this.program),g.setDepthMode(i),g.setStencilMode(n),g.setColorMode(r),g.setCullFace(s);for(const t of Object.keys(this.fixedUniforms))this.fixedUniforms[t].set(this.program,t,o[t]);p&&p.setUniforms(this.program,g,this.binderUniforms,u,{zoom:d});const y={[_.LINES]:2,[_.TRIANGLES]:3,[_.LINE_STRIP]:1}[e],v=m&&m>0?1:void 0;for(const s of h.get()){const o=s.vaos||(s.vaos={});(o[a]||(o[a]=new GS)).bind(g,this,l,p?p.getPaintVertexBuffers():[],c,s.vertexOffset,f||[],v),m&&m>1?_.drawElementsInstanced(e,s.primitiveLength*y,_.UNSIGNED_SHORT,s.primitiveOffset*y*2,m):_.drawElements(e,s.primitiveLength*y,_.UNSIGNED_SHORT,s.primitiveOffset*y*2),e===_.TRIANGLES&&this._drawDebugWireframe(t,i,n,r,c,s,u,d,p,m)}}}function _T(t,e){const i=Math.pow(2,e.tileID.overscaledZ),n=e.tileSize*Math.pow(2,t.transform.tileZoom)/i,r=n*(e.tileID.canonical.x+e.tileID.wrap*i),s=n*e.tileID.canonical.y;return{u_image:0,u_texsize:e.imageAtlasTexture?e.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/rb(e,1,t.transform.tileZoom),u_pixel_coord_upper:[r>>16,s>>16],u_pixel_coord_lower:[65535&r,65535&s]}}const yT=Au.create(),vT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m)=>{const g=e.style.light,_=g.properties.get("position"),y=[_.x,_.y,_.z],v=Tu.create();"viewport"===g.properties.get("anchor")&&(Tu.fromRotation(v,-e.transform.angle),Ou.transformMat3(y,y,v));const b=g.properties.get("color"),x=e.transform,w={u_matrix:t,u_lightpos:y,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_vertical_gradient:+i,u_opacity:n,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yT,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:r,u_edge_radius:s,u_flood_light_color:u,u_vertical_scale:d,u_flood_light_intensity:p,u_ground_shadow_factor:f,u_emissive_strength:m};return"globe"===x.projection.name&&(w.u_tile_id=[o.canonical.x,o.canonical.y,1<<o.canonical.z],w.u_zoom_transition=l,w.u_inv_rot_matrix=h,w.u_merc_center=c,w.u_up_dir=x.projection.upVector(new $u(0,0,0),c[0]*un,c[1]*un),w.u_height_lift=a),w},bT=(t,e,i)=>({u_matrix:t,u_edge_radius:e,u_vertical_scale:i}),xT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p)=>{const f=vT(t,e,i,n,r,s,o,l,c,h,u,d,p,1,[0,0,0],0),m={u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8};return R(f,_T(e,a),m)},wT=(t,e)=>({u_matrix:t,u_emissive_strength:e}),ET=(t,e,i,n)=>R(wT(t,e),_T(i,n)),ST=(t,e,i)=>({u_matrix:t,u_world:i,u_emissive_strength:e}),TT=(t,e,i,n,r)=>R(ET(t,e,i,n),{u_world:r}),MT=(t,e,i,n)=>{const r=un/i.tileSize;return{u_matrix:t,u_camera_to_center_distance:e.getCameraToCenterDistance(n),u_extrude_scale:[e.pixelsToGLUnits[0]/r,e.pixelsToGLUnits[1]/r]}},AT=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),CT=Au.create(),kT=(t,e,i,n,r,s,o)=>{const a=t.transform,l="globe"===a.projection.name,c=l?Pd(a.zoom,e.canonical)*a._pixelsPerMercatorPixel:rb(i,1,s),h={u_matrix:e.projMatrix,u_extrude_scale:c,u_intensity:o,u_inv_rot_matrix:CT,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(l){h.u_inv_rot_matrix=n,h.u_merc_center=r,h.u_tile_id=[e.canonical.x,e.canonical.y,1<<e.canonical.z],h.u_zoom_transition=Od(a.zoom);const t=r[0]*un,i=r[1]*un;h.u_up_dir=a.projection.upVector(new $u(0,0,0),t,i)}return h},PT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x)=>{return{u_matrix:t,u_normalize_matrix:e,u_globe_matrix:i,u_merc_matrix:n,u_grid_matrix:r,u_tl_parent:s,u_scale_parent:h,u_fade_t:u.mix,u_opacity:u.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(E=d.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(w=d.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:IT(d.paint.get("raster-hue-rotate")),u_perspective_transform:p,u_raster_elevation:f,u_tl_br:o,u_zoom_transition:a,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:DT(g,y),u_colorization_offset:OT(_,y),u_color_ramp:m,u_texture_offset:[b/(v+2*b),v/(v+2*b)],u_texture_res:[v+2*b,v+2*b],u_emissive_strength:x};var w,E};function IT(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}function DT([t,e,i,n],[r,s]){if(r===s)return[0,0,0,0];const o=259/257/(s-r);return[t*o,e*o,i*o,n*o]}function OT(t,[e,i]){return e===i?0:((t-e)/(i-e)*259-1)/257}const LT=Au.create(),zT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_)=>{const y=r.transform,v={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:y.getCameraToCenterDistance(m),u_rotate_symbol:+i,u_aspect_ratio:y.width/y.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:o,u_coord_matrix:a,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:LT,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:LT,u_up_vector:[0,-1,0],u_icon_transition:_||0,u_icon_saturation:g};return"globe"===m.name&&(v.u_tile_id=[h.canonical.x,h.canonical.y,1<<h.canonical.z],v.u_zoom_transition=u,v.u_inv_rot_matrix=p,v.u_merc_center=d,v.u_camera_forward=y._camera.forward(),v.u_ecef_origin=function(t,e){const i=[0,0,0],n=Ad(md(e.canonical));return Ou.transformMat4(i,i,n),Ou.transformMat4(i,i,t),i}(y.globeMatrix,h.toUnwrapped()),v.u_tile_matrix=Float32Array.from(y.globeMatrix),v.u_up_vector=f),v},RT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g)=>R(zT(t,e,i,n,r,s,o,a,l,c,u,d,p,f,m,g,1),{u_gamma_scale:n?r.transform.getCameraToCenterDistance(g)*Math.cos(r.terrain?0:r.transform._pitch):1,u_device_pixel_ratio:pe.devicePixelRatio,u_is_halo:+h,undefined:void 0}),FT=(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m)=>R(RT(t,e,i,n,r,s,o,a,!0,l,!0,h,u,d,p,f,m),{u_texsize_icon:c,u_texture_icon:1}),BT=(t,e,i,n)=>({u_matrix:t,u_emissive_strength:e,u_opacity:i,u_color:n}),NT=(t,e,i,n,r,s,o)=>R(function(t,e,i,n){const r=i.imageManager.getPattern(t.toString(),e),{width:s,height:o}=i.imageManager.getPixelSize(e),a=Math.pow(2,n.tileID.overscaledZ),l=n.tileSize*Math.pow(2,i.transform.tileZoom)/a,c=l*(n.tileID.canonical.x+n.tileID.wrap*a),h=l*n.tileID.canonical.y;return{u_image:0,u_pattern_tl:r.tl,u_pattern_br:r.br,u_texsize:[s,o],u_pattern_size:r.displaySize,u_tile_units_to_pixels:1/rb(n,1,i.transform.tileZoom),u_pixel_coord_upper:[c>>16,h>>16],u_pixel_coord_lower:[65535&c,65535&h]}}(r,s,n,o),{u_matrix:t,u_emissive_strength:e,u_opacity:i}),jT={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,ShadowMap0:10},VT=(t,e,i,n,r,s,o,a,l,c,h,u,d=[0,0,0])=>{const p=n.style.light,f=p.properties.get("position"),m=[-f.x,-f.y,f.z],g=Tu.create();"viewport"===p.properties.get("anchor")&&(Tu.fromRotation(g,-n.transform.angle),Ou.transformMat3(m,m,g));const _="MASK"===c.alphaMode,y=p.properties.get("color"),v=u.paint.get("model-ambient-occlusion-intensity"),b=u.paint.get("model-color").constantOr(ui.white),x=u.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:t,u_lighting_matrix:e,u_normal_matrix:i,u_lightpos:m,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_camera_pos:d,u_opacity:r,u_baseTextureIsAlpha:0,u_alphaMask:+_,u_alphaCutoff:c.alphaCutoff,u_baseColorFactor:[s.r,s.g,s.b,s.a],u_emissiveFactor:[o[0],o[1],o[2],1],u_metallicFactor:a,u_roughnessFactor:l,u_baseColorTexture:jT.BaseColor,u_metallicRoughnessTexture:jT.MetallicRoughness,u_normalTexture:jT.Normal,u_occlusionTexture:jT.Occlusion,u_emissionTexture:jT.Emission,u_color_mix:[b.r,b.g,b.b,x],u_aoIntensity:v,u_emissive_strength:h}},UT=new Float32Array(16),$T=(t,e=UT,i=UT)=>({u_matrix:t,u_instance:e,u_node_matrix:i}),HT={fillExtrusion:t=>({u_matrix:new $l(t),u_lightpos:new Nl(t),u_lightintensity:new Fl(t),u_lightcolor:new Nl(t),u_vertical_gradient:new Fl(t),u_opacity:new Fl(t),u_edge_radius:new Fl(t),u_ao:new Bl(t),u_tile_id:new Nl(t),u_zoom_transition:new Fl(t),u_inv_rot_matrix:new $l(t),u_merc_center:new Bl(t),u_up_dir:new Nl(t),u_height_lift:new Fl(t),u_flood_light_color:new Nl(t),u_vertical_scale:new Fl(t),u_flood_light_intensity:new Fl(t),u_ground_shadow_factor:new Nl(t),u_emissive_strength:new Fl(t)}),fillExtrusionDepth:t=>({u_matrix:new $l(t),u_edge_radius:new Fl(t),u_vertical_scale:new Fl(t)}),fillExtrusionPattern:t=>({u_matrix:new $l(t),u_lightpos:new Nl(t),u_lightintensity:new Fl(t),u_lightcolor:new Nl(t),u_vertical_gradient:new Fl(t),u_height_factor:new Fl(t),u_edge_radius:new Fl(t),u_ao:new Bl(t),u_tile_id:new Nl(t),u_zoom_transition:new Fl(t),u_inv_rot_matrix:new $l(t),u_merc_center:new Bl(t),u_up_dir:new Nl(t),u_height_lift:new Fl(t),u_image:new Rl(t),u_texsize:new Bl(t),u_pixel_coord_upper:new Bl(t),u_pixel_coord_lower:new Bl(t),u_tile_units_to_pixels:new Fl(t),u_opacity:new Fl(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new $l(t),u_opacity:new Fl(t),u_ao_pass:new Fl(t),u_meter_to_tile:new Fl(t),u_ao:new Bl(t),u_flood_light_intensity:new Fl(t),u_flood_light_color:new Nl(t),u_attenuation:new Fl(t),u_edge_radius:new Fl(t),u_fb:new Rl(t),u_fb_size:new Fl(t)}),fill:t=>({u_matrix:new $l(t),u_emissive_strength:new Fl(t)}),fillPattern:t=>({u_matrix:new $l(t),u_emissive_strength:new Fl(t),u_image:new Rl(t),u_texsize:new Bl(t),u_pixel_coord_upper:new Bl(t),u_pixel_coord_lower:new Bl(t),u_tile_units_to_pixels:new Fl(t)}),fillOutline:t=>({u_matrix:new $l(t),u_emissive_strength:new Fl(t),u_world:new Bl(t)}),fillOutlinePattern:t=>({u_matrix:new $l(t),u_emissive_strength:new Fl(t),u_world:new Bl(t),u_image:new Rl(t),u_texsize:new Bl(t),u_pixel_coord_upper:new Bl(t),u_pixel_coord_lower:new Bl(t),u_tile_units_to_pixels:new Fl(t)}),circle:t=>({u_camera_to_center_distance:new Fl(t),u_extrude_scale:new Gl(t),u_device_pixel_ratio:new Fl(t),u_matrix:new $l(t),u_inv_rot_matrix:new $l(t),u_merc_center:new Bl(t),u_tile_id:new Nl(t),u_zoom_transition:new Fl(t),u_up_dir:new Nl(t),u_emissive_strength:new Fl(t)}),collisionBox:t=>({u_matrix:new $l(t),u_camera_to_center_distance:new Fl(t),u_extrude_scale:new Bl(t)}),collisionCircle:t=>({u_matrix:new $l(t),u_inv_matrix:new $l(t),u_camera_to_center_distance:new Fl(t),u_viewport_size:new Bl(t)}),debug:t=>({u_color:new Vl(t),u_matrix:new $l(t),u_overlay:new Rl(t),u_overlay_scale:new Fl(t)}),clippingMask:t=>({u_matrix:new $l(t)}),heatmap:t=>({u_extrude_scale:new Fl(t),u_intensity:new Fl(t),u_matrix:new $l(t),u_inv_rot_matrix:new $l(t),u_merc_center:new Bl(t),u_tile_id:new Nl(t),u_zoom_transition:new Fl(t),u_up_dir:new Nl(t)}),heatmapTexture:t=>({u_image:new Rl(t),u_color_ramp:new Rl(t),u_opacity:new Fl(t)}),hillshade:t=>({u_matrix:new $l(t),u_image:new Rl(t),u_latrange:new Bl(t),u_light:new Bl(t),u_shadow:new Vl(t),u_highlight:new Vl(t),u_emissive_strength:new Fl(t),u_accent:new Vl(t)}),hillshadePrepare:t=>({u_matrix:new $l(t),u_image:new Rl(t),u_dimension:new Bl(t),u_zoom:new Fl(t)}),line:t=>({u_matrix:new $l(t),u_pixels_to_tile_units:new Gl(t),u_device_pixel_ratio:new Fl(t),u_units_to_pixels:new Bl(t),u_dash_image:new Rl(t),u_gradient_image:new Rl(t),u_image_height:new Fl(t),u_texsize:new Bl(t),u_tile_units_to_pixels:new Fl(t),u_alpha_discard_threshold:new Fl(t),u_trim_offset:new Bl(t),u_emissive_strength:new Fl(t)}),linePattern:t=>({u_matrix:new $l(t),u_texsize:new Bl(t),u_pixels_to_tile_units:new Gl(t),u_device_pixel_ratio:new Fl(t),u_image:new Rl(t),u_units_to_pixels:new Bl(t),u_tile_units_to_pixels:new Fl(t),u_alpha_discard_threshold:new Fl(t)}),raster:t=>({u_matrix:new $l(t),u_normalize_matrix:new $l(t),u_globe_matrix:new $l(t),u_merc_matrix:new $l(t),u_grid_matrix:new ql(t),u_tl_parent:new Bl(t),u_scale_parent:new Fl(t),u_fade_t:new Fl(t),u_opacity:new Fl(t),u_image0:new Rl(t),u_image1:new Rl(t),u_brightness_low:new Fl(t),u_brightness_high:new Fl(t),u_saturation_factor:new Fl(t),u_contrast_factor:new Fl(t),u_spin_weights:new Nl(t),u_perspective_transform:new Bl(t),u_raster_elevation:new Fl(t),u_tl_br:new jl(t),u_zoom_transition:new Fl(t),u_merc_center:new Bl(t),u_cutoff_params:new jl(t),u_colorization_mix:new jl(t),u_colorization_offset:new Fl(t),u_color_ramp:new Rl(t),u_texture_offset:new Bl(t),u_texture_res:new Bl(t),u_emissive_strength:new Fl(t)}),symbolIcon:t=>({u_is_size_zoom_constant:new Rl(t),u_is_size_feature_constant:new Rl(t),u_size_t:new Fl(t),u_size:new Fl(t),u_camera_to_center_distance:new Fl(t),u_rotate_symbol:new Rl(t),u_aspect_ratio:new Fl(t),u_fade_change:new Fl(t),u_matrix:new $l(t),u_label_plane_matrix:new $l(t),u_coord_matrix:new $l(t),u_is_text:new Rl(t),u_pitch_with_map:new Rl(t),u_texsize:new Bl(t),u_tile_id:new Nl(t),u_zoom_transition:new Fl(t),u_inv_rot_matrix:new $l(t),u_merc_center:new Bl(t),u_camera_forward:new Nl(t),u_tile_matrix:new $l(t),u_up_vector:new Nl(t),u_ecef_origin:new Nl(t),u_texture:new Rl(t),u_icon_transition:new Fl(t),u_icon_saturation:new Fl(t)}),symbolSDF:t=>({u_is_size_zoom_constant:new Rl(t),u_is_size_feature_constant:new Rl(t),u_size_t:new Fl(t),u_size:new Fl(t),u_camera_to_center_distance:new Fl(t),u_rotate_symbol:new Rl(t),u_aspect_ratio:new Fl(t),u_fade_change:new Fl(t),u_matrix:new $l(t),u_label_plane_matrix:new $l(t),u_coord_matrix:new $l(t),u_is_text:new Rl(t),u_pitch_with_map:new Rl(t),u_texsize:new Bl(t),u_texture:new Rl(t),u_gamma_scale:new Fl(t),u_device_pixel_ratio:new Fl(t),u_tile_id:new Nl(t),u_zoom_transition:new Fl(t),u_inv_rot_matrix:new $l(t),u_merc_center:new Bl(t),u_camera_forward:new Nl(t),u_tile_matrix:new $l(t),u_up_vector:new Nl(t),u_ecef_origin:new Nl(t),u_is_halo:new Rl(t)}),symbolTextAndIcon:t=>({u_is_size_zoom_constant:new Rl(t),u_is_size_feature_constant:new Rl(t),u_size_t:new Fl(t),u_size:new Fl(t),u_camera_to_center_distance:new Fl(t),u_rotate_symbol:new Rl(t),u_aspect_ratio:new Fl(t),u_fade_change:new Fl(t),u_matrix:new $l(t),u_label_plane_matrix:new $l(t),u_coord_matrix:new $l(t),u_is_text:new Rl(t),u_pitch_with_map:new Rl(t),u_texsize:new Bl(t),u_texsize_icon:new Bl(t),u_texture:new Rl(t),u_texture_icon:new Rl(t),u_gamma_scale:new Fl(t),u_device_pixel_ratio:new Fl(t),u_is_halo:new Rl(t)}),background:t=>({u_matrix:new $l(t),u_emissive_strength:new Fl(t),u_opacity:new Fl(t),u_color:new Vl(t)}),backgroundPattern:t=>({u_matrix:new $l(t),u_emissive_strength:new Fl(t),u_opacity:new Fl(t),u_image:new Rl(t),u_pattern_tl:new Bl(t),u_pattern_br:new Bl(t),u_texsize:new Bl(t),u_pattern_size:new Bl(t),u_pixel_coord_upper:new Bl(t),u_pixel_coord_lower:new Bl(t),u_tile_units_to_pixels:new Fl(t)}),terrainRaster:QS,terrainDepth:QS,skybox:t=>({u_matrix:new $l(t),u_sun_direction:new Nl(t),u_cubemap:new Rl(t),u_opacity:new Fl(t),u_temporal_offset:new Fl(t)}),skyboxGradient:t=>({u_matrix:new $l(t),u_color_ramp:new Rl(t),u_center_direction:new Nl(t),u_radius:new Fl(t),u_opacity:new Fl(t),u_temporal_offset:new Fl(t)}),skyboxCapture:t=>({u_matrix_3f:new ql(t),u_sun_direction:new Nl(t),u_sun_intensity:new Fl(t),u_color_tint_r:new jl(t),u_color_tint_m:new jl(t),u_luminance:new Fl(t)}),globeRaster:t=>({u_proj_matrix:new $l(t),u_globe_matrix:new $l(t),u_normalize_matrix:new $l(t),u_merc_matrix:new $l(t),u_zoom_transition:new Fl(t),u_merc_center:new Bl(t),u_image0:new Rl(t),u_grid_matrix:new ql(t),u_skirt_height:new Fl(t),u_frustum_tl:new Nl(t),u_frustum_tr:new Nl(t),u_frustum_br:new Nl(t),u_frustum_bl:new Nl(t),u_globe_pos:new Nl(t),u_globe_radius:new Fl(t),u_viewport:new Bl(t)}),globeAtmosphere:t=>({u_frustum_tl:new Nl(t),u_frustum_tr:new Nl(t),u_frustum_br:new Nl(t),u_frustum_bl:new Nl(t),u_horizon:new Fl(t),u_transition:new Fl(t),u_fadeout_range:new Fl(t),u_color:new jl(t),u_high_color:new jl(t),u_space_color:new jl(t),u_temporal_offset:new Fl(t),u_horizon_angle:new Fl(t)}),model:t=>({u_matrix:new $l(t),u_lighting_matrix:new $l(t),u_normal_matrix:new $l(t),u_lightpos:new Nl(t),u_lightintensity:new Fl(t),u_lightcolor:new Nl(t),u_camera_pos:new Nl(t),u_opacity:new Fl(t),u_baseColorFactor:new jl(t),u_emissiveFactor:new jl(t),u_metallicFactor:new Fl(t),u_roughnessFactor:new Fl(t),u_baseTextureIsAlpha:new Rl(t),u_alphaMask:new Rl(t),u_alphaCutoff:new Fl(t),u_baseColorTexture:new Rl(t),u_metallicRoughnessTexture:new Rl(t),u_normalTexture:new Rl(t),u_occlusionTexture:new Rl(t),u_emissionTexture:new Rl(t),u_color_mix:new jl(t),u_aoIntensity:new Fl(t),u_emissive_strength:new Fl(t)}),modelDepth:t=>({u_matrix:new $l(t),u_instance:new $l(t),u_node_matrix:new $l(t)}),groundShadow:t=>({u_matrix:new $l(t),u_ground_shadow_factor:new Nl(t)}),stars:t=>({u_matrix:new $l(t),u_up:new Nl(t),u_right:new Nl(t),u_intensity_multiplier:new Fl(t)})};let qT;function WT(t,e,i,n,r,s,o){const a=t.context,l=a.gl,c=t.transform,h=t.getOrCreateProgram("collisionBox"),u=[];let d=0,p=0;for(let a=0;a<n.length;a++){const f=n[a],m=e.getTile(f),g=m.getBucket(i);if(!g)continue;const _=XE(f,g,c);let y=_;0===r[0]&&0===r[1]||(y=t.translatePosMatrix(_,m,r,s));const v=o?g.textCollisionBox:g.iconCollisionBox,b=g.collisionCircleArray;if(b.length>0){const t=Au.create(),e=y;Au.mul(t,g.placementInvProjMatrix,c.glCoordMatrix),Au.mul(t,t,g.placementViewportMatrix),u.push({circleArray:b,circleOffset:p,transform:e,invTransform:t,projection:g.getProjection()}),d+=b.length/4,p=d}v&&(t.terrain&&t.terrain.setupElevationDraw(m,h),h.draw(t,l.LINES,Mv.disabled,Cv.disabled,t.colorModeForRenderPass(),Ov.disabled,MT(y,c,m,g.getProjection()),i.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,c.zoom,null,[v.collisionVertexBuffer,v.collisionVertexBufferExt]))}if(!o||!u.length)return;const f=t.getOrCreateProgram("collisionCircle"),m=new Wa;m.resize(4*d),m._trim();let g=0;for(const t of u)for(let e=0;e<t.circleArray.length/4;e++){const i=4*e,n=t.circleArray[i+0],r=t.circleArray[i+1],s=t.circleArray[i+2],o=t.circleArray[i+3];m.emplace(g++,n,r,s,o,0),m.emplace(g++,n,r,s,o,1),m.emplace(g++,n,r,s,o,2),m.emplace(g++,n,r,s,o,3)}(!qT||qT.length<2*d)&&(qT=function(t){const e=2*t,i=new Za;i.resize(e),i._trim();for(let t=0;t<e;t++){const e=6*t;i.uint16[e+0]=4*t+0,i.uint16[e+1]=4*t+1,i.uint16[e+2]=4*t+2,i.uint16[e+3]=4*t+2,i.uint16[e+4]=4*t+3,i.uint16[e+5]=4*t+0}return i}(d));const _=a.createIndexBuffer(qT,!0),y=a.createVertexBuffer(m,ug.members,!0);for(const e of u){const n={u_matrix:e.transform,u_inv_matrix:e.invTransform,u_camera_to_center_distance:(v=c).getCameraToCenterDistance(e.projection),u_viewport_size:[v.width,v.height]};f.draw(t,l.TRIANGLES,Mv.disabled,Cv.disabled,t.colorModeForRenderPass(),Ov.disabled,n,i.id,y,_,bl.simpleSegment(0,2*e.circleOffset,e.circleArray.length,e.circleArray.length/2),null,c.zoom)}var v;y.destroy(),_.destroy()}const GT=Au.create();function ZT({width:t,height:e,anchor:i,textOffset:n,textScale:r},s){const{horizontalAlign:o,verticalAlign:a}=Ng(i),l=-(o-.5)*t,c=-(a-.5)*e,h=b_(i,n);return new v((l/r+h[0])*s,(c/r+h[1])*s)}function YT(t,e,i,n,r,s,o,a,l,c,h){const u=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,p=t.icon.dynamicLayoutVertexArray,f={},m=t.getProjection(),g=KE(a,m,s),_=s.elevation,y=m.upVectorScale(a.canonical,s.center.lat,s.worldSize).metersToTile;d.clear();for(let p=0;p<u.length;p++){const v=u.get(p),{tileAnchorX:b,tileAnchorY:x,numGlyphs:w}=v,E=v.hidden||!v.crossTileID||t.allowVerticalPlacement&&!v.placedOrientation?null:n[v.crossTileID];if(E){let n=0,u=0,p=0;if(_){const t=_?_.getAtTileOffset(a,b,x):0,[e,i,r]=m.upVector(a.canonical,b,x);n=t*e*y,u=t*i*y,p=t*r*y}let[S,T,M,A]=hb(v.projectedAnchorX+n,v.projectedAnchorY+u,v.projectedAnchorZ+p,i?g:o);const C=ub(s.getCameraToCenterDistance(m),A);let k=r.evaluateSizeForFeature(t.textSizeData,c,v)*C/dg;i&&(k*=t.tilePixelRatio/l);const P=ZT(E,k);i?(({x:S,y:T,z:M}=m.projectTilePoint(b+P.x,x+P.y,a.canonical)),[S,T,M]=hb(S+n,T+u,M+p,o)):(e&&P._rotate(-s.angle),S+=P.x,T+=P.y,M=0);const I=t.allowVerticalPlacement&&v.placedOrientation===Ag.vertical?Math.PI/2:0;for(let t=0;t<w;t++)py(d,S,T,M,I);h&&v.associatedIconIndex>=0&&(f[v.associatedIconIndex]={x:S,y:T,z:M,angle:I})}else bb(w,d)}if(h){p.clear();const e=t.icon.placedSymbolArray;for(let t=0;t<e.length;t++){const i=e.get(t),{numGlyphs:n}=i,r=f[t];if(i.hidden||!r)bb(n,p);else{const{x:t,y:e,z:i,angle:s}=r;for(let r=0;r<n;r++)py(p,t,e,i,s)}}t.icon.dynamicLayoutVertexBuffer.updateData(p)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function XT(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function KT(t,e,i,n,r,s,o,a,l,c,h,u,d){const p=t.context,f=p.gl,m=t.transform,g="map"===a,_="map"===l,y=g&&"point"!==i.layout.get("symbol-placement"),v=g&&!_&&!y,b=void 0!==i.layout.get("symbol-sort-key").constantOr(1);let x=!1;const w=t.depthModeForSublayer(0,Mv.ReadOnly),E=[Qd(m.center.lng),Jd(m.center.lat)],S=i.layout.get("text-variable-anchor"),T="globe"===m.projection.name,M=[],A=[0,-1,0];let C=A;!T&&!m.mercatorFromTransition||g||(C=function(t){const e=t._camera.getWorldToCamera(t.worldSize,1),i=Au.multiply([],e,t.globeMatrix);Au.invert(i,i);const n=[0,0,0],r=[0,1,0,0];return vu.transformMat4(r,r,i),n[0]=r[0],n[1]=r[1],n[2]=r[2],Ou.normalize(n,n),n}(m));for(const a of n){const n=e.getTile(a),l=n.getBucket(i);if(!l)continue;if("mercator"===l.projection.name&&T)continue;const u=r?l.text:l.icon;if(!u||l.fullyClipped||!u.segments.get().length)continue;const d=u.programConfigurations.get(i.id),p=r||l.sdfIcons,w=r?l.textSizeData:l.iconSizeData,k=_||0!==m.pitch,P=gg(w,m.zoom);let I,D,O,L,z=[0,0],R=null;if(r)D=n.glyphAtlasTexture?n.glyphAtlasTexture:null,O=f.LINEAR,I=n.glyphAtlasTexture?n.glyphAtlasTexture.size:[0,0],l.iconsInText&&(z=n.imageAtlasTexture?n.imageAtlasTexture.size:[0,0],R=n.imageAtlasTexture?n.imageAtlasTexture:null,L=k||t.options.rotating||t.options.zooming||"composite"===w.kind||"camera"===w.kind?f.LINEAR:f.NEAREST);else{const e=1!==i.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;D=n.imageAtlasTexture?n.imageAtlasTexture:null,O=p||t.options.rotating||t.options.zooming||e||k?f.LINEAR:f.NEAREST,I=n.imageAtlasTexture?n.imageAtlasTexture.size:[0,0]}const F="globe"===l.projection.name,B=F?C:A,N=F?Od(m.zoom):0,j=KE(a,l.getProjection(),m),V=m.calculatePixelsToTileUnitsMatrix(n),U=ab(j,n.tileID.canonical,_,g,m,l.getProjection(),V),$=t.terrain&&_&&y?Au.invert(Au.create(),U):GT,H=cb(j,n.tileID.canonical,_,g,m,l.getProjection(),V),q=S&&l.hasTextData(),W=l.hasIconTextFit()&&q&&l.hasIconData();if(y){const e=m.elevation,i=e?e.getAtTileOffsetFunc(a,m.center.lat,m.worldSize,l.getProjection()):null,s=lb(j,n.tileID.canonical,_,g,m,l.getProjection(),V);pb(l,j,t,r,s,H,_,c,i,a)}const G=y||r&&S||W,Z=t.translatePosMatrix(j,n,s,o),Y=G?GT:U,X=t.translatePosMatrix(H,n,s,o,!0),K=l.getProjection().createInversionMatrix(m,a.canonical),Q=i.paint.get("icon-image-cross-fade").constantOr(0),J=[];t.terrainRenderModeElevated()&&_&&J.push("PITCH_WITH_MAP_TERRAIN"),F&&(J.push("PROJECTION_GLOBE_VIEW"),G&&J.push("PROJECTED_POS_ON_VIEWPORT")),Q>0&&J.push("ICON_TRANSITION"),u.zOffsetVertexBuffer&&J.push("Z_OFFSET");const tt=p&&0!==i.paint.get(r?"text-halo-width":"icon-halo-width").constantOr(1);let et;p?et=l.iconsInText?FT(w.kind,P,v,_,t,Z,Y,X,I,z,a,N,E,K,B,l.getProjection()):RT(w.kind,P,v,_,t,Z,Y,X,r,I,!0,a,N,E,K,B,l.getProjection()):(h<1&&J.push("SATURATION"),et=zT(w.kind,P,v,_,t,Z,Y,X,r,I,a,N,E,K,B,l.getProjection(),h,Q));const it={program:t.getOrCreateProgram(XT(p,r,l),{config:d,defines:J}),buffers:u,uniformValues:et,atlasTexture:D,atlasTextureIcon:R,atlasInterpolation:O,atlasInterpolationIcon:L,isSDF:p,hasHalo:tt,tile:n,labelPlaneMatrixInv:$};if(b&&l.canOverlap){x=!0;const t=u.segments.get();for(const e of t)M.push({segments:new bl([e]),sortKey:e.sortKey,state:it})}else M.push({segments:u.segments,sortKey:0,state:it})}x&&M.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of M){const n=e.state;if(t.terrain&&t.terrain.setupElevationDraw(n.tile,n.program,{useDepthForOcclusion:m.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:n.labelPlaneMatrixInv}),p.activeTexture.set(f.TEXTURE0),n.atlasTexture&&n.atlasTexture.bind(n.atlasInterpolation,f.CLAMP_TO_EDGE),n.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),t.uploadCommonLightUniforms(t.context,n.program),n.hasHalo){const r=n.uniformValues;r.u_is_halo=1,QT(n.buffers,e.segments,i,t,n.program,w,u,d,r,2),r.u_is_halo=0}else{if(n.isSDF){const r=n.uniformValues;n.hasHalo&&(r.u_is_halo=1,QT(n.buffers,e.segments,i,t,n.program,w,u,d,r,1)),r.u_is_halo=0}QT(n.buffers,e.segments,i,t,n.program,w,u,d,n.uniformValues,1)}}}function QT(t,e,i,n,r,s,o,a,l,c){const h=[t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer,t.iconTransitioningVertexBuffer,t.globeExtVertexBuffer,t.zOffsetVertexBuffer];r.draw(n,n.context.gl.TRIANGLES,s,o,a,Ov.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,n.transform.zoom,t.programConfigurations.get(i.id),h,c)}function JT(t,e,i,n,r,s,o){const a=t.context.gl,l=i.paint.get("fill-pattern"),c=l&&l.constantOr(1);let h,u,d,p,f;o?(u=c&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=a.LINES):(u=c?"fillPattern":"fill",h=a.TRIANGLES);for(const m of n){const n=e.getTile(m);if(c&&!n.patternsLoaded())continue;const g=n.getBucket(i);if(!g)continue;t.prepareDrawTile();const _=g.programConfigurations.get(i.id),y=t.isTileAffectedByFog(m),v=t.getOrCreateProgram(u,{config:_,overrideFog:y});c&&(t.context.activeTexture.set(a.TEXTURE0),n.imageAtlasTexture&&n.imageAtlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),_.updatePaintBuffers());const b=l.constantOr(null);if(b&&n.imageAtlas){const t=n.imageAtlas.patternPositions[b.toString()];t&&_.setConstantPatternPositions(t)}const x=t.translatePosMatrix(m.projMatrix,n,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor")),w=i.paint.get("fill-emissive-strength");if(o){p=g.indexBuffer2,f=g.segments2;const e=t.terrain&&t.terrain.renderingToTexture?t.terrain.drapeBufferSize:[a.drawingBufferWidth,a.drawingBufferHeight];d="fillOutlinePattern"===u&&c?TT(x,w,t,n,e):ST(x,w,e)}else p=g.indexBuffer,f=g.segments,d=c?ET(x,w,t,n):wT(x,w);t.uploadCommonUniforms(t.context,v,m.toUnwrapped()),v.draw(t,h,r,t.stencilModeForClipping(m),s,Ov.disabled,d,i.id,g.layoutVertexBuffer,p,f,i.paint,t.transform.zoom,_,void 0)}}function tM(t,e,i,n,r,s,o,a){i.resetLayerRenderingStats();const l=t.context,c=l.gl,h=t.transform,u=i.paint.get("fill-extrusion-pattern"),d=u.constantOr(1),p=i.paint.get("fill-extrusion-opacity"),f=t.style.enable3dLights(),m=i.paint.get(f&&!d?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),g=[i.paint.get("fill-extrusion-ambient-occlusion-intensity"),m],_=i.layout.get("fill-extrusion-edge-radius"),y=_>0&&!i.paint.get("fill-extrusion-rounded-roof"),v=y?0:_,b="globe"===h.projection.name?kx():0,x="globe"===h.projection.name,w=x?Od(h.zoom):0,E=[Qd(h.center.lng),Jd(h.center.lat)],S=i.paint.get("fill-extrusion-flood-light-color").toArray01().slice(0,3),T=i.paint.get("fill-extrusion-flood-light-intensity"),M=i.paint.get("fill-extrusion-vertical-scale"),A=eT(t,i.paint.get("fill-extrusion-cutoff-fade-range")),C=i.paint.get("fill-extrusion-emissive-strength"),k=[];let P;x&&k.push("PROJECTION_GLOBE_VIEW"),g[0]>0&&k.push("FAUX_AO"),y&&k.push("ZERO_ROOF_RADIUS"),a&&k.push("HAS_CENTROID"),T>0&&k.push("FLOOD_LIGHT"),A.shouldRenderCutoff&&k.push("RENDER_CUTOFF");const I="shadow"===t.renderPass,D=t.shadowRenderer,O=I&&!!D;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let L=[0,0,0];if(D){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(L=ZM(e,i)),P=k.concat(["SHADOWS_SINGLE_CASCADE"])}const z=O?"fillExtrusionDepth":d?"fillExtrusionPattern":"fillExtrusion",R=i.getLayerRenderingStats();for(const f of n){const n=e.getTile(f),m=n.getBucket(i);if(!m||m.projection.name!==h.projection.name)continue;let _=!1;D&&(_=0===D.getMaxCascadeForTile(f.toUnwrapped()));const y=t.isTileAffectedByFog(f),O=m.programConfigurations.get(i.id),F=t.getOrCreateProgram(z,{config:O,defines:_?P:k,overrideFog:y});if(t.terrain&&t.terrain.setupElevationDraw(n,F,{useMeterToDem:!0}),!m.centroidVertexBuffer){const t=F.attributes.a_centroid_pos;void 0!==t&&c.vertexAttrib2f(t,0,0)}!I&&D&&D.setupShadows(n.tileID.toUnwrapped(),F,"vector-tile",n.tileID.overscaledZ),d&&(t.context.activeTexture.set(c.TEXTURE0),n.imageAtlasTexture&&n.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),O.updatePaintBuffers());const B=u.constantOr(null);if(B&&n.imageAtlas){const t=n.imageAtlas.patternPositions[B.toString()];t&&O.setConstantPatternPositions(t)}const N=i.paint.get("fill-extrusion-vertical-gradient");let j;if(I&&D){if(oM(n.tileID,m,t))continue;const e=D.calculateShadowPassMatrixFromTile(n.tileID.toUnwrapped());j=bT(e,v,M)}else{const e=t.translatePosMatrix(f.expandedProjMatrix,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),r=h.projection.createInversionMatrix(h,f.canonical);j=d?xT(e,t,N,p,g,v,f,n,b,w,E,r,S,M):vT(e,t,N,p,g,v,f,b,w,E,r,S,M,T,L,C)}t.uploadCommonUniforms(l,F,f.toUnwrapped(),null,A);let V=m.segments;if("mercator"===h.projection.name&&!I&&(V=m.getVisibleSegments(n.tileID,t.terrain,t.transform.getFrustum(0)),!V.get().length))continue;if(R)if(I)for(const t of V.get())R.numRenderedVerticesInShadowPass+=t.primitiveLength;else for(const t of V.get())R.numRenderedVerticesInTransparentPass+=t.primitiveLength;const U=[];(t.terrain||a)&&U.push(m.centroidVertexBuffer),x&&U.push(m.layoutVertexExtBuffer),F.draw(t,l.gl.TRIANGLES,r,s,o,Ov.backCCW,j,i.id,m.layoutVertexBuffer,m.indexBuffer,V,i.paint,t.transform.zoom,O,U)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}function eM(t,e,i,n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y){const v=t.context,b=v.gl,x=t.transform,w=t.transform.zoom,E=[],S=eT(t,i.paint.get("fill-extrusion-cutoff-fade-range"));"clear"===c?(E.push("CLEAR_SUBPASS"),y&&(E.push("CLEAR_FROM_TEXTURE"),v.activeTexture.set(b.TEXTURE0),y.bind(b.LINEAR,b.CLAMP_TO_EDGE))):"sdf"===c&&E.push("SDF_SUBPASS"),g&&E.push("HAS_CENTROID"),S.shouldRenderCutoff&&E.push("RENDER_CUTOFF");const T=i.layout.get("fill-extrusion-edge-radius"),M=(e,n,c,_,b)=>{const x=n.programConfigurations.get(i.id),M=t.isTileAffectedByFog(e),A=t.getOrCreateProgram("fillExtrusionGroundEffect",{config:x,defines:E,overrideFog:M}),C=((t,e,i,n,r,s,o,a,l,c,h)=>({u_matrix:e,u_opacity:i,u_ao_pass:n?1:0,u_meter_to_tile:r,u_ao:s,u_flood_light_intensity:o,u_flood_light_color:a,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:h}))(0,_,h,l,b,[u,d*b],p,f,m,w>=17?0:T*b,y?y.size[0]:0),k=[];g&&k.push(n.hiddenByLandmarkVertexBuffer),t.uploadCommonUniforms(v,A,e.toUnwrapped(),null,S),A.draw(t,v.gl.TRIANGLES,r,s,o,a,C,i.id,n.vertexBuffer,n.indexBuffer,c,i.paint,w,x,k)};for(const r of n){const n=e.getTile(r),s=n.getBucket(i);if(!s||s.projection.name!==x.projection.name||!s.groundEffect||s.groundEffect&&!s.groundEffect.hasData())continue;const o=s.groundEffect,a=1/s.tileToMeter;{const e=t.translatePosMatrix(r.projMatrix,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),s=o.getDefaultSegment();M(r,o,s,e,a)}if(_)for(let s=0;s<4;s++){const o=Gu[s](r),l=e.getTile(o);if(!l)continue;const c=l.getBucket(i);if(!c||c.projection.name!==x.projection.name||!c.groundEffect||c.groundEffect&&!c.groundEffect.hasData())continue;const h=c.groundEffect;let u,d;0===s?(u=[-un,0,0],d=1):1===s?(u=[un,0,0],d=0):2===s?(u=[0,-un,0],d=3):(u=[0,un,0],d=2);const p=h.regionSegments[d];if(!p)continue;const f=new Float32Array(16);Au.translate(f,r.projMatrix,u),M(r,h,p,t.translatePosMatrix(f,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),a)}}}function iM(t,e,i,n,r,s,o){0===n.centroidVertexArray.length&&n.createCentroidsBuffer();const a=s?s.findDEMTileFor(i):null;if(!(a&&a.dem||o))return;const l=t=>{const i=e.getSource().minzoom,n=t=>{const i=e.getTileByID(t);if(i&&i.hasData())return i.getBucket(r)},s=[0,-1,1];for(const e of s){if(t.overscaledZ+e<i)continue;const r=n(t.calculateScaledKey(t.overscaledZ+e));if(r)return r}},c=[0,0,0],h=(t,e)=>(c[0]=Math.min(t.min.y,e.min.y),c[1]=Math.max(t.max.y,e.max.y),c[2]=un-e.min.x>t.max.x?e.min.x-un:t.max.x,c),u=(t,e)=>(c[0]=Math.min(t.min.x,e.min.x),c[1]=Math.max(t.max.x,e.max.x),c[2]=un-e.min.y>t.max.y?e.min.y-un:t.max.y,c),d=[(t,e)=>h(t,e),(t,e)=>h(e,t),(t,e)=>u(t,e),(t,e)=>u(e,t)],p=(t,e,n,r,o,l,c)=>{if(!s)return 0;const h=[[l?n:t,l?t:n,0],[l?n:e,l?e:n,0]],u=c<0?un+c:c,d=[l?u:(t+e)/2,l?(t+e)/2:u,0];return 0===n&&c<0||0!==n&&c>0?s.getForTilePoints(o,[d],!0,r):h.push(d),s.getForTilePoints(i,h,!0,a),Math.max(h[0][2],h[1][2],d[2])/s.exaggeration()};for(let t=0;t<4;t++){const e=n.borderFeatureIndices[t];if(0===e.length)continue;const r=Gu[t](i),a=l(r);if(!(a&&a instanceof xx))continue;if(n.borderDoneWithNeighborZ[t]===a.canonical.z)continue;0===a.centroidVertexArray.length&&a.createCentroidsBuffer();const c=s?s.findDEMTileFor(r):null;if(!(c&&c.dem||o))continue;const h=(t<2?1:5)-t,u=a.borderDoneWithNeighborZ[h]!==n.canonical.z,_=a.borderFeatureIndices[h];let y=0;if(n.canonical.z!==a.canonical.z){for(const t of e)n.showCentroid(n.featuresOnBorder[t]);if(u)for(const t of _)a.showCentroid(a.featuresOnBorder[t]);n.borderDoneWithNeighborZ[t]=a.canonical.z,a.borderDoneWithNeighborZ[h]=n.canonical.z}for(const i of e){const e=n.featuresOnBorder[i],s=n.centroidData[e.centroidDataIndex],l=e.borders[t];let u;for(;y<_.length;){u=a.featuresOnBorder[_[y]];const t=u.borders[h];if(t[1]>l[0]+3||t[0]>l[0]-3)break;a.showCentroid(u),y++}if(u&&y<_.length){const i=y;let b=0;for(;!(u.borders[h][0]>l[1]-3)&&(b++,++y!==_.length);)u=a.featuresOnBorder[_[y]];if(u=a.featuresOnBorder[_[i]],b>1){const t=u.borders[h];Math.abs(l[0]-t[0])<3&&Math.abs(l[1]-t[1])<3&&(b=1,y=i+1)}else if(0===b){n.showCentroid(e);continue}const x=a.centroidData[u.centroidDataIndex];o&&1===b&&(((m=s).flags|(g=x).flags)&hx?(m.flags|=hx,g.flags|=hx):(m.flags&=2147483647,g.flags&=2147483647));let w=new v(0,0);if(b>1)y=i;else if(c&&c.dem&&!(e.intersectsCount()>1||u.intersectsCount()>1)){const e=d[t](s,x),i=t%2?un-1:0;f=p(e[0],Math.min(un-1,e[1]),i,c,r,t<2,e[2]),w=new v(Math.ceil(7*(f+450)),0)}s.centroidXY=x.centroidXY=w,n.writeCentroidToBuffer(s),a.writeCentroidToBuffer(x)}else n.showCentroid(e)}n.borderDoneWithNeighborZ[t]=a.canonical.z,a.borderDoneWithNeighborZ[h]=n.canonical.z}var f,m,g;(n.needsCentroidUpdate||!n.centroidVertexBuffer&&0!==n.centroidVertexArray.length)&&n.uploadCentroid(t)}const nM=[1,0,0],rM=[0,1,0],sM=[0,0,1];function oM(t,e,i){const n=i.transform,r=i.shadowRenderer;if(!r)return!0;const s=t.toUnwrapped(),o=n.tileSize*r._cascades[i.currentShadowCascade].scale;let a=e.maxHeight;if(n.elevation){const e=n.elevation.getMinMaxForTile(t);e&&(a+=e.max)}const l=[...r.shadowDirection];l[2]=-l[2];const c=r.computeSimplifiedTileShadowVolume(s,a,o,l);if(!c)return!1;const h=[nM,rM,sM,l,[l[0],0,l[2]],[0,l[1],l[2]]],u="globe"===n.projection.name,d=n.scaleZoom(o),p=td.fromInvProjectionMatrix(n.invProjMatrix,n.worldSize,d,!u),f=r.getCurrentCascadeFrustum();return 0===p.intersectsPrecise(c.vertices,c.planes,h)||0===f.intersectsPrecise(c.vertices,c.planes,h)}function aM(t){const e=t._nearZ,i=t.projection.farthestPixelDistance(t),n=i-e,r=.2*t.height,s=e+r;return[e,i,(s-r-e)/n,(s-e)/n]}const lM=new ui(1,0,0,1),cM=new ui(0,1,0,1),hM=new ui(0,0,1,1),uM=new ui(1,0,1,1),dM=new ui(0,1,1,1);function pM(t,e,i){const n=t.context,r=t.transform,s=n.gl,o="globe"===r.projection.name,a=o?["PROJECTION_GLOBE_VIEW"]:[];let l=i.projMatrix;if(o&&Od(r.zoom)>0){const t=Cd(_d(i.canonical,r));l=Au.multiply(new Float32Array(16),r.globeMatrix,t),Au.multiply(l,r.projMatrix,l)}const c=t.getOrCreateProgram("debug",{defines:a}),h=e.getTileByID(i.key);t.terrain&&t.terrain.setupElevationDraw(h,c);const u=Mv.disabled,d=Cv.disabled,p=t.colorModeForRenderPass(),f="$debug";n.activeTexture.set(s.TEXTURE0),t.emptyTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),o?h._makeGlobeTileDebugBuffers(t.context,r):h._makeDebugTileBoundsBuffers(t.context,r.projection);const m=h._tileDebugBuffer||t.debugBuffer,g=h._tileDebugIndexBuffer||t.debugIndexBuffer,_=h._tileDebugSegments||t.debugSegments;c.draw(t,s.LINE_STRIP,u,d,p,Ov.disabled,AT(l,ui.red),f,m,g,_,null,null,null,[h._globeTileDebugBorderBuffer]);const y=h.latestRawTileData,v=Math.floor((y&&y.byteLength||0)/1024),b=e.getTile(i).tileSize,x=512/Math.min(b,512)*(i.overscaledZ/r.zoom)*.5;let w=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(w+=` => ${i.overscaledZ}`),w+=` ${v}kb`,function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,w);const E=h._tileDebugTextBuffer||t.debugBuffer,S=h._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,T=h._tileDebugTextSegments||t.debugSegments;c.draw(t,s.TRIANGLES,u,d,Pv.alphaBlended,Ov.disabled,AT(l,ui.transparent,x),f,E,S,T,null,null,null,[h._globeTileDebugTextBuffer])}function fM(t,e,i,n){gM(t,0,e+i/2,t.transform.width,i,n)}function mM(t,e,i,n){gM(t,e-i/2,0,i,t.transform.height,n)}function gM(t,e,i,n,r,s){const o=t.context,a=o.gl;a.enable(a.SCISSOR_TEST),a.scissor(e*pe.devicePixelRatio,i*pe.devicePixelRatio,n*pe.devicePixelRatio,r*pe.devicePixelRatio),o.clear({color:s}),a.disable(a.SCISSOR_TEST)}const _M=ka([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:yM}=_M;function vM(t,e,i,n){t.emplaceBack(e,i,n)}class bM{constructor(t){this.vertexArray=new il,this.indices=new Za,vM(this.vertexArray,-1,-1,1),vM(this.vertexArray,1,-1,1),vM(this.vertexArray,-1,1,1),vM(this.vertexArray,1,1,1),vM(this.vertexArray,-1,-1,-1),vM(this.vertexArray,1,-1,-1),vM(this.vertexArray,-1,1,-1),vM(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,yM),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=bl.simpleSegment(0,0,36,12)}}function xM(t,e,i,n,r,s){const o=t.context.gl,a=e.paint.get("sky-atmosphere-color"),l=e.paint.get("sky-atmosphere-halo-color"),c=e.paint.get("sky-atmosphere-sun-intensity"),h=((t,e,i,n,r)=>({u_matrix_3f:t,u_sun_direction:e,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(Tu.fromMat4(Tu.create(),n),r,c,a,l);o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.skyboxTexture,0),i.draw(t,o.TRIANGLES,Mv.disabled,Cv.disabled,Pv.unblended,Ov.frontCW,h,"skyboxCapture",e.skyboxGeometry.vertexBuffer,e.skyboxGeometry.indexBuffer,e.skyboxGeometry.segment)}const wM=ka([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class EM{constructor(t){const e=new Qa;e.emplaceBack(-1,1,1,0,0),e.emplaceBack(1,1,1,1,0),e.emplaceBack(1,-1,1,1,1),e.emplaceBack(-1,-1,1,0,1);const i=new Za;i.emplaceBack(0,1,2),i.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(e,wM.members),this.indexBuffer=t.createIndexBuffer(i),this.segments=bl.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const SM=ka([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class TM{constructor(){this.colorModeAlphaBlendedWriteRGB=new Pv([1,kv,1,kv],ui.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new Pv([1,0,1,0],ui.transparent,[!1,!1,!1,!0])}update(t){const e=t.context;if(!this.atmosphereBuffer){this.atmosphereBuffer=new EM(e);const t=100,i=200,n=function(t){const e=Xr(30),i=[];for(let t=0;t<16e3;++t){const t=2*Math.PI*e(),n=Math.acos(1-2*e())-.5*Math.PI;i.push(Ou.fromValues(Math.cos(n)*Math.cos(t),Math.cos(n)*Math.sin(t),Math.sin(n)))}return i}(),r=Xr(300),s=new Ja,o=new Za;let a=0;for(let e=0;e<n.length;++e){const l=Ou.scale([],n[e],200),c=Math.max(0,1+.01*t*(1*r()-.5)),h=Math.max(0,1+.01*i*(1*r()-.5));s.emplaceBack(l[0],l[1],l[2],-1,-1,c,h),s.emplaceBack(l[0],l[1],l[2],1,-1,c,h),s.emplaceBack(l[0],l[1],l[2],1,1,c,h),s.emplaceBack(l[0],l[1],l[2],-1,1,c,h),o.emplaceBack(a+0,a+1,a+2),o.emplaceBack(a+0,a+2,a+3),a+=4}this.starsVx=e.createVertexBuffer(s,SM.members),this.starsIdx=e.createIndexBuffer(o),this.starsSegments=bl.simpleSegment(0,0,s.length,o.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(t,e){const i=t.context,n=i.gl,r=t.transform,s=new Mv(n.LEQUAL,Mv.ReadOnly,[0,1]),o=Od(r.zoom),a=e.properties.get("color").toArray01(),l=e.properties.get("high-color").toArray01(),c=e.properties.get("space-color").toArray01PremultipliedAlpha(),h=5e-4,u=I((e.properties.get("horizon-blend")-0)/1*.2495+h,5e-4,.25),d=zd(t,i,r)&&u===h?r.worldSize/(2*Math.PI*1.025)-1:r.globeRadius,p=t.frameCounter/1e3%1,f=Ou.length(r.globeCenterInViewSpace),m=Math.sqrt(Math.pow(f,2)-Math.pow(d,2)),g=Math.acos(m/f),_=e=>{const h="globe"===r.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&h.push("ALPHA_PASS");const d=t.getOrCreateProgram("globeAtmosphere",{defines:h}),f=((t,e,i,n,r,s,o,a,l,c,h,u)=>({u_frustum_tl:t,u_frustum_tr:e,u_frustum_br:i,u_frustum_bl:n,u_horizon:r,u_transition:s,u_fadeout_range:o,u_color:a,u_high_color:l,u_space_color:c,u_temporal_offset:h,u_horizon_angle:u}))(r.frustumCorners.TL,r.frustumCorners.TR,r.frustumCorners.BR,r.frustumCorners.BL,r.frustumCorners.horizon,o,u,a,l,c,p,g);t.uploadCommonUniforms(i,d);const m=this.atmosphereBuffer;m&&d.draw(t,n.TRIANGLES,s,Cv.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,Ov.backCW,f,e?"atmosphere_glow_alpha":"atmosphere_glow",m.vertexBuffer,m.indexBuffer,m.segments)};_(!1),_(!0)}drawStars(t,e){const i=I(e.properties.get("star-intensity"),0,1);if(0===i)return;const n=t.context,r=n.gl,s=t.transform,o=t.getOrCreateProgram("stars"),a=ku.identity([]);ku.rotateX(a,a,-s._pitch),ku.rotateZ(a,a,-s.angle),ku.rotateX(a,a,E(s._center.lat)),ku.rotateY(a,a,-E(s._center.lng));const l=Au.fromQuat(new Float32Array(16),a),c=Au.multiply([],s.starsProjMatrix,l),h=Tu.fromMat4([],l),u=Tu.invert([],h),d=[0,1,0];Ou.transformMat3(d,d,u),Ou.scale(d,d,.15);const p=[1,0,0];Ou.transformMat3(p,p,u),Ou.scale(p,p,.15);const f=((t,e,i,n)=>({u_matrix:Float32Array.from(t),u_up:e,u_right:i,u_intensity_multiplier:n}))(c,d,p,i);t.uploadCommonUniforms(n,o),this.starsVx&&this.starsIdx&&o.draw(t,r.TRIANGLES,Mv.disabled,Cv.disabled,this.colorModeAlphaBlendedWriteRGB,Ov.disabled,f,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function MM(t,e){const i=[...t],n=e.cameraWorldSizeForFog/e.worldSize,r=Au.identity([]);return Au.scale(r,r,[n,n,1]),Au.multiply(i,r,i),Au.multiply(i,e.worldToFogMatrix,i),i}function AM(t,e,i,n){const r=i.material,s=n.context,{baseColorTexture:o,metallicRoughnessTexture:a}=r.pbrMetallicRoughness,{normalTexture:l,occlusionTexture:c,emissionTexture:h}=r;function u(e,i,n){if(e&&(t.push(i),s.activeTexture.set(s.gl.TEXTURE0+n),e.gfxTexture)){const{minFilter:t,magFilter:i,wrapS:n,wrapT:r}=e.sampler;e.gfxTexture.bindExtraParam(t,i,n,r)}}u(o,"HAS_TEXTURE_u_baseColorTexture",jT.BaseColor),u(a,"HAS_TEXTURE_u_metallicRoughnessTexture",jT.MetallicRoughness),u(l,"HAS_TEXTURE_u_normalTexture",jT.Normal),u(c,"HAS_TEXTURE_u_occlusionTexture",jT.Occlusion),u(h,"HAS_TEXTURE_u_emissionTexture",jT.Emission),i.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),e.push(i.texcoordBuffer)),i.colorBuffer&&(t.push(12===i.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),e.push(i.colorBuffer)),i.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),e.push(i.normalBuffer)),i.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),e.push(i.pbrBuffer)),"OPAQUE"!==r.alphaMode&&"MASK"!==r.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),r.defined||t.push("DIFFUSE_SHADED"),t.push("USE_STANDARD_DERIVATIVES")}function CM(t,e,i,n,r,s){const o=i.paint.get("model-opacity"),a=e.context,l=new Mv(e.context.gl.LEQUAL,Mv.ReadWrite,e.depthRangeFor3D),c=e.transform,h=t.mesh,u=h.material,d=u.pbrMetallicRoughness,p=e.style.fog;let f;f="pixels"===e.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:Au.multiply([],n.zScaleMatrix,t.nodeModelMatrix),Au.multiply(f,n.negCameraPosMatrix,f);const m=Au.invert([],f);Au.transpose(m,m);const g=i.paint.get("model-emissive-strength").constantOr(0),_=VT(new Float32Array(t.worldViewProjection),new Float32Array(f),new Float32Array(m),e,o,d.baseColorFactor,u.emissiveFactor,d.metallicFactor,d.roughnessFactor,u,g,i),y={defines:[]},v=[];AM(y.defines,v,h,e);const b=e.shadowRenderer;b&&(b.useNormalOffset=!1);let x=null;if(p){const i=MM(t.nodeModelMatrix,e.transform);if(x=new Float32Array(i),"globe"!==c.projection.name){const t=h.aabb.min,e=h.aabb.max,[n,r]=p.getOpacityForBounds(i,t[0],t[1],e[0],e[1]);y.overrideFog=n>=mw||r>=mw}}const w=eT(e,i.paint.get("model-cutoff-fade-range"));w.shouldRenderCutoff&&y.defines.push("RENDER_CUTOFF");const E=e.getOrCreateProgram("model",y);e.uploadCommonUniforms(a,E,null,x,w),"shadow"!==e.renderPass&&b&&b.setupShadowsFromMatrix(t.nodeModelMatrix,E),E.draw(e,a.gl.TRIANGLES,l,r,s,h.material.doubleSided?Ov.disabled:Ov.backCCW,_,i.id,h.vertexBuffer,h.indexBuffer,h.segments,i.paint,e.transform.zoom,void 0,v)}function kM(t,e,i,n,r,s,o){let a;a="globe"===t.projection.name?Ab(i,t):[...i],Au.multiply(a,a,e.matrix);const l=Au.multiply([],n,a);if(e.meshes)for(const t of e.meshes){if("BLEND"!==t.material.alphaMode){o.push({mesh:t,depth:0,modelIndex:r,worldViewProjection:l,nodeModelMatrix:a});continue}const e=Ou.transformMat4([],t.centroid,l);e[2]>0&&s.push({mesh:t,depth:e[2],modelIndex:r,worldViewProjection:l,nodeModelMatrix:a})}if(e.children)for(const a of e.children)kM(t,a,i,n,r,s,o)}function PM(t,e,i,n){const r=i.shadowRenderer;if(!r)return;const s=r.getShadowPassDepthMode(),o=r.getShadowPassColorMode(),a=r.calculateShadowPassMatrixFromMatrix(e),l=$T(a);i.getOrCreateProgram("modelDepth",{defines:["DEPTH_TEXTURE"]}).draw(i,i.context.gl.TRIANGLES,s,Cv.disabled,o,Ov.backCCW,l,n.id,t.vertexBuffer,t.indexBuffer,t.segments,n.paint,i.transform.zoom,void 0,void 0)}function IM(t,e,i){const n=e.updateZoomBasedPaintProperties(),r=function(t,e,i){let n,r,s,o=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&o>0){const e=t.terrain,r=e.findDEMTileFor(i);r&&r.dem?n=Jm.create(e,i,r):o=0}if(0===o&&(e.terrainElevationMin=0,e.terrainElevationMax=0),o===e.validForExaggeration&&(0===o||n&&n._demTile&&n._demTile.tileID===e.validForDEMTile.id&&n._dem._timestamp===e.validForDEMTile.timestamp))return!1;for(const t in e.instancesPerModel){const i=e.instancesPerModel[t];for(let t=0;t<i.instancedDataArray.length;++t){const a=(n?o*n.getElevationAt(0|i.instancedDataArray.float32[16*t],0|i.instancedDataArray.float32[16*t+1],!0,!0):0)+i.instancesEvaluatedElevation[t];i.instancedDataArray.float32[16*t+6]=a,r=r?Math.min(e.terrainElevationMin,a):a,s=s?Math.max(e.terrainElevationMax,a):a}}return e.terrainElevationMin=r||0,e.terrainElevationMax=s||0,e.validForExaggeration=o,e.validForDEMTile=n&&n._demTile?{id:n._demTile.tileID,timestamp:n._dem._timestamp}:{id:void 0,timestamp:0},!0}(t,e,i);(n||r)&&(e.uploaded=!1,e.upload(t.context))}const DM={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new ed([0,0,0],[un,un,0])};function OM(t,e){const i=1<<t.canonical.z,n=e.getFreeCameraOptions().position,r=e.elevation,s=t.canonical.x/i,o=(t.canonical.x+1)/i,a=t.canonical.y/i,l=(t.canonical.y+1)/i;let c=e._centerAltitude;if(r){const e=r.getMinMaxForTile(t);e&&e.max>c&&(c=e.max)}const h=I(n.x,s,o)-n.x,u=I(n.y,a,l)-n.y,d=tp(c,e.center.lat)-n.z;return e._zoomFromMercatorZ(Math.sqrt(h*h+u*u+d*d))}function LM(t,e,i,n,r,s,o){const a=t.context,l="shadow"===t.renderPass,c=t.shadowRenderer,h=l&&c?c.getShadowPassDepthMode():new Mv(a.gl.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D),u=t.isTileAffectedByFog(s);if(i.meshes)for(const d of i.meshes){const p=["MODEL_POSITION_ON_GPU"],f=[];let m,g,_;n.instancedDataArray.length>20&&p.push("INSTANCED_ARRAYS");const y=eT(t,e.paint.get("model-cutoff-fade-range"));if(y.shouldRenderCutoff&&p.push("RENDER_CUTOFF"),l&&c)m=t.getOrCreateProgram("modelDepth",{defines:p}),g=$T(o.shadowTileMatrix,o.shadowTileMatrix,Float32Array.from(i.matrix)),_=c.getShadowPassColorMode();else{AM(p,f,d,t),m=t.getOrCreateProgram("model",{defines:p,overrideFog:u});const n=d.material,l=n.pbrMetallicRoughness,h=e.paint.get("model-opacity"),v=e.paint.get("model-emissive-strength").constantOr(0);g=VT(s.expandedProjMatrix,Float32Array.from(i.matrix),new Float32Array(16),t,h,l.baseColorFactor,n.emissiveFactor,l.metallicFactor,l.roughnessFactor,n,v,e,r),c&&(o.shadowUniformsInitialized?m.setShadowUniformValues(a,c.getShadowUniformValues()):(c.setupShadows(s.toUnwrapped(),m,"model-tile",s.overscaledZ),o.shadowUniformsInitialized=!0)),_=y.shouldRenderCutoff||h<1||"OPAQUE"!==n.alphaMode?Pv.alphaBlended:Pv.unblended}t.uploadCommonUniforms(a,m,s.toUnwrapped(),null,y);const v=d.material.doubleSided?Ov.disabled:Ov.backCCW;if(n.instancedDataArray.length>20)f.push(n.instancedDataBuffer),m.draw(t,a.gl.TRIANGLES,h,Cv.disabled,_,v,g,e.id,d.vertexBuffer,d.indexBuffer,d.segments,e.paint,t.transform.zoom,void 0,f,n.instancedDataArray.length);else{const i=l?"u_instance":"u_normal_matrix";for(let r=0;r<n.instancedDataArray.length;++r)g[i]=new Float32Array(n.instancedDataArray.arrayBuffer,64*r,16),m.draw(t,a.gl.TRIANGLES,h,Cv.disabled,_,v,g,e.id,d.vertexBuffer,d.indexBuffer,d.segments,e.paint,t.transform.zoom,void 0,f)}}if(i.children)for(const a of i.children)LM(t,e,a,n,r,s,o)}const zM=[1,-1,1];function RM(t,e,i,n){if(!i.modelManager)return!0;const r=i.modelManager;if(!i.shadowRenderer)return!0;const s=i.shadowRenderer,o=e.aabb;let a=!0,l=t.maxHeight;if(0===l){let e=0;for(const i in t.instancesPerModel){const t=r.getModel(i,n);t?e=Math.max(e,Math.max(Math.max(t.aabb.max[0],t.aabb.max[1]),t.aabb.max[2])):a=!1}l=t.maxScale*e*1.41+t.maxVerticalOffset,a&&(t.maxHeight=l)}o.max[2]=l,o.min[2]+=t.terrainElevationMin,o.max[2]+=t.terrainElevationMax,Ou.transformMat4(o.min,o.min,e.tileMatrix),Ou.transformMat4(o.max,o.max,e.tileMatrix);const c=o.intersects(s.getCurrentCascadeFrustum());return 0===i.currentShadowCascade&&(t.isInsideFirstShadowMapFrustum=2===c),0===c}class FM{}class BM{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,e,i){{const i=this._storage.get(e.id);if(i)return i.lastUsedFrameIdx=t,i.buf}const n=i.gl,r=n.getBufferParameter(n.ELEMENT_ARRAY_BUFFER,n.BUFFER_SIZE),s=new ArrayBuffer(r),o=new Int16Array(s);n.getBufferSubData(n.ELEMENT_ARRAY_BUFFER,0,new Int16Array(s));const a=new $a;for(let t=0;t<r/2;t+=3){const e=o[t],i=o[t+1],n=o[t+2];a.emplaceBack(e,i),a.emplaceBack(i,n),a.emplaceBack(n,e)}const l=i.bindVertexArrayOES.current,c=new FM;return c.buf=new Ny(i,a),c.lastUsedFrameIdx=t,this._storage.set(e.id,c),i.bindVertexArrayOES.set(l),c.buf}update(t){for(const[e,i]of this._storage)t-i.lastUsedFrameIdx>30&&(i.buf.destroy(),this._storage.delete(e))}destroy(){for(const[t,e]of this._storage)e.buf.destroy(),this._storage.delete(t)}}const NM={symbol:function(t,e,i,n,r){if("translucent"!==t.renderPass)return;const s=Cv.disabled,o=t.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(t,e,i,n,r,s,o){const a=e.transform,l="map"===r,c="map"===s;for(const e of t){const t=n.getTile(e),r=t.getBucket(i);if(!r||!r.text||!r.text.segments.get().length)continue;const s=gg(r.textSizeData,a.zoom),h=KE(e,r.getProjection(),a),u=a.calculatePixelsToTileUnitsMatrix(t),d=ab(h,t.tileID.canonical,c,l,a,r.getProjection(),u),p=r.hasIconTextFit()&&r.hasIconData();if(s){const i=Math.pow(2,a.zoom-t.tileID.overscaledZ);YT(r,l,c,o,_g,a,d,e,i,s,p)}}}(n,t,i,e,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),r),0!==i.paint.get("icon-opacity").constantOr(1)&&KT(t,e,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),i.paint.get("icon-color-saturation"),s,o),0!==i.paint.get("text-opacity").constantOr(1)&&KT(t,e,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),i.paint.get("icon-color-saturation"),s,o),e.map.showCollisionBoxes&&(WT(t,e,i,n,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),WT(t,e,i,n,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))},circle:function(t,e,i,n){if("translucent"!==t.renderPass)return;const r=i.paint.get("circle-opacity"),s=i.paint.get("circle-stroke-width"),o=i.paint.get("circle-stroke-opacity"),a=void 0!==i.layout.get("circle-sort-key").constantOr(1),l=i.paint.get("circle-emissive-strength");if(0===r.constantOr(1)&&(0===s.constantOr(1)||0===o.constantOr(1)))return;const c=t.context,h=c.gl,u=t.transform,d=t.depthModeForSublayer(0,Mv.ReadOnly),p=Cv.disabled,f=t.colorModeForDrapableLayerRenderPass(l),m="globe"===u.projection.name,g=[Qd(u.center.lng),Jd(u.center.lat)],_=[];for(let r=0;r<n.length;r++){const s=n[r],o=e.getTile(s),l=o.getBucket(i);if(!l||l.projection.name!==u.projection.name)continue;const c=l.programConfigurations.get(i.id),h=Hp(i),d=t.isTileAffectedByFog(s);m&&h.push("PROJECTION_GLOBE_VIEW");const p=t.getOrCreateProgram("circle",{config:c,defines:h,overrideFog:d}),f=l.layoutVertexBuffer,y=l.globeExtVertexBuffer,v=l.indexBuffer,b=u.projection.createInversionMatrix(u,s.canonical),x={programConfiguration:c,program:p,layoutVertexBuffer:f,globeExtVertexBuffer:y,indexBuffer:v,uniformValues:$p(t,s,o,b,g,i),tile:o};if(a){const t=l.segments.get();for(const e of t)_.push({segments:new bl([e]),sortKey:e.sortKey,state:x})}else _.push({segments:l.segments,sortKey:0,state:x})}a&&_.sort(((t,e)=>t.sortKey-e.sortKey));const y={useDepthForOcclusion:u.depthOcclusionForSymbolsAndCircles};for(const e of _){const{programConfiguration:n,program:r,layoutVertexBuffer:s,globeExtVertexBuffer:o,indexBuffer:a,uniformValues:l,tile:m}=e.state,g=e.segments;t.terrain&&t.terrain.setupElevationDraw(m,r,y),t.uploadCommonUniforms(c,r,m.tileID.toUnwrapped()),r.draw(t,h.TRIANGLES,d,p,f,Ov.disabled,l,i.id,s,a,g,i.paint,u.zoom,n,[o])}},heatmap:function(t,e,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const r=t.context,s=r.gl,o=Cv.disabled,a=new Pv([s.ONE,s.ONE,s.ONE,s.ONE],ui.transparent,[!0,!0,!0,!0]);!function(t,e,i,n){const r=t.gl,s=e.width*n,o=e.height*n;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,s,o]);let a=i.heatmapFbo;if(!a||a&&(a.width!==s||a.height!==o)){a&&a.destroy();const e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),a=i.heatmapFbo=t.createFramebuffer(s,o,!0,null),function(t,e,i,n,r,s){const o=t.gl;o.texImage2D(o.TEXTURE_2D,0,t.extRenderToTextureHalfFloat?o.RGBA16F:o.RGBA,r,s,0,o.RGBA,t.extRenderToTextureHalfFloat?o.HALF_FLOAT:o.UNSIGNED_BYTE,null),n.colorAttachment.set(i)}(t,0,e,a,s,o)}else r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)}(r,t,i,"globe"===t.transform.projection.name?.5:.25),r.clear({color:ui.transparent});const l=t.transform,c="globe"===l.projection.name,h=c?["PROJECTION_GLOBE_VIEW"]:[],u=c?Ov.frontCCW:Ov.disabled,d=[Qd(l.center.lng),Jd(l.center.lat)];for(let p=0;p<n.length;p++){const f=n[p];if(e.hasRenderableParent(f))continue;const m=e.getTile(f),g=m.getBucket(i);if(!g||g.projection.name!==l.projection.name)continue;const _=t.isTileAffectedByFog(f),y=g.programConfigurations.get(i.id),v=t.getOrCreateProgram("heatmap",{config:y,defines:h,overrideFog:_}),{zoom:b}=t.transform;t.terrain&&t.terrain.setupElevationDraw(m,v),t.uploadCommonUniforms(r,v,f.toUnwrapped());const x=l.projection.createInversionMatrix(l,f.canonical);v.draw(t,s.TRIANGLES,Mv.disabled,o,a,u,kT(t,f,m,x,d,b,i.paint.get("heatmap-intensity")),i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,i.paint,t.transform.zoom,y,c?[g.globeExtVertexBuffer]:null)}r.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,e){const i=t.context,n=i.gl,r=e.heatmapFbo;if(!r)return;i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1);let s=e.colorRampTexture;s||(s=e.colorRampTexture=new My(i,e.colorRamp,n.RGBA)),s.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.getOrCreateProgram("heatmapTexture").draw(t,n.TRIANGLES,Mv.disabled,Cv.disabled,t.colorModeForRenderPass(),Ov.disabled,((t,e,i,n)=>({u_image:0,u_color_ramp:1,u_opacity:e.paint.get("heatmap-opacity")}))(0,e),e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom)}(t,i))},line:function(t,e,i,n){if("translucent"!==t.renderPass)return;const r=i.paint.get("line-opacity"),s=i.paint.get("line-width");if(0===r.constantOr(1)||0===s.constantOr(1))return;const o=i.paint.get("line-emissive-strength"),a=t.depthModeForSublayer(0,Mv.ReadOnly),l=t.colorModeForDrapableLayerRenderPass(o),c=t.terrain&&t.terrain.renderingToTexture?1:pe.devicePixelRatio,h=i.paint.get("line-dasharray"),u=h.constantOr(1),d=i.layout.get("line-cap"),p=i.paint.get("line-pattern"),f=p.constantOr(1),m=i.paint.get("line-pattern").constantOr(1),g=1!==i.paint.get("line-opacity").constantOr(1);let _=!m&&g;const y=i.paint.get("line-gradient"),v=f?"linePattern":"line",b=t.context,x=b.gl,w=Hx(i);t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(_=!1);for(const r of n){const n=e.getTile(r);if(f&&!n.patternsLoaded())continue;const s=n.getBucket(i);if(!s)continue;t.prepareDrawTile();const o=s.programConfigurations.get(i.id),m=t.isTileAffectedByFog(r),g=t.getOrCreateProgram(v,{config:o,defines:w,overrideFog:m}),E=p.constantOr(null);if(E&&n.imageAtlas){const t=n.imageAtlas.patternPositions[E.toString()];t&&o.setConstantPatternPositions(t)}const S=h.constantOr(null),T=d.constantOr(null);if(!f&&S&&T&&n.lineAtlas){const t=n.lineAtlas.getDash(S,T);t&&o.setConstantPatternPositions(t)}let[M,A]=i.paint.get("line-trim-offset");if("round"===T||"square"===T){const t=1;M!==A&&(0===M&&(M-=t),1===A&&(A+=t))}const C=t.terrain?r.projMatrix:null,k=f?Vx(t,n,i,C,c):jx(t,n,i,C,s.lineClipsArray.length,c,[M,A]);if(y){const n=s.gradients[i.id];let o=n.texture;if(i.gradientVersion!==n.version){let a=256;if(i.stepInterpolant){const i=e.getSource().maxzoom,n=r.canonical.z===i?Math.ceil(1<<t.transform.maxZoom-r.canonical.z):1;a=I(V(s.maxLineLength/un*1024*n),256,b.maxTextureSize)}n.gradient=of({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:a,image:n.gradient||void 0,clips:s.lineClipsArray}),n.texture?n.texture.update(n.gradient):n.texture=new My(b,n.gradient,x.RGBA),n.version=i.gradientVersion,o=n.texture}b.activeTexture.set(x.TEXTURE1),o.bind(i.stepInterpolant?x.NEAREST:x.LINEAR,x.CLAMP_TO_EDGE)}u&&(b.activeTexture.set(x.TEXTURE0),n.lineAtlasTexture&&n.lineAtlasTexture.bind(x.LINEAR,x.REPEAT),o.updatePaintBuffers()),f&&(b.activeTexture.set(x.TEXTURE0),n.imageAtlasTexture&&n.imageAtlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),o.updatePaintBuffers()),t.uploadCommonUniforms(b,g,r.toUnwrapped());const P=e=>{g.draw(t,x.TRIANGLES,a,e,l,Ov.disabled,k,i.id,s.layoutVertexBuffer,s.indexBuffer,s.segments,i.paint,t.transform.zoom,o,[s.layoutVertexBuffer2])};if(_){const e=t.stencilModeForClipping(r).ref;0===e&&t.terrain&&b.clear({stencil:0});const i={func:x.EQUAL,mask:255};k.u_alpha_discard_threshold=.8,P(new Cv(i,e,255,x.KEEP,x.KEEP,x.INVERT)),k.u_alpha_discard_threshold=0,P(new Cv(i,e,255,x.KEEP,x.KEEP,x.KEEP))}else P(t.stencilModeForClipping(r))}_&&(t.resetStencilClippingMasks(),t.terrain&&b.clear({stencil:0}))},fill:function(t,e,i,n){const r=i.paint.get("fill-color"),s=i.paint.get("fill-opacity");if(0===s.constantOr(1))return;const o=i.paint.get("fill-emissive-strength"),a=t.colorModeForDrapableLayerRenderPass(o),l=i.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===r.constantOr(ui.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const r=t.depthModeForSublayer(1,"opaque"===t.renderPass?Mv.ReadWrite:Mv.ReadOnly);JT(t,e,i,n,r,a,!1)}if("translucent"===t.renderPass&&i.paint.get("fill-antialias")){const r=t.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Mv.ReadOnly);JT(t,e,i,n,r,a,!0)}},"fill-extrusion":function(t,e,i,n){const r=i.paint.get("fill-extrusion-opacity"),s=t.context,o=s.gl,a=t.terrain,l=a&&a.renderingToTexture,c=i.paint.get("fill-extrusion-cutoff-fade-range");if(0===r)return;const h=t.conflationActive&&t.layerUsedInConflation(i,e.getSource());if(h&&function(t,e,i,n){for(const r of n){const n=e.getTile(r).getBucket(i);n&&(n.updateReplacement(r,t.replacementSource),n.uploadCentroid(t.context))}}(t,e,i,n),a||h)for(const r of n){const n=e.getTile(r).getBucket(i);n&&iM(t.context,e,r,n,i,a,h)}if("shadow"===t.renderPass&&t.shadowRenderer){const s=t.shadowRenderer;if(a&&r<.65&&i._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof Ms)return;const o=s.getShadowPassDepthMode(),l=s.getShadowPassColorMode();tM(t,e,i,n,o,Cv.disabled,l,h)}else if("translucent"===t.renderPass){const u=!i.paint.get("fill-extrusion-pattern").constantOr(1);if(!l){const s=new Mv(t.context.gl.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D);0===c&&1===r&&u?tM(t,e,i,n,s,Cv.disabled,Pv.unblended,h):(tM(t,e,i,n,s,Cv.disabled,Pv.disabled,h),tM(t,e,i,n,s,t.stencilModeFor3D(),t.colorModeForRenderPass(),h),t.resetStencilClippingMasks())}if(t.style.enable3dLights()&&u&&(!a&&"globe"!==t.transform.projection.name||l)){const r=i.paint.get("fill-extrusion-opacity"),c=i.paint.get("fill-extrusion-ambient-occlusion-intensity"),u=i.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),d=i.paint.get("fill-extrusion-flood-light-intensity"),p=i.paint.get("fill-extrusion-flood-light-color").toArray01().slice(0,3),f=c>0&&u>0,m=d>0,g=(t,e,i)=>(1-i)*t+i*e,_=s=>{const a=t.depthModeForSublayer(1,Mv.ReadOnly,o.LEQUAL,!0),l=i.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),f=g(.1,3,l),m=t._showOverdrawInspector;if(!m){const l=new Cv({func:o.ALWAYS,mask:255},255,255,o.KEEP,o.KEEP,o.REPLACE),m=new Pv([o.ONE,o.ONE,o.ONE,o.ONE],ui.transparent,[!1,!1,!1,!0],o.MIN);eM(t,e,i,n,a,l,m,Ov.disabled,s,"sdf",r,c,u,d,p,f,h,!1)}{const l=m?Cv.disabled:new Cv({func:o.EQUAL,mask:255},255,255,o.KEEP,o.DECR,o.DECR),g=m?t.colorModeForRenderPass():new Pv([o.ONE_MINUS_DST_ALPHA,o.DST_ALPHA,o.ONE,o.ONE],ui.transparent,[!0,!0,!0,!0]);eM(t,e,i,n,a,l,g,Ov.disabled,s,"color",r,c,u,d,p,f,h,!1)}};if(l){const l=(s,a,l)=>{const f=t.depthModeForSublayer(1,Mv.ReadOnly,o.LEQUAL,!1),m=i.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),_=g(.1,3,m);{const l=new Pv([o.ONE,o.ONE,o.ONE,o.ONE],ui.transparent,[!1,!1,!1,!0]);eM(t,e,i,n,f,Cv.disabled,l,Ov.disabled,s,"clear",r,c,u,d,p,_,h,a)}{const l=new Cv({func:o.ALWAYS,mask:255},255,255,o.KEEP,o.KEEP,o.REPLACE),m=new Pv([o.ONE,o.ONE,o.ONE,o.ONE],ui.transparent,[!1,!1,!1,!0],o.MIN);eM(t,e,i,n,f,l,m,Ov.disabled,s,"sdf",r,c,u,d,p,_,h,a)}{const l=s?o.ZERO:o.ONE_MINUS_DST_ALPHA,m=new Cv({func:o.EQUAL,mask:255},255,255,o.KEEP,o.DECR,o.DECR),g=new Pv([l,o.DST_ALPHA,o.ONE_MINUS_DST_ALPHA,o.ZERO],ui.transparent,[!0,!0,!0,!0]);eM(t,e,i,n,f,m,g,Ov.disabled,s,"color",r,c,u,d,p,_,h,a)}{const m=new Pv([o.ONE,o.ONE,o.ONE,s?o.ZERO:o.ONE],ui.transparent,[!1,!1,!1,!0],s?o.FUNC_ADD:o.MAX);eM(t,e,i,n,f,Cv.disabled,m,Ov.disabled,s,"clear",r,c,u,d,p,_,h,a,l)}};if(f||m){let e;if(t.prepareDrawTile(),a){const t=a.drapeBufferSize[0],i=a.drapeBufferSize[1];e=a.framebufferCopyTexture,e&&(!e||e.size[0]===t&&e.size[1]===i)||(e&&e.destroy(),e=a.framebufferCopyTexture=new My(s,new ef({width:t,height:i}),o.RGBA)),e.bind(o.LINEAR,o.CLAMP_TO_EDGE),o.copyTexImage2D(o.TEXTURE_2D,0,o.RGBA,0,0,t,i,0)}f&&l(!0,!1,e),m&&l(!1,!0,e)}}else f&&_(!0),m&&_(!1)}}},hillshade:function(t,e,i,n){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;if(t.style.disableElevatedTerrain)return;const r=t.context,s=t.terrain&&t.terrain.renderingToTexture,[o,a]="translucent"!==t.renderPass||s?[{},n]:t.stencilConfigForOverlap(n);for(const n of a){const r=e.getTile(n);if(r.needsHillshadePrepare&&"offscreen"===t.renderPass)KS(t,r,i);else if("translucent"===t.renderPass){const e=t.depthModeForSublayer(0,Mv.ReadOnly),a=i.paint.get("hillshade-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(a),c=s&&t.terrain?t.terrain.stencilModeForRTTOverlap(n):o[n.overscaledZ];YS(t,n,r,i,e,c,l)}}r.viewport.set([0,0,t.width,t.height]),t.resetStencilClippingMasks()},raster:function(t,e,i,n,r,s){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;const o=t.context,a=o.gl,l=e.getSource(),c=function(t,e,i){const n=t.paint.get("raster-color"),r=[],s=t.paint.get("raster-resampling"),o=t.paint.get("raster-color-mix"),a=t.paint.get("raster-color-range"),l=[o[0],o[1],o[2],0],c=o[3],h="nearest"===s?i.NEAREST:i.LINEAR;if(n&&r.push("RASTER_COLOR"),n){e.activeTexture.set(i.TEXTURE2);let n=t.colorRampTexture;n||(n=t.colorRampTexture=new My(e,t.colorRamp,i.RGBA)),n.bind(i.LINEAR,i.CLAMP_TO_EDGE)}return{mix:l,range:a,offset:c,defines:r,resampling:h}}(i,o,a),h=c.defines,u="globe"===t.transform.projection.name;let d=!1;if(l instanceof Jx&&!n.length){if(!u)return;if(l.onNorthPole)d=!0,h.push("GLOBE_POLES");else{if(!l.onSouthPole)return;d=!0,h.push("GLOBE_POLES")}}const p=i.paint.get("raster-emissive-strength"),f=t.colorModeForDrapableLayerRenderPass(p),m=t.terrain&&t.terrain.renderingToTexture,g=l instanceof Jx&&0!==i.paint.get("raster-elevation"),_=!t.options.moving,y="nearest"===i.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;if(d){const n=e.getSource();if(!(n instanceof Jx))return;const r=n.texture;if(!r)return;const s=t.globeSharedBuffers;if(!s)return;const l=new Mv(a.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D),h=Float32Array.from(t.transform.expandedFarZProjMatrix);let u=Ld(0,0,t.transform);const d=Float32Array.from(Ad(md(new $u(0,0,0)))),m={opacity:1,mix:0};t.terrain&&t.terrain.prepareDrawTile(),o.activeTexture.set(a.TEXTURE0),r.bind(y,a.CLAMP_TO_EDGE),o.activeTexture.set(a.TEXTURE1),r.bind(y,a.CLAMP_TO_EDGE),r.useMipmap&&o.extTextureFilterAnisotropic&&t.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax);const[g,_,v,b]=s.getPoleBuffers(0,!0);let x;n.onNorthPole?(x=g,t.renderDefaultNorthPole=!1):(u=Au.scale(Au.create(),u,[1,-1,1]),x=_,t.renderDefaultSouthPole=!1);const w=((t,e,i,n,r,s,o,a,l,c,h,u)=>PT(t,e,i,new Float32Array(16),new Float32Array(9),[0,0],[0,0,0,0],0,[0,0],[0,0,0,0],1,n,r,s||[0,0],o,2,l,c,h,1,0,u))(h,d,u,m,i,n.perspectiveTransform||[0,0],i.paint.get("raster-elevation"),0,c.mix,c.offset,c.range,p),E=t.getOrCreateProgram("raster",{defines:c.defines});return t.uploadCommonUniforms(o,E,null),void E.draw(t,a.TRIANGLES,l,Cv.disabled,f,Ov.disabled,w,i.id,x,v,b)}if(!n.length)return;const[v,b]=l instanceof Jx||m?[{},n]:t.stencilConfigForOverlap(n),x=b[b.length-1].overscaledZ,w=g&&u;w&&c.defines.push("PROJECTION_GLOBE_VIEW"),g&&c.defines.push("RENDER_CUTOFF");for(const n of b){const r=n.toUnwrapped(),h=e.getTile(n);if(m&&(!h||!h.hasData()))continue;if(!h.texture)continue;let d,b;m?(d=Mv.disabled,b=n.projMatrix):g?(d=new Mv(a.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D),b=u?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(r,_)):(d=t.depthModeForSublayer(n.overscaledZ-x,1===i.paint.get("raster-opacity")?Mv.ReadWrite:Mv.ReadOnly,a.LESS),b=t.transform.calculateProjMatrix(r,_));const E=t.terrain&&m?t.terrain.stencilModeForRTTOverlap(n):v[n.overscaledZ],S=s?0:i.paint.get("raster-fade-duration");h.registerFadeDuration(S);const T=e.findLoadedParent(n,0),M=lT(h,T,e,t.transform,S);let A,C;t.terrain&&t.terrain.prepareDrawTile(),o.activeTexture.set(a.TEXTURE0),h.texture&&h.texture.bind(y,a.CLAMP_TO_EDGE),o.activeTexture.set(a.TEXTURE1),T?(T.texture&&T.texture.bind(y,a.CLAMP_TO_EDGE),A=Math.pow(2,T.tileID.overscaledZ-h.tileID.overscaledZ),C=[h.tileID.canonical.x*A%1,h.tileID.canonical.y*A%1]):h.texture&&h.texture.bind(y,a.CLAMP_TO_EDGE),h.texture&&h.texture.useMipmap&&o.extTextureFilterAnisotropic&&t.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax);const k=t.transform,P=l instanceof Jx?l.perspectiveTransform:[0,0],I=g?aM(k):[0,0,0,0];let D,O,L,z,R,F;if(w&&l instanceof Jx&&l.coordinates.length>3){D=Float32Array.from(Ad(md(new $u(0,0,0)))),O=Float32Array.from(k.globeMatrix),L=Float32Array.from(Dd(k)),z=[Qd(k.center.lng),Jd(k.center.lat)],F=[Qd(l.coordinates[1][0]),Jd(l.coordinates[1][1]),Qd(l.coordinates[3][0]),Jd(l.coordinates[3][1])];const e=new ac(l.coordinates[1],l.coordinates[3]);R=Float32Array.from(Rd(new $u(0,0,0),e,0,k.worldSize/t.transform._pixelsPerMercatorPixel))}else D=new Float32Array(16),O=new Float32Array(9),L=new Float32Array(16),z=[0,0],R=new Float32Array(16),F=[0,0,0,0];const B=PT(b,D,O,L,R,C||[0,0],F,Od(t.transform.zoom),z,I,A||1,M,i,P,g?i.paint.get("raster-elevation"):0,2,c.mix,c.offset,c.range,1,0,p),N=t.isTileAffectedByFog(n),j=t.getOrCreateProgram("raster",{defines:c.defines,overrideFog:N});if(t.uploadCommonUniforms(o,j,r),l instanceof Jx){if(m||!u)l.boundsBuffer&&l.boundsSegments&&j.draw(t,a.TRIANGLES,d,Cv.disabled,f,Ov.disabled,B,i.id,l.boundsBuffer,t.quadTriangleIndexBuffer,l.boundsSegments);else if(t.globeSharedBuffers){const[e,n,r]=t.globeSharedBuffers.getGridBuffers(0,!1);j.draw(t,a.TRIANGLES,d,Cv.disabled,f,Ov.frontCCW,B,i.id,e,n,r),j.draw(t,a.TRIANGLES,d,Cv.disabled,f,Ov.backCCW,B,i.id,e,n,r)}}else{const{tileBoundsBuffer:e,tileBoundsIndexBuffer:n,tileBoundsSegments:r}=t.getTileBoundsBuffers(h);j.draw(t,a.TRIANGLES,d,E,f,Ov.disabled,B,i.id,e,n,r)}}t.resetStencilClippingMasks()},background:function(t,e,i,n){const r=i.paint.get("background-color"),s=i.paint.get("background-opacity"),o=i.paint.get("background-emissive-strength");if(0===s)return;const a=t.context,l=a.gl,c=t.transform,h=c.tileSize,u=i.paint.get("background-pattern");if(t.isPatternMissing(u,i.scope))return;const d=!u&&1===r.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==d)return;const p=Cv.disabled,f=t.depthModeForSublayer(0,"opaque"===d?Mv.ReadWrite:Mv.ReadOnly),m=t.colorModeForDrapableLayerRenderPass(o),g=u?"backgroundPattern":"background";let _,y=n;y||(_=t.getBackgroundTiles(),y=Object.values(_).map((t=>t.tileID))),u&&(a.activeTexture.set(l.TEXTURE0),t.imageManager.bind(t.context,i.scope));for(const d of y){const y=t.isTileAffectedByFog(d),v=t.getOrCreateProgram(g,{overrideFog:y}),b=d.toUnwrapped(),x=n?d.projMatrix:t.transform.calculateProjMatrix(b);t.prepareDrawTile();const w=e?e.getTile(d):_?_[d.key]:new Fy(d,h,c.zoom,t),E=u?NT(x,o,s,t,u,i.scope,{tileID:d,tileSize:h}):BT(x,o,s,r);t.uploadCommonUniforms(a,v,b);const{tileBoundsBuffer:S,tileBoundsIndexBuffer:T,tileBoundsSegments:M}=t.getTileBoundsBuffers(w);v.draw(t,l.TRIANGLES,f,p,m,Ov.disabled,E,i.id,S,T,M)}},sky:function(t,e,i){const n=t._atmosphere?Od(t.transform.zoom):1,r=i.paint.get("sky-opacity")*n;if(0===r)return;const s=t.context,o=i.paint.get("sky-type"),a=new Mv(s.gl.LEQUAL,Mv.ReadOnly,[0,1]),l=t.frameCounter/1e3%1;"atmosphere"===o?"offscreen"===t.renderPass?i.needsSkyboxCapture(t)&&(function(t,e,i,n){const r=t.context,s=r.gl;let o=e.skyboxFbo;if(!o){o=e.skyboxFbo=r.createFramebuffer(32,32,!0,null),e.skyboxGeometry=new bM(r),e.skyboxTexture=r.gl.createTexture(),s.bindTexture(s.TEXTURE_CUBE_MAP,e.skyboxTexture),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,s.LINEAR);for(let t=0;t<6;++t)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,s.RGBA,32,32,0,s.RGBA,s.UNSIGNED_BYTE,null)}r.bindFramebuffer.set(o.framebuffer),r.viewport.set([0,0,32,32]);const a=e.getCenter(t,!0),l=t.getOrCreateProgram("skyboxCapture"),c=new Float64Array(16);Au.identity(c),Au.rotateY(c,c,.5*-Math.PI),xM(t,e,l,c,a,0),Au.identity(c),Au.rotateY(c,c,.5*Math.PI),xM(t,e,l,c,a,1),Au.identity(c),Au.rotateX(c,c,.5*-Math.PI),xM(t,e,l,c,a,2),Au.identity(c),Au.rotateX(c,c,.5*Math.PI),xM(t,e,l,c,a,3),Au.identity(c),xM(t,e,l,c,a,4),Au.identity(c),Au.rotateY(c,c,Math.PI),xM(t,e,l,c,a,5),r.viewport.set([0,0,t.width,t.height])}(t,i),i.markSkyboxValid(t)):"sky"===t.renderPass&&function(t,e,i,n,r){const s=t.context,o=s.gl,a=t.transform,l=t.getOrCreateProgram("skybox");s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_CUBE_MAP,e.skyboxTexture);const c=((t,e,i,n,r)=>({u_matrix:t,u_sun_direction:e,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(a.skyboxMatrix,e.getCenter(t,!1),0,n,r);t.uploadCommonUniforms(s,l),l.draw(t,o.TRIANGLES,i,Cv.disabled,t.colorModeForRenderPass(),Ov.backCW,c,"skybox",e.skyboxGeometry.vertexBuffer,e.skyboxGeometry.indexBuffer,e.skyboxGeometry.segment)}(t,i,a,r,l):"gradient"===o&&"sky"===t.renderPass&&function(t,e,i,n,r){const s=t.context,o=s.gl,a=t.transform,l=t.getOrCreateProgram("skyboxGradient");e.skyboxGeometry||(e.skyboxGeometry=new bM(s)),s.activeTexture.set(o.TEXTURE0);let c=e.colorRampTexture;c||(c=e.colorRampTexture=new My(s,e.colorRamp,o.RGBA)),c.bind(o.LINEAR,o.CLAMP_TO_EDGE);const h=((t,e,i,n,r)=>({u_matrix:t,u_color_ramp:0,u_center_direction:e,u_radius:E(i),u_opacity:n,u_temporal_offset:r}))(a.skyboxMatrix,e.getCenter(t,!1),e.paint.get("sky-gradient-radius"),n,r);t.uploadCommonUniforms(s,l),l.draw(t,o.TRIANGLES,i,Cv.disabled,t.colorModeForRenderPass(),Ov.backCW,h,"skyboxGradient",e.skyboxGeometry.vertexBuffer,e.skyboxGeometry.indexBuffer,e.skyboxGeometry.segment)}(t,i,a,r,l)},debug:function(t,e,i){for(let n=0;n<i.length;n++)pM(t,e,i[n])},custom:function(t,e,i,n){const r=t.context,s=i.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&i.isLayerDraped(e)){if("offscreen"===t.renderPass){const e=s.prerender;if(e){if(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const i=t.transform.pointMerc;e.call(s,r.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),Od(t.transform.zoom),[i.x,i.y],t.transform.pixelsPerMeterRatio)}else e.call(s,r.gl,t.transform.customLayerMatrix());r.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const e=s.renderToTile;if(e){const i=n[0].canonical,o=new cp(i.x+n[0].wrap*(1<<i.z),i.y,i.z);r.setDepthMode(Mv.disabled),r.setStencilMode(Cv.disabled),r.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),e.call(s,r.gl,o),r.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(Cv.disabled);const e="3d"===s.renderingMode?new Mv(t.context.gl.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Mv.ReadOnly);if(r.setDepthMode(e),"globe"===t.transform.projection.name){const e=t.transform.pointMerc;s.render(r.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),Od(t.transform.zoom),[e.x,e.y],t.transform.pixelsPerMeterRatio)}else s.render(r.gl,t.transform.customLayerMatrix());r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}else Y("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(t,e,i,n){if("opaque"===t.renderPass)return;const r=i.paint.get("model-opacity");if(0===r)return;const s=i.paint.get("model-cast-shadows");if("shadow"===t.renderPass){if(!s)return;if(t.terrain&&r<.65&&i._transitionablePaint._values["model-opacity"].value.expression instanceof Ms)return}const o=t.shadowRenderer,a=i.paint.get("model-receive-shadows");o&&(o.useNormalOffset=!0,a||(o.enabled=!1));const l=()=>{o&&(o.useNormalOffset=!0,a||(o.enabled=!0))},c=e.getSource();if("light-beam"===t.renderPass&&"batched-model"!==c.type)return;if("vector"===c.type||"geojson"===c.type)return function(t,e,i,n){const r=t.transform;if("mercator"!==r.projection.name)return void Y(`Drawing 3D models for ${r.projection.name} projection is not yet implemented`);const s=r.getFreeCameraOptions().position;if(!t.modelManager)return;const o=t.modelManager,a=t.shadowRenderer;if(!i._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const l=i._unevaluatedLayout._values["model-id"],c={...i.layout.get("model-id").parameters};for(const h of n){const n=e.getTile(h).getBucket(i);if(!n||n.projection.name!==r.projection.name)continue;const u=OM(h,r);c.zoom=u;const d=l.possiblyEvaluate(c);if(IM(t,n,h),DM.shadowUniformsInitialized=!1,DM.useSingleShadowCascade=!!a&&0===a.getMaxCascadeForTile(h.toUnwrapped()),"shadow"===t.renderPass&&a){if(1===t.currentShadowCascade&&n.isInsideFirstShadowMapFrustum)continue;const e=r.calculatePosMatrix(h.toUnwrapped(),r.worldSize);if(DM.tileMatrix.set(e),DM.shadowTileMatrix=Float32Array.from(a.calculateShadowPassMatrixFromMatrix(e)),DM.aabb.min.fill(0),DM.aabb.max[0]=DM.aabb.max[1]=un,DM.aabb.max[2]=0,RM(n,DM,t,i.scope))continue}const p=1<<h.canonical.z,f=[((s.x-h.wrap)*p-h.canonical.x)*un,(s.y*p-h.canonical.y)*un,s.z*p*un];for(let e in n.instancesPerModel){const r=n.instancesPerModel[e];r.features.length>0&&(e=d.evaluate(r.features[0].feature,{}));const s=o.getModel(e,i.scope);if(s&&s.uploaded)for(const e of s.nodes)LM(t,i,e,r,f,h,DM)}}}(t,e,i,n),void l();if(!c.loaded())return;if("batched-model"===c.type)return function(t,e,i,n){const r=t.context,s=t.transform,o=t.style.fog,a=t.shadowRenderer;if("mercator"!==s.projection.name)return void Y(`Drawing 3D landmark models for ${s.projection.name} projection is not yet implemented`);const l=t.transform.getFreeCameraOptions().position,c=Ou.scale([],[l.x,l.y,l.z],t.transform.worldSize);Ou.negate(c,c);const h=Au.identity([]),u=op(s.center.lat,s.zoom),d=Au.fromScaling([],[1,1,1/u]);Au.translate(h,h,c);const p=i.paint.get("model-opacity"),f=new Mv(r.gl.LEQUAL,Mv.ReadWrite,t.depthRangeFor3D),m=new Mv(r.gl.LEQUAL,Mv.ReadOnly,t.depthRangeFor3D),g=function(l,c){for(const u of n){const n=e.getTile(u).getBucket(i);if(!n||!n.uploaded)continue;let g=!1;a&&(g=0===a.getMaxCascadeForTile(u.toUnwrapped()));const _=s.calculatePosMatrix(u.toUnwrapped(),s.worldSize),y=n.modelTraits;for(const e of n.getNodesInfo()){if(e.hiddenByReplacement)continue;if(!e.node.meshes)continue;const n=e.node,v="light-beam"===t.renderPass,b=[..._],x=e.evaluatedScale;let w=0;t.terrain&&n.elevation&&(w=n.elevation*t.terrain.exaggeration()),Au.translate(b,b,[(n.anchor?n.anchor[0]:0)*(x[0]-1),(n.anchor?n.anchor[1]:0)*(x[1]-1),w]),x!==kb&&Au.scale(b,b,x),Au.multiply(b,b,n.matrix);const E=Au.multiply([],d,b);Au.multiply(E,h,E);const S=Au.invert([],E);Au.transpose(S,S),Au.scale(S,S,zM);const T=Au.multiply([],s.expandedFarZProjMatrix,b);for(let h=0;h<n.meshes.length;++h){const d=n.meshes[h],_=h===n.lightMeshIndex;if(_){if(!v&&!t.terrain&&t.shadowRenderer){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);continue}}else if(v)continue;const x={defines:[]},w=[];AM(x.defines,w,d,t),4&y||x.defines.push("DIFFUSE_SHADED"),g&&x.defines.push("SHADOWS_SINGLE_CASCADE");const M="shadow"===t.renderPass;if(M){PM(d,b,t,i);continue}let A=null;if(o){const e=MM(b,t.transform);if(A=new Float32Array(e),"globe"!==s.projection.name){const t=d.aabb.min,i=d.aabb.max,[n,r]=o.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);x.overrideFog=n>=mw||r>=mw}}const C=t.getOrCreateProgram("model",x);!M&&a&&(a.useNormalOffset=!!d.normalBuffer,a.setupShadowsFromMatrix(b,C,a.useNormalOffset)),t.uploadCommonUniforms(r,C,u.toUnwrapped(),A);const k=d.material,P=k.pbrMetallicRoughness;P.metallicFactor=.9,P.roughnessFactor=.5;const I=0,D=VT(new Float32Array(T),new Float32Array(E),new Float32Array(S),t,p,P.baseColorFactor,k.emissiveFactor,P.metallicFactor,P.roughnessFactor,k,I,i);C.draw(t,r.gl.TRIANGLES,c&&!_?f:m,Cv.disabled,l?_||p<1||e.hasTranslucentParts?Pv.alphaBlended:Pv.unblended:Pv.disabled,Ov.backCCW,D,i.id,d.vertexBuffer,d.indexBuffer,d.segments,i.paint,t.transform.zoom,void 0,w)}}}};(function(t,e,i,n){const r=t.terrain?t.terrain.exaggeration():0,s=t.transform.zoom;for(const o of n){const n=e.getTile(o).getBucket(i);n&&(t.conflationActive&&n.updateReplacement(o,t.replacementSource),n.evaluateScale(t,i),t.terrain&&r>0&&n.elevationUpdate(t.terrain,r,o,i.source),n.needsReEvaluation(t,s,i)&&n.evaluate(i))}})(t,e,i,n),1===p?g(!0,!0):(g(!1,!0),g(!0,!1))}(t,e,i,n),void l();const h=c.getModels(),u=[],d=t.transform.getFreeCameraOptions().position,p=Ou.scale([],[d.x,d.y,d.z],t.transform.worldSize);Ou.negate(p,p);const f=[],m=[];let g=0;for(const e of h){const n=i.paint.get("model-rotation").constantOr(null),r=i.paint.get("model-scale").constantOr(null),s=i.paint.get("model-translation").constantOr(null);e.computeModelMatrix(t,n,r,s,!0,!0,!1);const o=Au.identity([]),a=op(e.position.lat,t.transform.zoom),l=Au.fromScaling([],[1,1,1/a]);Au.translate(o,o,p),u.push({zScaleMatrix:l,negCameraPosMatrix:o});for(const i of e.nodes)kM(t.transform,i,e.matrix,t.transform.expandedFarZProjMatrix,g,f,m);g++}if(f.sort(((t,e)=>e.depth-t.depth)),"shadow"!==t.renderPass){if(1===r)for(const e of m)CM(e,t,i,u[e.modelIndex],Cv.disabled,t.colorModeForRenderPass());else{for(const e of m)CM(e,t,i,u[e.modelIndex],Cv.disabled,Pv.disabled);for(const e of m)CM(e,t,i,u[e.modelIndex],t.stencilModeFor3D(),t.colorModeForRenderPass());t.resetStencilClippingMasks()}for(const e of f)CM(e,t,i,u[e.modelIndex],Cv.disabled,t.colorModeForRenderPass());l()}else{for(const e of m)PM(e.mesh,e.nodeModelMatrix,t,i);for(const e of f)PM(e.mesh,e.nodeModelMatrix,t,i);l()}}},jM={modelUpload:function(t,e,i){const n=e.getSource();if(!n.loaded())return;if("vector"===n.type||"geojson"===n.type)return void(t.modelManager&&t.modelManager.upload(t,i));if("batched-model"===n.type)return;const r=n.getModels();for(const e of r)e.upload(t.context)}};class VM{constructor(t,e,i){this.context=new Lv(t,e),this.transform=i,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=zv.maxUnderzooming+zv.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new Xb,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new qM(this),this._wireframeDebugCache=new BM,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0}updateTerrain(t,e){const i=!!t&&!!t.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new dT(this,t));const n=this._terrain;this.transform.elevation=i?n:null,n.update(t,this.transform,e),this.transform.elevation&&!n.enabled&&(this.transform.elevation=null)}_updateFog(t){const e=t.fog;if(!e||"globe"===this.transform.projection.name||e.getOpacity(this.transform.pitch)<1||e.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,n]=e.getFovAdjustedRange(this.transform._fov);if(i>n)return void(this.transform.fogCullDistSq=null);const r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,e){if(this.width=t*pe.devicePixelRatio,this.height=e*pe.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style.order)this.style._mergedLayers[t].resize()}setup(){const t=this.context,i=new Ia;i.emplaceBack(0,0),i.emplaceBack(un,0),i.emplaceBack(0,un),i.emplaceBack(un,un),this.tileExtentBuffer=t.createVertexBuffer(i,ju.members),this.tileExtentSegments=bl.simpleSegment(0,0,4,2);const n=new Ia;n.emplaceBack(0,0),n.emplaceBack(un,0),n.emplaceBack(0,un),n.emplaceBack(un,un),this.debugBuffer=t.createVertexBuffer(n,ju.members),this.debugSegments=bl.simpleSegment(0,0,4,5);const r=new Ia;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(r,ju.members),this.viewportSegments=bl.simpleSegment(0,0,4,2);const s=new Oa;s.emplaceBack(0,0,0,0),s.emplaceBack(un,0,un,0),s.emplaceBack(0,un,0,un),s.emplaceBack(un,un,un,un),this.mercatorBoundsBuffer=t.createVertexBuffer(s,zy.members),this.mercatorBoundsSegments=bl.simpleSegment(0,0,4,2);const o=new Za;o.emplaceBack(0,1,2),o.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(o);const a=new el;for(const t of[0,1,3,2,0])a.emplaceBack(t);this.debugIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new My(t,new ef({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA),this.identityMat=Au.create();const l=this.context.gl;this.stencilClearMode=new Cv({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(e.performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(t){return t._makeTileBoundsBuffers(this.context,this.transform.projection),t._tileBoundsBuffer?{tileBoundsBuffer:t._tileBoundsBuffer,tileBoundsIndexBuffer:t._tileBoundsIndexBuffer,tileBoundsSegments:t._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,t.TRIANGLES,Mv.disabled,this.stencilClearMode,Pv.disabled,Ov.disabled,aT(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,e,i){if(!e||this.currentStencilSource===e.id||!t.isTileClipped()||!i||0===i.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let t=!1;for(const e of i)if(void 0===this._tileClippingMaskIDs[e.key]){t=!0;break}if(!t)return}this.currentStencilSource=e.id;const n=this.context,r=n.gl;this.nextStencilID+i.length>256&&this.clearStencil(),n.setColorMode(Pv.disabled),n.setDepthMode(Mv.disabled);const s=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of i){const i=e.getTile(t),n=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,{tileBoundsBuffer:o,tileBoundsIndexBuffer:a,tileBoundsSegments:l}=this.getTileBoundsBuffers(i);s.draw(this,r.TRIANGLES,Mv.disabled,new Cv({func:r.ALWAYS,mask:0},n,255,r.KEEP,r.KEEP,r.REPLACE),Pv.disabled,Ov.disabled,aT(t.projMatrix),"$clipping",o,a,l)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new Cv({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const e=this.context.gl;return new Cv({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,i=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),n=i[i.length-1].overscaledZ,r=i[0].overscaledZ-n+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();const t={};for(let i=0;i<r;i++)t[i+n]=new Cv({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=r,[t,i]}return[{[n]:Cv.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const e=1/8;return new Pv([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new ui(e,e,e,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Pv.unblended:Pv.alphaBlended}colorModeForDrapableLayerRenderPass(t){const e=this.context.gl;return(()=>this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?new Pv([e.ONE,e.ONE_MINUS_SRC_ALPHA,e.CONSTANT_ALPHA,e.ONE_MINUS_SRC_ALPHA],new ui(0,0,0,void 0===t?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(t,e,i,n=!1){if(!this.opaquePassEnabledForLayer()&&!n)return Mv.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Mv(i||this.context.gl.LEQUAL,e,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){this._wireframeDebugCache.update(this.frameCounter),this.style=t,this.options=i;const n=this.style._mergedLayers,r=this.style.order,s=r.map((t=>n[t])),o=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(pe.now()),this.imageManager.beginFrame();let a=0,l=!1;for(const t in o){const e=o[t];e.used&&(e.prepare(this.context),e.getSource().usedInConflation&&++a)}const c={},h={},u={},d={},p={};for(const t in o){const e=o[t];c[t]=e.getVisibleCoordinates(),h[t]=c[t].slice().reverse(),u[t]=e.getVisibleCoordinates(!0).reverse(),d[t]=e.getShadowCasterCoordinates(),p[t]=e.sortCoordinatesByDistance(c[t])}const f=t=>{const e=this.style.getLayerSourceCache(t);return e&&e.used?e.getSource():null};if(a){const t=[];for(const e of s)this.layerUsedInConflation(e,f(e))&&t.push(e);if(t&&t.length>1){const e=[];for(const i of t){const t=this.style.getLayerSourceCache(i);t&&t.used&&t.getSource().usedInConflation&&e.push({layer:i.fqid,cache:t})}this.replacementSource.setSources(e),l=!0}}l||this.replacementSource.clear(),this.conflationActive=l,this.minCutoffZoom=0,this.longestCutoffRange=0;for(const t of s){const e=t.cutoffRange();if(this.longestCutoffRange=Math.max(e,this.longestCutoffRange),e>0){const e=f(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}}this.opaquePassCutoff=1/0;for(let t=0;t<s.length;t++)if(s[t].is3D()){this.opaquePassCutoff=t;break}const m=this.style&&this.style.fog;m?(this._fogVisible=0!==m.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=m.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(u),this.opaquePassCutoff=0);const g=this._shadowRenderer;if(g){g.updateShadowParameters(this.transform,this.style.directionalLight);for(const t in o)for(const e of c[t]){let t={min:0,max:0};this.terrain&&(t=this.terrain.getMinMaxForTile(e)||t),g.addShadowReceiver(e.toUnwrapped(),t.min,t.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new Hd(this.context));for(const e of s){if(e.isHidden(this.transform.zoom))continue;const i=t.getLayerSourceCache(e);this.uploadLayer(this,e,i)}if(this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new TM),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),!Kt.has(this.context.gl))return;this.renderPass="offscreen";for(const e of s){const i=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const n=i?h[i.id]:void 0;("custom"===e.type||"raster"===e.type||e.isSky()||n&&n.length)&&this.renderLayer(this,i,e,n)}this.depthRangeFor3D=[0,1-(s.length+2)*this.numSublayers*this.depthEpsilon];const _=this.terrain;_&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&!this.transform.isOrthographic&&_.drawDepth(),this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,d)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const y="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),v=(()=>{if(i.showOverdrawInspector)return ui.black;if(this.style.fog&&this.transform.projection.supportsFog&&!y){const t=this.style.fog.properties.get("color").toArray01();return new ui(...t)}if(this.style.fog&&this.transform.projection.supportsFog&&y){const t=this.style.fog.properties.get("space-color").toArray01();return new ui(...t)}return ui.transparent})();if(this.context.clear({color:v,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&y&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){const e=s[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())continue;const n=i?(e.is3D()?p:h)[i.id]:void 0;this._renderTileClippingMasks(e,i,n),this.renderLayer(this,i,e,n)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&y&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||Od(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){const e=s[this.currentLayer],i=t.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,i,e,i?h[i.id]:void 0)}this.renderPass="translucent",this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let b=0;for(g&&(b=g.getShadowCastingLayerCount());this.currentLayer<r.length;){const e=s[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky()){++this.currentLayer;continue}if(_&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=_.renderBatch(this.currentLayer);continue}let n;if(i&&(n=("symbol"===e.type?u:e.is3D()?p:h)[i.id]),this._renderTileClippingMasks(e,i,i?c[i.id]:void 0),this.renderLayer(this,i,e,n),!_&&g&&b>0&&e.hasShadowPass()&&0==--b&&(g.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=s[this.currentLayer];if(!e.hasLightBeamPass())continue;const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,i?h[i.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let e=null;s.forEach((i=>{const n=t.getLayerSourceCache(i);n&&!i.isHidden(this.transform.zoom)&&n.getVisibleCoordinates().length&&(!e||e.getSource().maxzoom<n.getSource().maxzoom)&&(e=n)})),e&&this.options.showTileBoundaries&&NM.debug(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;fM(t,t.transform.height-(e.top||0),3,lM),fM(t,e.bottom||0,3,cM),mM(t,e.left||0,3,hM),mM(t,t.transform.width-(e.right||0),3,uM);const i=t.transform.centerPoint;!function(t,e,i,n){gM(t,e-1,i-10,2,20,n),gM(t,e-10,i-1,20,2,n)}(t,i.x,t.transform.height-i.y,dM)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(e.performance.now()),this.saveCanvasCopy()),l||(this.conflationActive=!1)}uploadLayer(t,e,i){this.gpuTimingStart(e),(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes(e.type)||t.terrain&&"custom"===e.type)&&jM[`${e.type}Upload`]&&jM[`${e.type}Upload`](t,i,e.scope),this.gpuTimingEnd()}renderLayer(t,e,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||"model"===i.type||"raster"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes(i.type)||t.terrain&&"custom"===i.type)&&NM[i.type](t,e,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(t){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery,i=this.context.gl;let n=this.gpuTimers[t.id];n||(n=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:i.createQuery()}),n.calls++,i.beginQuery(e.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const t=this.context.extTimerQuery,e=this.context.gl,i=e.createQuery();this.deferredRenderGpuTimeQueries.push(i),e.beginQuery(t.TIME_ELAPSED_EXT,i)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const t=this.gpuTimers;return this.gpuTimers={},t}collectDeferredRenderGpuQueries(){const t=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],t}queryGpuTimers(t){const e={};for(const i in t){const n=t[i],r=this.context.extTimerQuery,s=r.getQueryParameter(n.query,this.context.gl.QUERY_RESULT)/1e6;r.deleteQueryEXT(n.query),e[i]=s}return e}queryGpuTimeDeferredRender(t){if(!this.options.gpuTimingDeferredRender)return 0;const e=this.context.extTimerQuery,i=this.context.gl;let n=0;for(const r of t)n+=e.getQueryParameter(r,i.QUERY_RESULT)/1e6,e.deleteQueryEXT(r);return n}translatePosMatrix(t,e,i,n,r){if(!i[0]&&!i[1])return t;const s=r?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(s){const t=Math.sin(s),e=Math.cos(s);i=[i[0]*e-i[1]*t,i[0]*t+i[1]*e]}const o=[r?i[0]:rb(e,i[0],this.transform.zoom),r?i[1]:rb(e,i[1],this.transform.zoom),0],a=new Float32Array(16);return Au.translate(a,t,o),a}saveTileTexture(t){const e=t.size[0],i=this._tileTextures[e];i?i.push(t):this._tileTextures[e]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t,e){return null===t||void 0!==t&&!this.imageManager.getPattern(t.toString(),e)}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(t,e,i){const n=void 0===i?this.terrain&&this.terrain.renderingToTexture:i,r=this.terrain&&0===this.terrain.exaggeration(),s=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===t||"terrainRaster"===t?(s.push("LIGHTING_3D_MODE"),s.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):n||s.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass?this._shadowMapDebug||s.push("DEPTH_TEXTURE"):this.shadowRenderer&&(this.shadowRenderer.useNormalOffset?s.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"):s.push("RENDER_SHADOWS","DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(s.push("TERRAIN"),this.linearFloatFilteringSupported()&&s.push("TERRAIN_DEM_FLOAT_FORMAT"),r&&s.push("ZERO_EXAGGERATION")),"globe"===this.transform.projection.name&&s.push("GLOBE"),!this._fogVisible||n||void 0!==e&&!e||s.push("FOG","FOG_DITHERING"),n&&s.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&s.push("OVERDRAW_INSPECTOR"),s}getOrCreateProgram(t,e){this.cache=this.cache||{};const i=e&&e.defines||[],n=e&&e.config,r=this.currentGlobalDefines(t,e&&e.overrideFog,e&&e.overrideRtt).concat(i),s=gT.cacheKey(HS[t],t,r,n);return this.cache[s]||(this.cache[s]=new gT(this.context,t,HS[t],n,HT[t],r)),this.cache[s]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=e.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new My(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,e){if(this.style.enable3dLights()){const i=this.style.directionalLight,n=this.style.ambientLight;if(i&&n){const r=((t,e)=>{const i=t.properties.get("direction"),n=t.properties.get("color").toArray01(),r=t.properties.get("intensity"),s=e.properties.get("color").toArray01(),o=e.properties.get("intensity"),a=[i.x,i.y,i.z],l=at(s,o),c=at(n,r);return{u_lighting_ambient_color:l,u_lighting_directional_dir:a,u_lighting_directional_color:c,u_ground_radiance:pT(a,c,l)}})(i,n);e.setLightsUniformValues(t,r)}}}uploadCommonUniforms(t,e,i,n,r){if(this.uploadCommonLightUniforms(t,e),this.terrain&&this.terrain.renderingToTexture)return;const s=this.style.fog;if(s){const r=s.getOpacity(this.transform.pitch),o=((t,e,i,n,r,s,o,a,l,c,h,u)=>{const d=t.transform,p=e.properties.get("color").toArray01();p[3]=n;const f=t.frameCounter/1e3%1,[m,g]=e.properties.get("vertical-range");return{u_fog_matrix:i?d.calculateFogTileMatrix(i):u||t.identityMat,u_fog_range:e.getFovAdjustedRange(d._fov),u_fog_color:p,u_fog_horizon_blend:e.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(m,g),g],u_fog_temporal_offset:f,u_frustum_tl:r,u_frustum_tr:s,u_frustum_br:o,u_frustum_bl:a,u_globe_pos:l,u_globe_radius:c,u_viewport:h,u_globe_transition:Od(d.zoom),u_is_globe:+("globe"===d.projection.name)}})(this,s,i,r,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*pe.devicePixelRatio,this.transform.height*pe.devicePixelRatio],n);e.setFogUniformValues(t,o)}r&&e.setCutoffUniformValues(t,r.uniformValues)}setTileLoadedFlag(t){this.tileLoaded=t}saveCanvasCopy(){const t=this.canvasCopy();t&&(this.frameCopies.push(t),this.tileLoaded=!1)}canvasCopy(){const t=this.context.gl,e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,t.drawingBufferWidth,t.drawingBufferHeight,0),e}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const t=this.style&&this.style.fog;return!!t&&0!==t.getOpacity(this.transform.pitch)}getBackgroundTiles(){const t=this._backgroundTiles,e=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512});for(const n of i)e[n.key]=t[n.key]||new Fy(n,512,this.transform.tileZoom,this);return e}clearBackgroundTiles(){this._backgroundTiles={}}layerUsedInConflation(t,e){return!(!t.is3D()||t.minzoom&&t.minzoom>this.transform.zoom||"building"!==t.sourceLayer&&(!e||"batched-model"!==e.type))}isTileAffectedByFog(t){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let e=this._cachedTileFogOpacities[t.key];return e||(this._cachedTileFogOpacities[t.key]=e=this.style.fog.getOpacityForTile(t)),e[0]>=mw||e[1]>=mw}}const UM=2048;class $M{constructor(t,e){this.aabb=t,this.lastCascade=e}}class HM{add(t,e){const i=this.receivers[t.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],e.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],e.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],e.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],e.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],e.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],e.max[2])):this.receivers[t.key]=new $M(e,null)}clear(){this.receivers={}}get(t){return this.receivers[t.key]}computeRequiredCascades(t,e,i){const n=ed.fromPoints(t.points);let r=0;for(const t in this.receivers){const s=this.receivers[t];if(!s)continue;if(!n.intersectsAabb(s.aabb))continue;s.aabb.min=n.closestPoint(s.aabb.min),s.aabb.max=n.closestPoint(s.aabb.max);const o=s.aabb.getCorners();for(let t=0;t<i.length;t++){let n=!0;for(const r of o){const s=[r[0]*e,r[1]*e,r[2]];if(Ou.transformMat4(s,s,i[t].matrix),s[0]<-1||s[0]>1||s[1]<-1||s[1]>1){n=!1;break}}if(s.lastCascade=t,r=Math.max(r,t),n)break}}return r+1}}class qM{constructor(t){this.painter=t,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new HM,this._depthMode=new Mv(t.context.gl.LEQUAL,Mv.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this.useNormalOffset=!1}destroy(){for(const t of this._cascades)t.texture.destroy(),t.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,e){const i=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!e||!e.properties)return;const n=e.properties.get("shadow-intensity");if(!e.shadowsEnabled()||n<=0)return;if(this._shadowLayerCount=i.style.order.reduce(((e,n)=>{const r=i.style._mergedLayers[n];return e+(r.hasShadowPass()&&!r.isHidden(t.zoom)?1:0)}),0),this._enabled=this._shadowLayerCount>0,!this._enabled)return;const r=i.context,s=UM,o=UM;if(0===this._cascades.length)for(let t=0;t<2;++t){const t=i._shadowMapDebug,e=r.gl,n=r.createFramebuffer(s,o,t,"texture"),a=new My(r,{width:s,height:o,data:null},e.DEPTH_COMPONENT);if(n.depthAttachment.set(a.texture),t){const t=new My(r,{width:s,height:o,data:null},e.RGBA);n.colorAttachment.set(t.texture)}this._cascades.push({framebuffer:n,texture:a,matrix:[],far:0,boundingSphereRadius:0,frustum:new td,scale:0})}this.shadowDirection=GM(e);let a=0;if(t.elevation){const e=t.elevation,i=[1e4,-1e4];e.visibleDemTiles.filter((t=>t.dem)).forEach((t=>{const e=t.dem.tree;i[0]=Math.min(i[0],e.minimums[0]),i[1]=Math.max(i[1],e.maximums[0])})),1e4!==i[0]&&(a=(i[1]-i[0])*e.exaggeration())}const l=1.5*t.cameraToCenterDistance,c=3*l,h=new Float64Array(16);for(let e=0;e<2;++e){const i=this._cascades[e];let n=t.height/50,r=1;0===e?r=l:(n=l,r=c);const[s,o]=YM(t,this.shadowDirection,n,r,UM,a);i.scale=t.scale,i.matrix=s,i.boundingSphereRadius=o,Au.invert(h,i.matrix),i.frustum=td.fromInvProjectionMatrix(h,1,0,!0),i.far=r}this._uniformValues.u_fade_range=[.75*this._cascades[1].far,this._cascades[1].far],this._uniformValues.u_shadow_intensity=n,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=.00048828125,this._uniformValues.u_shadow_map_resolution=UM,this._uniformValues.u_shadowmap_0=jT.ShadowMap0,this._uniformValues.u_shadowmap_1=jT.ShadowMap0+1,this._groundShadowTiles=i.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const u=i.transform.elevation;for(const t of this._groundShadowTiles){let e={min:0,max:0};if(u){const i=u.getMinMaxForTile(t);i&&(e=i)}this.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}get enabled(){return this._enabled}set enabled(t){this._enabled=t}drawShadowPass(t,e){if(!this._enabled)return;const i=this.painter,n=i.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(i.transform.getFrustum(0),i.transform.worldSize,this._cascades),n.viewport.set([0,0,UM,UM]);for(let r=0;r<this._numCascadesToRender;++r){i.currentShadowCascade=r,n.bindFramebuffer.set(this._cascades[r].framebuffer.framebuffer),n.clear({color:ui.white,depth:1});for(const n of t.order){const r=t._mergedLayers[n];if(!r.hasShadowPass()||r.isHidden(i.transform.zoom))continue;const s=t.getLayerSourceCache(r),o=s?e[s.id]:void 0;("model"===r.type||o&&o.length)&&i.renderLayer(i,s,r,o)}}i.currentShadowCascade=0}drawGroundShadows(){if(!this._enabled)return;const t=this.painter,e=t.style,i=t.context,n=e.directionalLight,r=e.ambientLight;if(!n||!r)return;const s=[],o=eT(t,t.longestCutoffRange);o.shouldRenderCutoff&&s.push("RENDER_CUTOFF");const a=ZM(n,r),l=new Mv(i.gl.LEQUAL,Mv.ReadOnly,t.depthRangeFor3D);for(const e of this._groundShadowTiles){const n=e.toUnwrapped(),r=t.isTileAffectedByFog(e),c=t.getOrCreateProgram("groundShadow",{defines:s,overrideFog:r});this.setupShadows(n,c),t.uploadCommonUniforms(i,c,n,null,o);const h={u_matrix:t.transform.calculateProjMatrix(n),u_ground_shadow_factor:a};c.draw(t,i.gl.TRIANGLES,l,Cv.disabled,Pv.multiply,Ov.disabled,h,"ground_shadow",t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments,{},t.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?Pv.unblended:Pv.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(t){const e=this.painter.transform,i=e.calculatePosMatrix(t,e.worldSize);return Au.multiply(i,this._cascades[this.painter.currentShadowCascade].matrix,i),Float32Array.from(i)}calculateShadowPassMatrixFromMatrix(t){return Au.multiply(t,this._cascades[this.painter.currentShadowCascade].matrix,t),Float32Array.from(t)}setupShadows(t,e,i,n=0){if(!this._enabled)return;const r=this.painter.transform,s=this.painter.context,o=s.gl,a=this._uniformValues,l=new Float64Array(16),c=r.calculatePosMatrix(t,r.worldSize);for(let t=0;t<2;t++)Au.multiply(l,this._cascades[t].matrix,c),a[0===t?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(l),s.activeTexture.set(o.TEXTURE0+jT.ShadowMap0+t),this._cascades[t].texture.bind(o.NEAREST,o.CLAMP_TO_EDGE);if(this.useNormalOffset=!!i,this.useNormalOffset){const e=lp(t.canonical),s=2/r.tileSize*un/UM,o=s*this._cascades[0].boundingSphereRadius,l=s*this._cascades[1].boundingSphereRadius,c=("vector-tile"===i?1:3)/Math.pow(2,n-t.canonical.z-(1-r.zoom+Math.floor(r.zoom)));a.u_shadow_normal_offset=[e,o*c,l*c],a.u_shadow_bias=[6e-5,.0012,.012]}else a.u_shadow_bias=[36e-5,.0012,.012];e.setShadowUniformValues(s,a)}setupShadowsFromMatrix(t,e,i=!1){if(!this._enabled)return;const n=this.painter.context,r=n.gl,s=this._uniformValues,o=new Float64Array(16);for(let e=0;e<2;e++)Au.multiply(o,this._cascades[e].matrix,t),s[0===e?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(o),n.activeTexture.set(r.TEXTURE0+jT.ShadowMap0+e),this._cascades[e].texture.bind(r.NEAREST,r.CLAMP_TO_EDGE);if(this.useNormalOffset=i,i){const t=5;s.u_shadow_normal_offset=[1,t,t],s.u_shadow_bias=[6e-5,.0012,.012]}else s.u_shadow_bias=[36e-5,.0012,.012];e.setShadowUniformValues(n,s)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(t,e,i,n){if(n[2]>=0)return{};const r=function(t,e,i){const n=i/(1<<t.canonical.z);return new ed([t.canonical.x*n+t.wrap*i,t.canonical.y*n+t.wrap*i,0],[(t.canonical.x+1)*n+t.wrap*i,(t.canonical.y+1)*n+t.wrap*i,e])}(t,e,i).getCorners(),s=e/-n[2];n[0]<0?(Ou.add(r[0],r[0],[n[0]*s,0,0]),Ou.add(r[3],r[3],[n[0]*s,0,0])):n[0]>0&&(Ou.add(r[1],r[1],[n[0]*s,0,0]),Ou.add(r[2],r[2],[n[0]*s,0,0])),n[1]<0?(Ou.add(r[0],r[0],[0,n[1]*s,0]),Ou.add(r[1],r[1],[0,n[1]*s,0])):n[1]>0&&(Ou.add(r[2],r[2],[0,n[1]*s,0]),Ou.add(r[3],r[3],[0,n[1]*s,0]));const o={};return o.vertices=r,o.planes=[WM(r[1],r[0],r[4]),WM(r[2],r[1],r[5]),WM(r[3],r[2],r[6]),WM(r[0],r[3],r[7])],o}addShadowReceiver(t,e,i){this._receivers.add(t,ed.fromTileIdAndHeight(t,e,i))}getMaxCascadeForTile(t){const e=this._receivers.get(t);return e&&e.lastCascade?e.lastCascade:0}}function WM(t,e,i){const n=Ou.sub([],i,e),r=Ou.sub([],t,e),s=Ou.cross([],n,r),o=Ou.length(s);return 0===o?[0,0,1,0]:(Ou.scale(s,s,1/o),[s[0],s[1],s[2],-Ou.dot(s,e)])}function GM(t){const e=t.properties.get("direction"),i=J(e.x,e.y,e.z);i[2]=I(i[2],0,75);const n=Q([i[0],i[1],i[2]]);return Ou.fromValues(n.x,n.y,n.z)}function ZM(t,e){const i=t.properties.get("color"),n=t.properties.get("intensity"),r=t.properties.get("direction"),s=[r.x,r.y,r.z],o=e.properties.get("color"),a=e.properties.get("intensity"),l=Math.max(Ou.dot([0,0,1],s),0),c=[0,0,0];Ou.scale(c,o.toArray01Linear().slice(0,3),a);const h=[0,0,0];return Ou.scale(h,i.toArray01Linear().slice(0,3),l*n),lt([c[0]>0?c[0]/(c[0]+h[0]):0,c[1]>0?c[1]/(c[1]+h[1]):0,c[2]>0?c[2]/(c[2]+h[2]):0])}function YM(t,e,i,n,r,s){const o=t.zoom,a=t.scale,l=t.worldSize,c=1/l,h=t.aspect,u=Math.sqrt(1+h*h)*Math.tan(.5*t.fovX),d=u*u,p=n-i,f=n+i;let m,g;d>p/f?(m=n,g=n*u):(m=.5*f*(1+d),g=.5*Math.sqrt(p*p+2*(n*n+i*i)*d+f*f*d*d));const _=t.projection.pixelsPerMeter(t.center.lat,l),y=t._camera.getCameraToWorldMercator(),v=[0,0,-m*c];Ou.transformMat4(v,v,y);let b=g*c;const x=t._edgeInsets;if(!(0===x.left&&0===x.top&&0===x.right&&0===x.bottom||x.left===x.right&&x.top===x.bottom)){const e=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?_:1),r=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,i,n);r[8]=2*-t.centerOffset.x/t.width,r[9]=2*t.centerOffset.y/t.height;const s=new Float64Array(16);Au.mul(s,r,e);const c=new Float64Array(16);Au.invert(c,s);const h=td.fromInvProjectionMatrix(c,l,o,!0);for(const e of h.points){const i=((w=e)[0]/=a,w[1]/=a,w[2]=tp(w[2],t._center.lat),w);b=Math.max(b,Ou.len(Ou.subtract([],v,i)))}}var w;b*=r/(r-1);const E=Math.acos(e[2]),S=Math.atan2(-e[0],-e[1]),T=new Kv;T.position=v,T.setPitchBearing(E,S);const M=T.getWorldToCamera(l,_),A=b*l,C=Math.min(t._mercatorZfromZoom(17)*l*-2,-2*A),k=T.getCameraToClipOrthographic(-A,A,-A,A,C,(A+s*_)/e[2]),P=new Float64Array(16);Au.multiply(P,k,M);const I=Ou.fromValues(Math.floor(1e6*v[0])/1e6*l,Math.floor(1e6*v[1])/1e6*l,0),D=.5*r,O=[0,0,0];Ou.transformMat4(O,I,P),Ou.scale(O,O,D);const L=[Math.floor(O[0]),Math.floor(O[1]),Math.floor(O[2])],z=[0,0,0];Ou.sub(z,O,L),Ou.scale(z,z,-1/D);const R=new Float64Array(16);return Au.identity(R),Au.translate(R,R,z),Au.multiply(P,R,P),[P,A]}class XM extends Ie{constructor(t){super(),this.requestManager=t,this.models={"":{}},this.numModelsLoading={}}loadModel(t,e){return mE(this.requestManager.transformRequest(e,vt.Model).url).then((e=>{if(!e)return;const i=SE(e),n=new Pb(t,void 0,void 0,i);return n.computeBoundsAndApplyParent(),n})).catch((i=>{this.fire(new Pe(new Error(`Could not load model ${t} from ${e}: ${i.message}`)))}))}load(t,e){this.models[e]||(this.models[e]={});const i=Object.keys(t);this.numModelsLoading[e]=(this.numModelsLoading[e]||0)+i.length;const n=[];for(const e of i)n.push(this.loadModel(e,t[e]));Promise.allSettled(n).then((t=>{for(let n=0;n<t.length;n++){const{status:r,value:s}=t[n];"fulfilled"===r&&s&&(this.models[e][i[n]]=s)}this.numModelsLoading[e]-=i.length,this.fire(new ke("data",{dataType:"style"}))})).catch((t=>{this.fire(new Pe(new Error(`Could not load models: ${t.message}`)))}))}isLoaded(){for(const t in this.numModelsLoading)if(this.numModelsLoading[t]>0)return!1;return!0}hasModel(t,e){return!!this.getModel(t,e)}getModel(t,e){return this.models[e]||(this.models[e]={}),this.models[e][t]}addModel(t,e,i){this.models[i]||(this.models[i]={}),this.hasModel(t,i)&&this.removeModel(t,i),this.load({[t]:this.requestManager.normalizeModelURL(e)},i)}addModels(t,e){const i={};for(const e in t)i[e]=this.requestManager.normalizeModelURL(t[e]);this.load(i,e)}removeModel(t,e){this.models[e]||(this.models[e]={});const i=this.models[e][t];delete this.models[e][t],i.destroy()}listModels(t){return this.models[t]||(this.models[t]={}),Object.keys(this.models[t])}upload(t,e){this.models[e]||(this.models[e]={});for(const i in this.models[e])this.models[e][i].upload(t.context)}}const KM=(t,e)=>Co(t,e&&e.filter((t=>"source.canvas"!==t.identifier))),QM=F(FE,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection","setCamera","addImport","removeImport","setImportUrl","setImportData","setImportConfig"]),JM=F(FE,["setCenter","setZoom","setBearing","setPitch"]),tA={version:8,layers:[],sources:{}},eA={duration:300,delay:0},iA=new Set(["fill","line","background","hillshade","raster"]);class nA extends Ie{constructor(t,e={}){super(),this.map=t,this.scope=e.scope||"",this.fragments=[],this.importDepth=e.importDepth||0,this.importsCache=e.importsCache||new Map,this.resolvedImports=e.resolvedImports||new Set,this.transition=R({},eA),this._buildingIndex=new OE(this),this.crossTileSymbolIndex=new PS,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=e.styleChanges||new Ta,this.dispatcher=e.dispatcher?e.dispatcher:new Tw(Zw(),this),e.imageManager?this.imageManager=e.imageManager:(this.imageManager=new lw,this.imageManager.setEventedParent(this)),this.imageManager.createScope(this.scope),this.glyphManager=e.glyphManager?e.glyphManager:new o_(t._requestManager,e.localFontFamily?2:e.localIdeographFontFamily?1:0,e.localFontFamily||e.localIdeographFontFamily),e.modelManager?this.modelManager=e.modelManager:(this.modelManager=new XM(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this.options=new Map,this._configDependentLayers=new Set,this._config=e.config,this.dispatcher.broadcast("setReferrer",xt());const i=this;this._rtlTextPluginCallback=nA.registerForPluginStateChange((t=>{i.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,e)=>{if(ta(t),e&&e.every((t=>t)))for(const t in i._sourceCaches){const e=i._sourceCaches[t],n=e.getSource().type;"vector"!==n&&"geojson"!==n||e.reload()}}))})),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.getOwnSource(t.sourceId);if(e&&e.vectorLayerIds)for(const t in this._layers){const i=this._layers[t];i.source===e.id&&this._validateLayer(i)}}))}loadURL(t,e={}){this.fire(new ke("dataloading",{dataType:"style"}));const i="boolean"==typeof e.validate?e.validate:!Dt(t);t=this.map._requestManager.normalizeStyleURL(t,e.accessToken),this.resolvedImports.add(t);const n=this.importsCache.get(t);if(n)return this._load(n,i);const r=this.map._requestManager.transformRequest(t,vt.Style);this._request=Et(r,((e,n)=>{if(this._request=null,e)this.fire(new Pe(e));else if(n)return this.importsCache.set(t,n),this._load(n,i)}))}loadJSON(t,e={}){this.fire(new ke("dataloading",{dataType:"style"})),this._request=pe.frame((()=>{this._request=null,this._load(t,!1!==e.validate)}))}loadEmpty(){this.fire(new ke("dataloading",{dataType:"style"})),this._load(tA,!1)}_loadImports(t,e){if(this.importDepth>=4)return Y("Style doesn't support nesting deeper than 5"),Promise.resolve();const i=[];for(const n of t){const t=this._createFragmentStyle(n),r=new Promise((e=>{t.once("style.import.load",e),t.once("error",e)})).then((()=>this.mergeAll()));if(i.push(r),this.resolvedImports.has(n.url)){t.loadEmpty();continue}const s=n.data||this.importsCache.get(n.url);s?t.loadJSON(s,{validate:e}):n.url?t.loadURL(n.url,{validate:e}):t.loadEmpty(),this.fragments.push({style:t,id:n.id,config:n.config})}return Promise.allSettled(i)}_createFragmentStyle(t){const e=this.scope?xa(t.id,this.scope):t.id,i=new nA(this.map,{scope:e,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:t.config});return i.setEventedParent(this.map,{style:i}),i}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options});const t=this.isRootStyle();this._shouldPrecompile=t,this.fire(new ke(t?"style.load":"style.import.load"))}_load(t,e){const i=t.schema;if(this.isRootStyle()&&(t.fragment||i&&!1!==t.fragment)){const i=R({},tA,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(i,e)}if(this.setConfig(this._config,i),e&&KM(this,go(t)))return;this._loaded=!0,this.stylesheet=G(t);for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.glyphManager.setURL(t.glyphs,this.scope);const n=RE(this.stylesheet.layers);if(this._order=n.map((t=>t.id)),this.stylesheet.light&&Y("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const t=this.stylesheet.lights[0];this.light=new hw(t.properties,t.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new hw(this.stylesheet.light)),this._layers={},this._serializedLayers={};for(const t of n){const e=ow(t,this.options);e.setScope(this.scope),e.isConfigDependent&&this._configDependentLayers.add(e.fqid),e.setEventedParent(this,{layer:{id:e.id}}),this._layers[e.id]=e,this._serializedLayers[e.id]=e.serialize();const i=this.getOwnLayerSourceCache(e),n=!!this.directionalLight&&this.directionalLight.shadowsEnabled();i&&e.canCastShadows()&&n&&(i.castsShadows=!0)}this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const r=this.stylesheet.terrain;r&&(void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=pe.hasCanvasFingerprintNoise()),this.disableElevatedTerrain?Y("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."):this.terrainSetForDrapingOnly()||this._createTerrain(r,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new ke("data",{dataType:"style"})),t.imports?this._loadImports(t.imports,e).then((()=>this._reloadImports())):this._reloadImports()}isRootStyle(){return 0===this.importDepth}mergeAll(){let t,e,i,n,r,s,o,a;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((l=>{if(l.stylesheet){if(null!=l.light&&(t=l.light),l.stylesheet.lights)for(const t of l.stylesheet.lights)"ambient"===t.type&&null!=l.ambientLight&&(e=l.ambientLight),"directional"===t.type&&null!=l.directionalLight&&(i=l.directionalLight);n=this._prioritizeTerrain(n,l.terrain,l.stylesheet.terrain),l.stylesheet.fog&&null!=l.fog&&(r=l.fog),null!=l.stylesheet.camera&&(a=l.stylesheet.camera),null!=l.stylesheet.projection&&(s=l.stylesheet.projection),null!=l.stylesheet.transition&&(o=l.stylesheet.transition)}})),this.light=t,this.ambientLight=e,this.directionalLight=i,this.fog=r,null===n?delete this.terrain:this.terrain=n,this.camera=a||{"camera-projection":"perspective"},this.projection=s||{name:"mercator"},this.transition=R({},eA,o),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(t){const e=i=>{for(const t of i.fragments)e(t.style);t(i)};e(this)}_prioritizeTerrain(t,e,i){const n=t&&0===t.drapeRenderMode;return null===i?e&&0===e.drapeRenderMode?e:n?t:null:null!=e&&(!t||n||e&&1===e.drapeRenderMode)?e:t}mergeTerrain(){let t;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((e=>{t=this._prioritizeTerrain(t,e.terrain,e.stylesheet.terrain)})),null===t?delete this.terrain:this.terrain=t}mergeProjection(){let t;this.forEachFragmentStyle((e=>{null!=e.stylesheet.projection&&(t=e.stylesheet.projection)})),this.projection=t||{name:"mercator"}}mergeSources(){const t={},e={},i={};this.forEachFragmentStyle((n=>{for(const e in n._sourceCaches){const i=xa(e,n.scope);t[i]=n._sourceCaches[e]}for(const t in n._otherSourceCaches){const i=xa(t,n.scope);e[i]=n._otherSourceCaches[t]}for(const t in n._symbolSourceCaches){const e=xa(t,n.scope);i[e]=n._symbolSourceCaches[t]}})),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=e,this._mergedSymbolSourceCaches=i}mergeLayers(){const t={},e=[],i={};this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle((i=>{for(const n of i._order){const r=i._layers[n];if("slot"===r.type){const e=wa(n);if(t[e])continue;t[e]=[]}r.slot&&t[r.slot]?t[r.slot].push(r):e.push(r)}})),this._mergedOrder=[];const n=(e=[])=>{for(const r of e)if("slot"===r.type){const e=wa(r.id);t[e]&&n(t[e])}else{const t=xa(r.id,r.scope);this._mergedOrder.push(t),i[t]=r,r.is3D()&&(this._has3DLayers=!0),"circle"===r.type&&(this._hasCircleLayers=!0),"symbol"===r.type&&(this._hasSymbolLayers=!0)}};n(e),this._mergedLayers=i,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=R({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}setProjection(t){t?this.stylesheet.projection=t:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=function(t,e,i){let n,r,s;const o=pe.devicePixelRatio>1?"@2x":"";let a=Et(e.transformRequest(e.normalizeSpriteURL(t,o,".json"),vt.SpriteJSON),((t,e)=>{a=null,s||(s=t,n=e,c())})),l=kt(e.transformRequest(e.normalizeSpriteURL(t,o,".png"),vt.SpriteImage),((t,e)=>{l=null,s||(s=t,r=e,c())}));function c(){if(s)i(s);else if(n&&r){const t=pe.getImageData(r),e={};for(const i in n){const{width:r,height:s,x:o,y:a,sdf:l,pixelRatio:c,stretchX:h,stretchY:u,content:d}=n[i],p=new ef({width:r,height:s});ef.copy(t,p,{x:o,y:a},{x:0,y:0},{width:r,height:s}),e[i]={data:p,pixelRatio:c,sdf:l,stretchX:h,stretchY:u,content:d}}i(null,e)}}return{cancel(){a&&(a.cancel(),a=null),l&&(l.cancel(),l=null)}}}(t,this.map._requestManager,((t,e)=>{if(this._spriteRequest=null,t)this.fire(new Pe(t));else if(e)for(const t in e)this.imageManager.addImage(t,this.scope,e[t]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new ke("data",{dataType:"style"}))}))}_validateLayer(t){const e=this.getOwnSource(t.source);if(!e)return;const i=t.sourceLayer;i&&("geojson"===e.type||e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(i))&&this.fire(new Pe(new Error(`Source layer "${i}" does not exist on source "${e.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(!this.modelManager.isLoaded())return!1;for(const{style:t}of this.fragments)if(!t.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map(((t,e)=>{const i=this.fragments[e];return i&&i.style&&(t.data=i.style.serialize()),t}))}_serializeSources(){const t={};for(const e in this._sourceCaches){const i=this._sourceCaches[e].getSource();t[i.id]||(t[i.id]=i.serialize())}return t}_serializeLayers(t){const e=[];for(const i of t){const t=this._layers[i];t&&"custom"!==t.type&&e.push(t.serialize())}return e}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;for(const t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}isLayerDraped(t){return!!this.terrain&&("function"==typeof t.isLayerDraped?t.isLayerDraped(this.getLayerSourceCache(t)):iA.has(t.type))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const e=this.getOwnLayer(t);if(e)return e;this.fire(new Pe(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const e=this.getOwnSource(t);if(e)return e;this.fire(new Pe(new Error(`The source '${t}' does not exist in the map's style.`)))}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const e=this.calculateLightsBrightness();t.brightness=e||0,e!==this._brightness&&(this._brightness=e,this.dispatcher.broadcast("setBrightness",e));const i=this._changes.isDirty();if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:i,removedIds:n}=e[t];(i||n)&&this._updateWorkerLayers(t,i,n)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._changes.reset()}const n={};for(const t in this._mergedSourceCaches){const e=this._mergedSourceCaches[t];n[t]=e.used,e.used=!1}for(const e of this._mergedOrder){const i=this._mergedLayers[e];if(i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)){const t=this.getLayerSourceCache(i);t&&(t.used=!0)}if(!this._precompileDone&&this._shouldPrecompile)for(let e=i.minzoom||0;e<(i.maxzoom||25.5);e++){const e=this.map.painter;if(e){const n=i.getProgramIds();if(!n)continue;for(const r of n){const n=i.getDefaultProgramParams(r,t.zoom);n&&(e.style=this,this.fog&&(e._fogVisible=!0,n.overrideFog=!0,e.getOrCreateProgram(r,n)),e._fogVisible=!1,n.overrideFog=!1,e.getOrCreateProgram(r,n),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(n.overrideRtt=!0,e.getOrCreateProgram(r,n)))}}}}this._shouldPrecompile&&(this._precompileDone=!0);for(const t in n){const e=this._mergedSourceCaches[t];n[t]!==e.used&&e.getSource().fire(new ke("data",{sourceDataType:"visibility",dataType:"source",sourceId:e.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),i&&this.fire(new ke("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=this._changes.getUpdatedImages();if(t.length){for(const e in this._sourceCaches)this._sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changes.resetUpdatedImages()}}_updateWorkerLayers(t,e,i){const n=this.getFragmentStyle(t);n&&this.dispatcher.broadcast("updateLayers",{layers:e?n._serializeLayers(e):[],scope:t,removedIds:i||[],options:n.options})}setState(t){if(this._checkLoaded(),KM(this,go(t)))return!1;(t=G(t)).layers=RE(t.layers);const e=function(t,e){if(!t)return[{command:FE.setStyle,args:[e]}];let i=[];try{if(!b(t.version,e.version))return[{command:FE.setStyle,args:[e]}];b(t.center,e.center)||i.push({command:FE.setCenter,args:[e.center]}),b(t.zoom,e.zoom)||i.push({command:FE.setZoom,args:[e.zoom]}),b(t.bearing,e.bearing)||i.push({command:FE.setBearing,args:[e.bearing]}),b(t.pitch,e.pitch)||i.push({command:FE.setPitch,args:[e.pitch]}),b(t.sprite,e.sprite)||i.push({command:FE.setSprite,args:[e.sprite]}),b(t.glyphs,e.glyphs)||i.push({command:FE.setGlyphs,args:[e.glyphs]}),b(t.imports,e.imports)||function(t=[],e=[],i){e=e||[];const n=(t=t||[]).map($E),r=e.map($E),s=t.reduce(HE,{}),o=e.reduce(HE,{}),a=n.slice();let l,c,h,u;for(l=0,c=0;l<n.length;l++)h=n[l],o.hasOwnProperty(h)?c++:(i.push({command:FE.removeImport,args:[h]}),a.splice(a.indexOf(h,c),1));for(l=0,c=0;l<r.length;l++)h=r[r.length-1-l],a[a.length-1-l]!==h&&(s.hasOwnProperty(h)?(i.push({command:FE.removeImport,args:[h]}),a.splice(a.lastIndexOf(h,a.length-c),1)):c++,u=a[a.length-l],i.push({command:FE.addImport,args:[o[h],u]}),a.splice(a.length-l,0,h));for(const t of e){const e=s[t.id];if(!e||b(e,t))continue;b(e.config,t.config)||i.push({command:FE.setImportConfig,args:[t.id,t.config]}),b(e.url,t.url)||i.push({command:FE.setImportUrl,args:[t.id,t.url]});const n=t.data;b(e&&e.data,n)||i.push({command:FE.setImportData,args:[t.id,n]})}}(t.imports,e.imports,i),b(t.transition,e.transition)||i.push({command:FE.setTransition,args:[e.transition]}),b(t.light,e.light)||i.push({command:FE.setLight,args:[e.light]}),b(t.fog,e.fog)||i.push({command:FE.setFog,args:[e.fog]}),b(t.projection,e.projection)||i.push({command:FE.setProjection,args:[e.projection]}),b(t.lights,e.lights)||i.push({command:FE.setLights,args:[e.lights]}),b(t.camera,e.camera)||i.push({command:FE.setCamera,args:[e.camera]});const n={},r=[];!function(t,e,i,n){let r;for(r in e=e||{},t=t||{})t.hasOwnProperty(r)&&(e.hasOwnProperty(r)||NE(r,i,n));for(r in e){if(!e.hasOwnProperty(r))continue;const s=e[r];t.hasOwnProperty(r)?b(t[r],s)||("geojson"===t[r].type&&"geojson"===s.type&&VE(t,e,r)?i.push({command:FE.setGeoJSONSourceData,args:[r,s.data]}):jE(r,e,i,n)):BE(r,e,i)}}(t.sources,e.sources,r,n);const s=[];t.layers&&t.layers.forEach((t=>{t.source&&n[t.source]?i.push({command:FE.removeLayer,args:[t.id]}):s.push(t)}));let o=t.terrain;o&&n[o.source]&&(i.push({command:FE.setTerrain,args:[void 0]}),o=void 0),i=i.concat(r),b(o,e.terrain)||i.push({command:FE.setTerrain,args:[e.terrain]}),function(t,e,i){e=e||[];const n=(t=t||[]).map($E),r=e.map($E),s=t.reduce(HE,{}),o=e.reduce(HE,{}),a=n.slice(),l=Object.create(null);let c,h,u,d,p,f,m;for(c=0,h=0;c<n.length;c++)u=n[c],o.hasOwnProperty(u)?h++:(i.push({command:FE.removeLayer,args:[u]}),a.splice(a.indexOf(u,h),1));for(c=0,h=0;c<r.length;c++)u=r[r.length-1-c],a[a.length-1-c]!==u&&(s.hasOwnProperty(u)?(i.push({command:FE.removeLayer,args:[u]}),a.splice(a.lastIndexOf(u,a.length-h),1)):h++,f=a[a.length-c],i.push({command:FE.addLayer,args:[o[u],f]}),a.splice(a.length-c,0,u),l[u]=!0);for(c=0;c<r.length;c++)if(u=r[c],d=s[u],p=o[u],!l[u]&&!b(d,p))if(b(d.source,p.source)&&b(d["source-layer"],p["source-layer"])&&b(d.type,p.type)){for(m in UE(d.layout,p.layout,i,u,null,FE.setLayoutProperty),UE(d.paint,p.paint,i,u,null,FE.setPaintProperty),b(d.slot,p.slot)||i.push({command:FE.setSlot,args:[u,p.slot]}),b(d.filter,p.filter)||i.push({command:FE.setFilter,args:[u,p.filter]}),b(d.minzoom,p.minzoom)&&b(d.maxzoom,p.maxzoom)||i.push({command:FE.setLayerZoomRange,args:[u,p.minzoom,p.maxzoom]}),d)d.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&"slot"!==m&&(0===m.indexOf("paint.")?UE(d[m],p[m],i,u,m.slice(6),FE.setPaintProperty):b(d[m],p[m])||i.push({command:FE.setLayerProperty,args:[u,m,p[m]]}));for(m in p)p.hasOwnProperty(m)&&!d.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&"slot"!==m&&(0===m.indexOf("paint.")?UE(d[m],p[m],i,u,m.slice(6),FE.setPaintProperty):b(d[m],p[m])||i.push({command:FE.setLayerProperty,args:[u,m,p[m]]}))}else i.push({command:FE.removeLayer,args:[u]}),f=a[a.lastIndexOf(u)+1],i.push({command:FE.addLayer,args:[p,f]})}(s,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:FE.setStyle,args:[e]}]}return i}(this.serialize(),t).filter((t=>!(t.command in JM)));if(0===e.length)return!1;const i=e.filter((t=>!(t.command in QM)));if(i.length>0)throw new Error(`Unimplemented: ${i.map((t=>t.command)).join(", ")}.`);return e.forEach((t=>{this[t.command].apply(this,t.args)})),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}addImage(t,e){return this.getImage(t)?this.fire(new Pe(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,this.scope,e),this._afterImageUpdated(t),this)}updateImage(t,e){this.imageManager.updateImage(t,this.scope,e)}getImage(t){return this.imageManager.getImage(t,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._afterImageUpdated(t),this):this.fire(new Pe(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(this.scope),this._changes.updateImage(t),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.fire(new ke("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(t,e,i={}){return this._checkLoaded(),this._validate(Mo,`models.${t}`,e,null,i)||(this.modelManager.addModel(t,e,this.scope),this._changes.setDirty()),this}hasModel(t){return this.modelManager.hasModel(t,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope),this):this.fire(new Pe(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,e,i={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!e.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(e).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(e.type)>=0&&this._validate(_o,`sources.${t}`,e,null,i))return;this.map&&this.map._collectResourceTiming&&(e.collectResourceTiming=!0);const n=CE(t,e,this.dispatcher,this);n.scope=this.scope,n.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(n.id),source:n.serialize(),sourceId:n.id})));const r=t=>{const e=(t?"symbol:":"other:")+n.id,i=xa(e,this.scope),r=this._sourceCaches[e]=new zv(i,n,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[n.id]=r,r.onAdd(this.map)};r(!1),"vector"!==e.type&&"geojson"!==e.type||r(!0),n.onAdd&&n.onAdd(this.map),i.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const e=this.getOwnSource(t);if(!e)throw new Error("There is no source with this ID");for(const e in this._layers)if(this._layers[e].source===t)return this.fire(new Pe(new Error(`Source "${t}" cannot be removed while layer "${e}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new Pe(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const i=this.getOwnSourceCaches(t);for(const t of i){const e=wa(t.id);delete this._sourceCaches[e],this._changes.discardSourceCacheUpdate(t.id),t.fire(new ke("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),e.setEventedParent(null),e.onRemove&&e.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(t,e){this._checkLoaded(),this.getOwnSource(t).setData(e),this._changes.setDirty()}getOwnSource(t){const e=this.getOwnSourceCache(t);return e&&e.getSource()}getOwnSources(){const t=[];for(const e in this._otherSourceCaches){const i=this.getOwnSourceCache(e);i&&t.push(i.getSource())}return t}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const e=this._getTransitionParameters();for(const i of t){if(this._validate(vo,"lights",i))return;switch(i.type){case"ambient":if(this.ambientLight){const t=this.ambientLight;t.set(i),t.updateTransitions(e)}else this.ambientLight=new Mw(i,Aw,this.scope,this.options);break;case"directional":if(this.directionalLight){const t=this.directionalLight;t.set(i),t.updateTransitions(e)}else this.directionalLight=new Mw(i,Cw,this.scope,this.options)}}const i=new oa(this.z||0,e);this.ambientLight&&this.ambientLight.recalculate(i),this.directionalLight&&this.directionalLight.recalculate(i),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,e=this.ambientLight;if(!t||!e)return;const i=t=>.2126*(t[0]<=.03928?t[0]/12.92:Math.pow((t[0]+.055)/1.055,2.4))+.7152*(t[1]<=.03928?t[1]/12.92:Math.pow((t[1]+.055)/1.055,2.4))+.0722*(t[2]<=.03928?t[2]/12.92:Math.pow((t[2]+.055)/1.055,2.4)),n=t.properties.get("color").toArray01(),r=t.properties.get("intensity"),s=t.properties.get("direction"),o=1-J(s.x,s.y,s.z)[2]/90,a=i(n)*r*o,l=e.properties.get("color").toArray01(),c=e.properties.get("intensity");return(a+i(l)*c)/2}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const t=[];return this.directionalLight&&t.push(this.directionalLight.get()),this.ambientLight&&t.push(this.ambientLight.get()),t}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(!t)return this;if(ba(t)){const e=function(t){const e=t.indexOf(va);return e>=0?t.slice(e+1):""}(t),i=this.fragments.find((({id:t})=>t===e));if(!i)throw new Error(`Style import not found: ${t}`);const n=wa(t);return i.style.getFragmentStyle(n)}{const e=this.fragments.find((({id:e})=>e===t));if(!e)throw new Error(`Style import not found: ${t}`);return e.style}}getConfigProperty(t,e){const i=this.getFragmentStyle(t);if(!i)return null;const n=i.options.get(e),r=n?n.value||n.default:null;return r?r.serialize():null}setConfigProperty(t,e,i){const n=Ss(i);if("success"!==n.result)return void KM(this,n.value);const r=n.value.expression,s=this.getFragmentStyle(t);if(!s)return;const o=s.options.get(e);o&&(s.options.set(e,{...o,value:r}),s.updateConfigDependencies())}setConfig(t,e){if(this._config=t,t||e)if(e){this.options.clear();for(const i in e){let n,r;const s=Ss(e[i].default);if("success"===s.result&&(n=s.value.expression),t&&void 0!==t[i]){const e=Ss(t[i]);"success"===e.result&&(r=e.value.expression)}const{minValue:o,maxValue:a,stepValue:l,type:c,values:h}=e[i];n?this.options.set(i,{default:n,value:r,minValue:o,maxValue:a,stepValue:l,type:c,values:h}):this.fire(new Pe(new Error(`No schema defined for config option "${i}".`)))}}else this.fire(new Pe(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(){for(const t of this._configDependentLayers){const e=this.getLayer(t);e&&(e.possiblyEvaluateVisibility(),this._updateLayer(e))}this.ambientLight&&this.ambientLight.scope===this.scope&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.scope===this.scope&&this.directionalLight.updateConfig(this.options),this._changes.setDirty()}addLayer(t,e,i={}){this._checkLoaded();const n=t.id;if(this._layers[n])return void this.fire(new Pe(new Error(`Layer with id "${n}" already exists on this map`)));let r;if("custom"===t.type){if(KM(this,function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e}(t)))return;r=ow(t,this.options)}else{if("object"==typeof t.source&&(this.addSource(n,t.source),t=R(t=G(t),{source:n})),this._validate(wo,`layers.${n}`,t,{arrayIndex:-1},i))return;r=ow(t,this.options),this._validateLayer(r),r.setEventedParent(this,{layer:{id:n}}),this._serializedLayers[r.id]=r.serialize()}r.isConfigDependent&&this._configDependentLayers.add(r.fqid),r.setScope(this.scope);let s=this._order.length;if(e){const t=this._order.indexOf(e);if(-1===t)return void this.fire(new Pe(new Error(`Layer with id "${e}" does not exist on this map.`)));r.slot===this._layers[e].slot?s=t:Y(`Layer with id "${e}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(s,0,n),this._layerOrderChanged=!0,this._layers[n]=r;const o=this.getOwnLayerSourceCache(r),a=!!this.directionalLight&&this.directionalLight.shadowsEnabled();o&&r.canCastShadows()&&a&&(o.castsShadows=!0);const l=this._changes.getRemovedLayer(r);if(l&&r.source&&o&&"custom"!==r.type){this._changes.discardLayerRemoval(r);const t=xa(r.source,r.scope);l.type!==r.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),o.pause())}this._updateLayer(r),r.onAdd&&r.onAdd(this.map),r.scope=this.scope,this.mergeLayers()}moveLayer(t,e){this._checkLoaded();const i=this._checkLayer(t);if(!i)return;if(t===e)return;const n=this._order.indexOf(t);this._order.splice(n,1);let r=this._order.length;if(e){const t=this._order.indexOf(e);if(-1===t)return void this.fire(new Pe(new Error(`Layer with id "${e}" does not exist on this map.`)));i.slot===this._layers[e].slot?r=t:Y(`Layer with id "${e}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(r,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(t){this._checkLoaded();const e=this._checkLayer(t);if(!e)return;e.setEventedParent(null);const i=this._order.indexOf(t);this._order.splice(i,1),delete this._layers[t],delete this._serializedLayers[t],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(e.fqid),this._changes.removeLayer(e);const n=this.getOwnLayerSourceCache(e);if(n&&n.castsShadows){let t=!1;for(const i in this._layers)if(this._layers[i].source===e.source&&this._layers[i].canCastShadows()){t=!0;break}n.castsShadows=t}e.onRemove&&e.onRemove(this.map),this.mergeLayers()}getOwnLayer(t){return this._layers[t]}hasLayer(t){return t in this._mergedLayers}hasLayerType(t){for(const e in this._layers)if(this._layers[e].type===t)return!0;return!1}setLayerZoomRange(t,e,i){this._checkLoaded();const n=this._checkLayer(t);n&&(n.minzoom===e&&n.maxzoom===i||(null!=e&&(n.minzoom=e),null!=i&&(n.maxzoom=i),this._updateLayer(n)))}setSlot(t,e){this._checkLoaded();const i=this._checkLayer(t);i&&i.slot!==e&&(i.slot=e,this._updateLayer(i))}setFilter(t,e,i={}){this._checkLoaded();const n=this._checkLayer(t);if(n&&!b(n.filter,e))return null==e?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(Eo,`layers.${n.id}.filter`,e,{layerType:n.type},i)||(n.filter=G(e),this._updateLayer(n)))}getFilter(t){const e=this._checkLayer(t);if(e)return G(e.filter)}setLayoutProperty(t,e,i,n={}){this._checkLoaded();const r=this._checkLayer(t);r&&(b(r.getLayoutProperty(e),i)||(r.setLayoutProperty(e,i,n),r.isConfigDependent&&this._configDependentLayers.add(r.fqid),this._updateLayer(r)))}getLayoutProperty(t,e){const i=this._checkLayer(t);if(i)return i.getLayoutProperty(e)}setPaintProperty(t,e,i,n={}){this._checkLoaded();const r=this._checkLayer(t);if(!r)return;if(b(r.getPaintProperty(e),i))return;const s=r.setPaintProperty(e,i,n);r.isConfigDependent&&this._configDependentLayers.add(r.fqid),s&&this._updateLayer(r),this._changes.updatePaintProperties(r)}getPaintProperty(t,e){const i=this._checkLayer(t);if(i)return i.getPaintProperty(e)}setFeatureState(t,e){this._checkLoaded();const i=t.source,n=t.sourceLayer,r=this._checkSource(i);if(!r)return;const s=r.type;if("geojson"===s&&n)return void this.fire(new Pe(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!n)return void this.fire(new Pe(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new Pe(new Error("The feature id parameter must be provided.")));const o=this.getOwnSourceCaches(i);for(const i of o)i.setFeatureState(n,t.id,e)}removeFeatureState(t,e){this._checkLoaded();const i=t.source,n=this._checkSource(i);if(!n)return;const r=n.type,s="vector"===r?t.sourceLayer:void 0;if("vector"===r&&!s)return void this.fire(new Pe(new Error("The sourceLayer parameter must be provided for vector source types.")));if(e&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new Pe(new Error("A feature id is required to remove its specific state property.")));const o=this.getOwnSourceCaches(i);for(const i of o)i.removeFeatureState(s,t.id,e)}getFeatureState(t){this._checkLoaded();const e=t.source,i=t.sourceLayer,n=this._checkSource(e);if(n){if("vector"!==n.type||i)return void 0===t.id&&this.fire(new Pe(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(e)[0].getFeatureState(i,t.id);this.fire(new Pe(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(t){return this.stylesheet.transition=R({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return R({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),e=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return W({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:e,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},(t=>void 0!==t))}_updateLayer(t){this._changes.updateLayer(t);const e=this.getLayerSourceCache(t),i=xa(t.source,t.scope),n=this._changes.getUpdatedSourceCaches();t.source&&!n[i]&&e&&"raster"!==e.getSource().type&&(this._changes.updateSourceCache(i,"reload"),e.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._mergedLayers[t].type,i=this.order,n={},r=[];for(let s=i.length-1;s>=0;s--){const o=i[s];if(e(o)){n[o]=s;for(const e of t){const t=e[o];if(t)for(const e of t)r.push(e)}}}r.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const s=[];for(let o=i.length-1;o>=0;o--){const a=i[o];if(e(a))for(let t=r.length-1;t>=0;t--){const e=r[t].feature;if(n[e.layer.id]<o)break;s.push(e),r.pop()}else for(const e of t){const t=e[a];if(t)for(const e of t)s.push(e.feature)}}return s}queryRenderedFeatures(t,e,i){e&&e.filter&&this._validate(Eo,"queryRenderedFeatures.filter",e.filter,null,e),e.scope=this.scope,e.availableImages=this._availableImages,e.serializedLayers=this._serializedLayers;const n={};if(e&&e.layers){if(!Array.isArray(e.layers))return this.fire(new Pe(new Error("parameters.layers must be an Array."))),[];for(const t of e.layers){const e=this._mergedLayers[t];if(!e)return this.fire(new Pe(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];n[e.source]=!0}}const r=[],s=e.serializedLayers||{},o=e&&e.layers?e.layers.some((t=>{const e=this.getLayer(t);return e&&e.is3D()})):this.has3DLayers(),a=kw.createFromScreenPoints(t,i);for(const t in this._mergedSourceCaches){const l=this._mergedSourceCaches[t].getSource();if(!l||l.scope!==e.scope)continue;const c=this._mergedSourceCaches[t].getSource().id;e.layers&&!n[c]||r.push(PE(this._mergedSourceCaches[t],this._mergedLayers,s,a,e,i,o,!!this.map._showQueryGeometry))}return this.placement&&r.push(function(t,e,i,n,r,s,o){const a={},l=s.queryRenderedSymbols(n),c=[];for(const t of Object.keys(l).map(Number))c.push(o[t]);c.sort(DE);for(const i of c){const n=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(const t in n){const e=a[t]=a[t]||[],r=n[t];r.sort(((t,e)=>{const n=i.featureSortOrder;if(n){const i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(const t of r)e.push(t)}}for(const e in a)a[e].forEach((n=>{const r=n.feature,s=i(t[e]);if(!s)return;const o=s.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}));return a}(this._mergedLayers,s,this.getLayerSourceCache.bind(this),a.screenGeometry,e,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(r)}querySourceFeatures(t,e){e&&e.filter&&this._validate(Eo,"querySourceFeatures.filter",e.filter,null,e);const i=this.getOwnSourceCaches(t);let n=[];for(const t of i)n=n.concat(IE(t,e));return n}addSourceType(t,e,i){return nA.getSourceType(t)?i(new Error(`A source type called "${t}" already exists.`)):(nA.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,e,i={}){this._checkLoaded();const n=this.light.getLight();let r=!1;for(const e in t)if(!b(t[e],n[e])){r=!0;break}if(!r)return;const s=this._getTransitionParameters();this.light.setLight(t,e,i),this.light.updateTransitions(s)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(t,e=1){if(this._checkLoaded(),!t)return delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let i=t;const n=null==t.source;if(1===e){if("object"==typeof i.source){const t="terrain-dem-src";this.addSource(t,i.source),i=G(i),i=R(i,{source:t})}const t=R({},i),e={};if(this.terrain&&n){t.source=this.terrain.get().source;const i=this.terrain?this.getFragmentStyle(this.terrain.scope):null;i&&(e.style=i.serialize())}if(this._validate(bo,"terrain",t,e))return}if(!this.terrain||this.terrain.scope!==this.scope&&!n||this.terrain&&e!==this.terrain.drapeRenderMode){if(!i)return;this._createTerrain(i,e),this.fire(new ke("data",{dataType:"style"}))}else{const e=this.terrain,n=e.get();for(const t of Object.keys(De.terrain))!i.hasOwnProperty(t)&&De.terrain[t].default&&(i[t]=De.terrain[t].default);for(const i in t)if(!b(t[i],n[i])){e.set(t,this.options),this.stylesheet.terrain=t;const i=this._getTransitionParameters({duration:0});e.updateTransitions(i),this.fire(new ke("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(t){const e=this.fog=new xw(t,this.map.transform);this.stylesheet.fog=e.get();const i=this._getTransitionParameters({duration:0});e.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const t of this.map._markers)t._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const e=this.fog;if(!b(e.get(),t)){e.set(t),this.stylesheet.fog=e.get();const i=this._getTransitionParameters({duration:0});e.updateTransitions(i)}}else this._createFog(t);this._markersNeedUpdate=!0}_getTransitionParameters(t){return{now:pe.now(),transition:R(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const t=[],e=[];for(const i in this._mergedLayers)this.isLayerDraped(this._mergedLayers[i])?t.push(i):e.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...t),this._drapedFirstOrder.push(...e)}_createTerrain(t,e){const i=this.terrain=new dw(t,e,this.scope,this.options);1===e&&(this.stylesheet.terrain=t),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const n=this._getTransitionParameters({duration:0});i.updateTransitions(n)}_force3DLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"fill-extrusion"===e.type&&this._updateLayer(e)}}_forceSymbolLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"symbol"===e.type&&this._updateLayer(e)}}_validate(t,e,i,n,r={}){if(r&&!1===r.validate)return!1;const s=R({},this.serialize());return KM(this,t.call(go,R({key:e,style:s,value:i,styleSpec:De},n)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),ia.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._mergedLayers)this._mergedLayers[t].setEventedParent(null);for(const t in this._mergedSourceCaches)this._mergedSourceCaches[t].clearTiles(),this._mergedSourceCaches[t].setEventedParent(null);this.setEventedParent(null),delete this.fog,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(t){const e=this.getSourceCaches(t);for(const t of e)t.clearTiles()}clearSources(){for(const t in this._mergedSourceCaches)this._mergedSourceCaches[t].clearTiles()}reloadSource(t){const e=this.getSourceCaches(t);for(const t of e)t.resume(),t.reload()}reloadSources(){for(const t of this.getSources())t.reload&&t.reload()}updateSources(t){let e;this.directionalLight&&(e=GM(this.directionalLight));for(const i in this._mergedSourceCaches)this._mergedSourceCaches[i].update(t,void 0,void 0,e)}_generateCollisionBoxes(){for(const t in this._sourceCaches){const e=this._sourceCaches[t];e.resume(),e.reload()}}_updatePlacement(t,e,i,n,r=!1){let s=!1,o=!1;const a={},l={};for(const e of this._mergedOrder){const i=this._mergedLayers[e];if("symbol"!==i.type)continue;const n=xa(i.source,i.scope);let r=a[n];if(!r){const t=this.getLayerSourceCache(i);if(!t)continue;const e=t.getRenderableIds(!0).map((e=>t.getTileByID(e)));l[n]=e.slice(),r=a[n]=e.sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const o=this.crossTileSymbolIndex.addLayer(i,r,t.center.lng,t.projection);s=s||o}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),r=r||this._layerOrderChanged||0===i,this._layerOrderChanged&&this.fire(new ke("neworder")),(r||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(pe.now(),t.zoom))&&(this.pauseablePlacement=new yS(t,this._mergedOrder,r,e,i,n,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,a,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(pe.now()),o=!0),s&&this.pauseablePlacement.placement.setStale()),o||s)for(const t of this._mergedOrder){const e=this._mergedLayers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,a[xa(e.source,e.scope)])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(pe.now())}_releaseSymbolFadeTiles(){for(const t in this._sourceCaches)this._sourceCaches[t].releaseSymbolFadeTiles()}addImport(t){this._checkLoaded();const e=this.stylesheet.imports=this.stylesheet.imports||[];return-1!==e.findIndex((({id:e})=>e===t.id))?this.fire(new Pe(new Error(`Import with id '${t.id}' already exists in the map's style.`))):(e.push(t),this._loadImports([t],!0),this)}setImportUrl(t,e){this._checkLoaded();const i=this.stylesheet.imports||[],n=this.getImportIndex(t);if(-1===n)return this;i[n].url=e;const r=this.fragments[n];return r.style=this._createFragmentStyle(i[n]),r.style.on("style.import.load",(()=>this.mergeAll())),r.style.loadURL(e),this}setImportData(t,e){this._checkLoaded();const i=this.getImportIndex(t),n=this.stylesheet.imports||[];return-1===i?this:e?(this.fragments[i].style.setState(e),this._reloadImports(),this):(delete n[i].data,this.setImportUrl(t,n[i].url))}setImportConfig(t,e){this._checkLoaded();const i=this.getImportIndex(t),n=this.stylesheet.imports||[];if(-1===i)return this;e?n[i].config=e:delete n[i].config;const r=this.fragments[i],s=r.style.stylesheet&&r.style.stylesheet.schema;return r.config=e,r.style.setConfig(e,s),r.style.updateConfigDependencies(),this}removeImport(t){this._checkLoaded();const e=this.stylesheet.imports||[],i=this.getImportIndex(t);return-1===i||(e.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports()),this}getImportIndex(t){const e=(this.stylesheet.imports||[]).findIndex((e=>e.id===t));return-1===e&&this.fire(new Pe(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),e}getLayer(t){return this._mergedLayers[t]}getSources(){const t=[];for(const e in this._mergedOtherSourceCaches){const i=this._mergedOtherSourceCaches[e];i&&t.push(i.getSource())}return t}getSource(t,e){const i=this.getSourceCache(t,e);return i&&i.getSource()}getLayerSource(t){const e=this.getLayerSourceCache(t);return e&&e.getSource()}getSourceCache(t,e){const i=xa(t,e);return this._mergedOtherSourceCaches[i]}getLayerSourceCache(t){const e=xa(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[e]:this._mergedOtherSourceCaches[e]}getSourceCaches(t){const e=[];return this._mergedOtherSourceCaches[t]&&e.push(this._mergedOtherSourceCaches[t]),this._mergedSymbolSourceCaches[t]&&e.push(this._mergedSymbolSourceCaches[t]),e}updateSourceCaches(){const t=this._changes.getUpdatedSourceCaches();for(const e in t){const i=t[e];"reload"===i?this.reloadSource(e):"clear"===i&&this.clearSource(e)}}updateLayers(t){const e=this._changes.getUpdatedPaintProperties();for(const i of e){const e=this.getLayer(i);e&&e.updateTransitions(t)}}getImages(t,e,i){this.imageManager.getImages(e.icons,e.scope,i),this._updateTilesForChangedImages();const n=t=>{t&&t.setDependencies(e.tileID.key,e.type,e.icons)};n(this._otherSourceCaches[e.source]),n(this._symbolSourceCaches[e.source])}getGlyphs(t,e,i){this.glyphManager.getGlyphs(e.stacks,e.scope,i)}getResource(t,e,i){return wt(e,i)}getOwnSourceCache(t){return this._otherSourceCaches[t]}getOwnLayerSourceCache(t){return"symbol"===t.type?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]}getOwnSourceCaches(t){const e=[];return this._otherSourceCaches[t]&&e.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&e.push(this._symbolSourceCaches[t]),e}_isSourceCacheLoaded(t){const e=this.getOwnSourceCaches(t);return 0===e.length?(this.fire(new Pe(new Error(`There is no source with ID '${t}'`))),!1):e.every((t=>t.loaded()))}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}function rA(t,e){let i=!1,n=null;const r=()=>{n=null,i&&(t(),n=setTimeout(r,e),i=!1)};return()=>(i=!0,n||r(),n)}nA.getSourceType=function(t){return AE[t]},nA.setSourceType=function(t,e){AE[t]=e},nA.registerForPluginStateChange=function(t){return t({pluginStatus:Qo,pluginURL:Jo}),ia.on("pluginStateChange",t),t};class sA{constructor(t){this._hashName=t&&encodeURIComponent(t),$(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=rA(this._updateHashUnthrottled.bind(this),300)}addTo(t){return this._map=t,e.addEventListener("hashchange",this._onHashChange,!1),t.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),e.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const t=this._map;if(!t)return"";const i=oA(t);if(this._hashName){const t=this._hashName;let n=!1;const r=e.location.hash.slice(1).split("&").map((e=>{const r=e.split("=")[0];return r===t?(n=!0,`${r}=${i}`):e})).filter((t=>t));return n||r.push(`${t}=${i}`),`#${r.join("&")}`}return`#${i}`}_getCurrentHash(){const t=e.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._map;if(!t)return!1;const e=this._getCurrentHash();if(e.length>=3&&!e.some((t=>isNaN(t)))){const i=t.dragRotate.isEnabled()&&t.touchZoomRotate.isEnabled()?+(e[3]||0):t.getBearing();return t.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:i,pitch:+(e[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=e.location.href.replace(/(#.+)?$/,this.getHashString());e.history.replaceState(e.history.state,null,t)}}function oA(t,e){const i=t.getCenter(),n=Math.round(100*t.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),s=Math.pow(10,r),o=Math.round(i.lng*s)/s,a=Math.round(i.lat*s)/s,l=t.getBearing(),c=t.getPitch();let h=e?`/${o}/${a}/${n}`:`${n}/${a}/${o}`;return(l||c)&&(h+="/"+Math.round(10*l)/10),c&&(h+=`/${Math.round(c)}`),h}const aA={linearity:.3,easing:k(0,0,.3,1)},lA=R({deceleration:2500,maxSpeed:1400},aA),cA=R({deceleration:20,maxSpeed:1400},aA),hA=R({deceleration:1e3,maxSpeed:360},aA),uA=R({deceleration:1e3,maxSpeed:90},aA);class dA{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:pe.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=pe.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const e={zoom:0,bearing:0,pitch:0,pan:new v(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)e.zoom+=t.zoomDelta||0,e.bearing+=t.bearingDelta||0,e.pitch+=t.pitchDelta||0,t.panDelta&&e.pan._add(t.panDelta),t.around&&(e.around=t.around),t.pinchAround&&(e.pinchAround=t.pinchAround);const i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(e.pan.mag()){const r=fA(e.pan.mag(),i,R({},lA,t||{}));n.offset=e.pan.mult(r.amount/e.pan.mag()),n.center=this._map.transform.center,pA(n,r)}if(e.zoom){const t=fA(e.zoom,i,cA);n.zoom=this._map.transform.zoom+t.amount,pA(n,t)}if(e.bearing){const t=fA(e.bearing,i,hA);n.bearing=this._map.transform.bearing+I(t.amount,-179,179),pA(n,t)}if(e.pitch){const t=fA(e.pitch,i,uA);n.pitch=this._map.transform.pitch+t.amount,pA(n,t)}if(n.zoom||n.bearing){const t=void 0===e.pinchAround?e.around:e.pinchAround;n.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),n.noMoveStart=!0,n}}function pA(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function fA(t,e,i){const{maxSpeed:n,linearity:r,deceleration:s}=i,o=I(t*r/(e/1e3),-n,n),a=Math.abs(o)/(s*r);return{easing:i.easing,duration:1e3*a,amount:o*(a/2)}}class mA extends ke{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i,n={}){const r=Ee(e.getCanvasContainer(),i);super(t,R({point:r,lngLat:e.unproject(r),originalEvent:i},n)),this._defaultPrevented=!1,this.target=e}}class gA extends ke{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){const n="touchend"===t?i.changedTouches:i.touches,r=Se(e.getCanvasContainer(),n),s=r.map((t=>e.unproject(t))),o=r.reduce(((t,e,i,n)=>t.add(e.div(n.length))),new v(0,0));super(t,{points:r,point:o,lngLats:s,lngLat:e.unproject(o),originalEvent:i}),this._defaultPrevented=!1}}class _A extends ke{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class yA{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){this._mousedownPos=void 0}wheel(t){return this._firePreventable(new _A(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new mA(t.type,this._map,t))}mouseup(t){this._map.fire(new mA(t.type,this._map,t))}preclick(t){const e=R({},t);e.type="preclick",this._map.fire(new mA(e.type,this._map,e))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||(this.preclick(t),this._map.fire(new mA(t.type,this._map,t)))}dblclick(t){return this._firePreventable(new mA(t.type,this._map,t))}mouseover(t){this._map.fire(new mA(t.type,this._map,t))}mouseout(t){this._map.fire(new mA(t.type,this._map,t))}touchstart(t){return this._firePreventable(new gA(t.type,this._map,t))}touchmove(t){this._map.fire(new gA(t.type,this._map,t))}touchend(t){this._map.fire(new gA(t.type,this._map,t))}touchcancel(t){this._map.fire(new gA(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vA{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(t){this._map.fire(new mA(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new mA("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new mA(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class bA{constructor(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(ve(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e,n=this._startPos,r=this._lastPos;if(!n||!r||r.equals(i)||!this._box&&i.dist(n)<this._clickTolerance)return;this._lastPos=i,this._box||(this._box=fe("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));const s=Math.min(n.x,i.x),o=Math.max(n.x,i.x),a=Math.min(n.y,i.y),l=Math.max(n.y,i.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${s}px,${a}px)`,this._box.style.width=o-s+"px",this._box.style.height=l-a+"px")}))}mouseupWindow(t,e){if(!this._active)return;const i=this._startPos,n=e;if(i&&0===t.button){if(this.reset(),we(),i.x!==n.x||i.y!==n.y)return this._map.fire(new ke("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(i,n,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),be(),delete this._startPos,delete this._lastPos}_fireEvent(t,e){return this._map.fire(new ke(t,{originalEvent:e}))}}function xA(t,e){const i={};for(let n=0;n<t.length;n++)i[t[n].identifier]=e[n];return i}class wA{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,e,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){const e=new v(0,0);for(const i of t)e._add(i);return e.div(t.length)}(e),this.touches=xA(i,e)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const n=xA(i,e);for(const t in this.touches){const e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class EA{constructor(t){this.singleTap=new wA(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const n=this.singleTap.touchend(t,e,i);if(n){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class SA{constructor(){this._zoomIn=new EA({numTouches:1,numTaps:2}),this._zoomOut=new EA({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const n=this._zoomIn.touchend(t,e,i),r=this._zoomOut.touchend(t,e,i);return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}):r?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(r)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const TA={0:1,2:2};class MA{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(t,e){return!1}_move(t,e){return{}}mousedown(t,e){if(this._lastPoint)return;const i=Te(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}mousemoveWindow(t,e){const i=this._lastPoint;if(i)if(t.preventDefault(),null!=this._eventButton&&function(t,e){const i=TA[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(i,e)}mouseupWindow(t){this._lastPoint&&Te(t)===this._eventButton&&(this._moved&&we(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class AA extends MA{mousedown(t,e){super.mousedown(t,e),this._lastPoint&&(this._active=!0)}_correctButton(t,e){return 0===e&&!t.ctrlKey}_move(t,e){return{around:e,panDelta:e.sub(t)}}}class CA extends MA{_correctButton(t,e){return 0===e&&t.ctrlKey||2===e}_move(t,e){const i=.8*(e.x-t.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(t){t.preventDefault()}}class kA extends MA{_correctButton(t,e){return 0===e&&t.ctrlKey||2===e}_move(t,e){const i=-.5*(e.y-t.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(t){t.preventDefault()}}class PA{constructor(t,e){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=e.clickTolerance||1,this.reset(),$(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new v(0,0)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active&&!(i.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===i.length&&!nt())return void this._showTouchPanBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,e,i)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,e,i){i.length>0&&(this._active=!0);const n=xA(i,e),r=new v(0,0),s=new v(0,0);let o=0;for(const t in n){const e=n[t],i=this._touches[t];i&&(r._add(e),s._add(e.sub(i)),o++,n[t]=e)}if(this._touches=n,o<this._minTouches||!s.mag())return;const a=s.div(o);return this._sum._add(a),this._sum.mag()<this._clickTolerance?void 0:{around:r.div(o),panDelta:a}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=fe("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")}),500)}}class IA{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(t){}_move(t,e,i){return{}}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){const n=this._firstTwoTouches;if(!n)return;t.preventDefault();const[r,s]=n,o=DA(i,e,r),a=DA(i,e,s);if(!o||!a)return;const l=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],l,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,s=DA(i,e,n),o=DA(i,e,r);s&&o||(this._active&&we(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function DA(t,e,i){for(let n=0;n<t.length;n++)if(t[n].identifier===i)return e[n]}function OA(t,e){return Math.log(t/e)/Math.LN2}class LA extends IA{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(OA(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:OA(this._distance,i),pinchAround:e}}}function zA(t,e){return 180*t.angleWith(e)/Math.PI}class RA extends IA{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e){const i=this._vector;if(this._vector=t[0].sub(t[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:zA(this._vector,i),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=this._startVector;if(!i)return!1;const n=zA(t,i);return Math.abs(n)<e}}function FA(t){return Math.abs(t.y)>Math.abs(t.x)}class BA extends IA{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(t){this._lastPoints=t,FA(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){const n=this._lastPoints;if(!n)return;const r=t[0].sub(n[0]),s=t[1].sub(n[1]);return this._map._cooperativeGestures&&!nt()&&i.touches.length<3||(this._valid=this.gestureBeginsVertically(r,s,i.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+s.y)/2*-.5})}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,r=e.mag()>=2;if(!n&&!r)return;if(!n||!r)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const s=t.y>0==e.y>0;return FA(t)&&FA(e)&&s}}const NA={panStep:100,bearingStep:15,pitchStep:10};class jA{constructor(){const t=NA;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,n=0,r=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),r=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),r=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:o=>{const a=o.getZoom();o.easeTo({duration:300,easeId:"keyboardHandler",easing:VA,zoom:e?Math.round(a)+e*(t.shiftKey?2:1):a,bearing:o.getBearing()+i*this._bearingStep,pitch:o.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-s*this._panStep],center:o.getCenter()},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function VA(t){return t*(2-t)}const UA=4.000244140625;class $A{constructor(t,e){this._map=t,this._el=t.getCanvasContainer(),this._handler=e,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,$(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||nt()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=t.deltaMode===e.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const n=pe.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%UA==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const e=Ee(this._el,t);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:e,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const e=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const i="wheel"===this._type&&Math.abs(this._delta)>UA?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==n&&(n=1/n);const r=e(),s=Math.pow(2,r),o="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):s;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(o*n))),"wheel"===this._type&&(this._startZoom=r,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const i="number"==typeof this._targetZoom?this._targetZoom:e(),n=this._startZoom,r=this._easing;let s,o=!1;if("wheel"===this._type&&n&&r){const t=Math.min((pe.now()-this._lastWheelEventTime)/200,1);s=Jn(n,i,r(t)),t<1?this._frameId||(this._frameId=!0):o=!0}else s=i,o=!0;this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200));let a=s-e();return a*this._lastDelta<0&&(a=0),{noInertia:!0,needsRenderFrame:!o,zoomDelta:a,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let e=P;if(this._prevEase){const t=this._prevEase,i=(pe.now()-t.start)/t.duration,n=t.easing(i+.01)-t.easing(i),r=.27/Math.sqrt(n*n+1e-4)*.01;e=k(r,Math.sqrt(.0729-r*r),.25,1)}return this._prevEase={start:pe.now(),duration:t,easing:e},e}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=fe("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(e.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")}),200)}}class HA{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class qA{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class WA{constructor(){this._tap=new EA({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class GA{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ZA{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class YA{constructor(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const XA=t=>t.zoom||t.drag||t.pitch||t.rotate;class KA extends ke{}class QA{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,e){const i=Ou.sub([],e,t);this.radius=Ou.length(i[2]<0?Ou.div([],i,this.constants):[i[0],i[1],0])}projectRay(t){Ou.div(t,t,this.constants),Ou.normalize(t,t),Ou.mul(t,t,this.constants);const e=Ou.scale([],t,this.radius);if(e[2]>0){const t=Ou.scale([],[0,0,1],Ou.dot(e,[0,0,1])),i=Ou.scale([],Ou.normalize([],[e[0],e[1],0]),this.radius),n=Ou.add([],e,Ou.scale([],Ou.sub([],Ou.add([],i,t),e),2));e[0]=n[0],e[1]=n[1]}return e}}function JA(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class tC{constructor(t,i){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new dA(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new QA,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),$(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[e.document,"mousemove",{capture:!0}],[e.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[e,"blur",void 0]];for(const[t,i,n]of this._listeners)t.addEventListener(i,t===e.document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(const[t,i,n]of this._listeners)t.removeEventListener(i,t===e.document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(t){const e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new yA(e,t));const n=e.boxZoom=new bA(e,t);this._add("boxZoom",n);const r=new SA,s=new qA;e.doubleClickZoom=new HA(s,r),this._add("tapZoom",r),this._add("clickZoom",s);const o=new WA;this._add("tapDragZoom",o);const a=e.touchPitch=new BA(e);this._add("touchPitch",a);const l=new CA(t),c=new kA(t);e.dragRotate=new ZA(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const h=new AA(t),u=new PA(e,t);e.dragPan=new GA(i,h,u),this._add("mousePan",h),this._add("touchPan",u,["touchZoom","touchRotate"]);const d=new RA,p=new LA;e.touchZoomRotate=new YA(i,p,d,o),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]),this._add("blockableMapEvent",new vA(e));const f=e.scrollZoom=new $A(e,this);this._add("scrollZoom",f,["mousePan"]);const m=e.keyboard=new jA;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[i]&&e[i].enable(t[i])}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!XA(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(t,e,i){for(const n in t)if(n!==i&&(!e||e.indexOf(n)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}handleEvent(t,e){this._updatingCamera=!0;const i="renderFrame"===t.type,n=i?void 0:t,r={needsRenderFrame:!1},s={},o={},a=t.touches?this._getMapTouches(t.touches):void 0,l=a?Se(this._el,a):i?void 0:Ee(this._el,t);for(const{handlerName:i,handler:c,allowed:h}of this._handlers){if(!c.isEnabled())continue;let u;this._blockedByActive(o,h,i)?c.reset():c[e||t.type]&&(u=c[e||t.type](t,l,a),this.mergeHandlerResult(r,s,u,i,n),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||c.isActive())&&(o[i]=c)}const c={};for(const t in this._previousActiveHandlers)o[t]||(c[t]=n);this._previousActiveHandlers=o,(Object.keys(c).length||JA(r))&&(this._changes.push([r,s,c]),this._triggerRenderFrame()),(Object.keys(o).length||JA(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=r;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(t,e,i,n,r){if(!i)return;R(t,i);const s={handlerName:n,originalEvent:i.originalEvent||r};void 0!==i.zoomDelta&&(e.zoom=s),void 0!==i.panDelta&&(e.drag=s),void 0!==i.pitchDelta&&(e.pitch=s),void 0!==i.bearingDelta&&(e.rotate=s)}_applyChanges(){const t={},e={},i={};for(const[n,r,s]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new v(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.aroundCoord&&(t.aroundCoord=n.aroundCoord),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),R(e,r),R(i,s);this._updateMapTransform(t,e,i),this._changes=[]}_updateMapTransform(t,e,i){const n=this._map,r=n.transform,s=t=>[t.x,t.y,t.z];if((t=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!JA(t)){const t=r.zoom;r.cameraElevationReference="sea",null!=this._originalZoom&&r._orthographicProjectionAtLowPitch&&"globe"!==r.projection.name&&0===r.pitch?(r.cameraElevationReference="ground",r.zoom=this._originalZoom):(r.recenterOnTerrain(),r.cameraElevationReference="ground"),t!==r.zoom&&this._map._update(!0)}if(r._isCameraConstrained&&n._stop(!0),!JA(t))return void this._fireEvents(e,i,!0);let{panDelta:o,zoomDelta:a,bearingDelta:l,pitchDelta:c,around:h,aroundCoord:u,pinchAround:d}=t;r._isCameraConstrained&&(a>0&&(a=0),r._isCameraConstrained=!1),void 0!==d&&(h=d),(a||(t=>e[t]&&!this._eventsInProgress[t])("drag"))&&h&&(this._dragOrigin=s(r.pointCoordinate3D(h)),this._originalZoom=r.zoom,this._trackingEllipsoid.setup(r._camera.position,this._dragOrigin)),r.cameraElevationReference="sea",n._stop(!0),h=h||n.transform.centerPoint,l&&(r.bearing+=l),c&&(r.pitch+=c),r._updateCameraState();const p=[0,0,0];if(o)if("mercator"===r.projection.name){const t=this._trackingEllipsoid.projectRay(r.screenPointToMercatorRay(h).dir),e=this._trackingEllipsoid.projectRay(r.screenPointToMercatorRay(h.sub(o)).dir);p[0]=e[0]-t[0],p[1]=e[1]-t[1]}else{const t=r.pointCoordinate(h);if("globe"===r.projection.name){o=o.rotate(-r.angle);const e=r._pixelsPerMercatorPixel/r.worldSize;p[0]=-o.x*ap(ip(t.y))*e,p[1]=-o.y*ap(r.center.lat)*e}else{const e=r.pointCoordinate(h.sub(o));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const f=r.zoom,m=[0,0,0];if(a){const t=s(u||r.pointCoordinate3D(h)),e={dir:Ou.normalize([],Ou.sub([],t,r._camera.position))};if(e.dir[2]<0){const i=r.zoomDeltaToMovement(t,a);Ou.scale(m,e.dir,i)}}const g=Ou.add(p,p,m);r._translateCameraConstrained(g),a&&Math.abs(r.zoom-f)>1e-4&&r.recenterOnTerrain(),r.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_fireEvents(t,e,i){const n=XA(this._eventsInProgress),r=XA(t),s={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!n&&r&&this._fireEvent("movestart",r.originalEvent);for(const t in s)this._fireEvent(t,s[t]);r&&this._fireEvent("move",r.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const o={};let a;for(const t in this._eventsInProgress){const{handlerName:i,originalEvent:n}=this._eventsInProgress[t];this._handlersById[i].isActive()||(delete this._eventsInProgress[t],a=e[i]||n,o[`${t}end`]=a)}for(const t in o)this._fireEvent(t,o[t]);const l=XA(this._eventsInProgress);if(i&&(n||r)&&!l){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),e=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t?(e(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:a})):(this._map.fire(new ke("moveend",{originalEvent:a})),e(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,e){this._map.fire(new ke(t,e?{originalEvent:e}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{this._frameId=void 0,this.handleEvent(new KA("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const eC="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class iC extends Ie{constructor(t,e){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this._respectPrefersReducedMotion=!1!==e.respectPrefersReducedMotion,$(["_renderFrameCallback"],this)}getCenter(){return new Zd(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,e,i){return t=v.convert(t).mult(-1),this.panTo(this.transform.center,R({offset:t},e),i)}panTo(t,e,i){return this.easeTo(R({center:t},e),i)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,e,i){return this.easeTo(R({zoom:t},e),i)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,e,i){return this.easeTo(R({bearing:t},e),i)}resetNorth(t,e){return this.rotateTo(0,R({duration:1e3},t),e),this}resetNorthPitch(t,e){return this.easeTo(R({bearing:0,pitch:0,duration:1e3},t),e),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=ac.convert(t);const i=e&&e.bearing||0,n=e&&e.pitch||0,r=t.getNorthWest(),s=t.getSouthEast();return this._cameraForBounds(this.transform,r,s,i,n,e)}_extendCameraOptions(t){const e={top:0,bottom:0,right:0,left:0};if("number"==typeof(t=R({padding:e,offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding){const e=t.padding;t.padding={top:e,bottom:e,right:e,left:e}}return t.padding=R(e,t.padding),t}_minimumAABBFrustumDistance(t,e){const i=e.max[0]-e.min[0],n=e.max[1]-e.min[1];return i/n>t.aspect?i/(2*Math.tan(.5*t.fovX)*t.aspect):n/(2*Math.tan(.5*t.fovY)*t.aspect)}_cameraForBoundsOnGlobe(t,e,i,n,r,s){const o=t.clone(),a=this._extendCameraOptions(s);o.bearing=n,o.pitch=r;const l=Zd.convert(e),c=Zd.convert(i),h=.5*(l.lat+c.lat),u=.5*(l.lng+c.lng),d=Ed(h,u),p=Ou.normalize([],d),f=Ou.normalize([],Ou.cross([],p,[0,1,0])),m=Ou.cross([],f,p),g=[f[0],f[1],f[2],0,m[0],m[1],m[2],0,p[0],p[1],p[2],0,0,0,0,1],_=[d,Ed(l.lat,l.lng),Ed(c.lat,l.lng),Ed(c.lat,c.lng),Ed(l.lat,c.lng),Ed(h,l.lng),Ed(h,c.lng),Ed(l.lat,u),Ed(c.lat,u)];let y=ed.fromPoints(_.map((t=>[Ou.dot(f,t),Ou.dot(m,t),Ou.dot(p,t)])));const v=Ou.transformMat4([],y.center,g);0===Ou.squaredLength(v)&&Ou.set(v,0,0,1),Ou.normalize(v,v),Ou.scale(v,v,rd),o.center=function([t,e,i]){const n=Math.hypot(t,e,i),r=Math.atan2(t,i),s=.5*Math.PI-Math.acos(-e/n);return new Zd(S(r),S(s))}(v);const b=o.getWorldToCameraMatrix(),x=Au.invert(new Float64Array(16),b);y=ed.applyTransform(y,Au.multiply([],b,g)),Ou.transformMat4(v,v,b);const w=.5*(y.max[2]-y.min[2]),E=this._minimumAABBFrustumDistance(o,y),T=Ou.scale([],[0,0,1],w),M=Ou.add(T,v,T),A=E+(0===o.pitch?0:Ou.distance(v,M)),C=o.globeCenterInViewSpace,k=Ou.sub([],v,[C[0],C[1],C[2]]);Ou.normalize(k,k),Ou.scale(k,k,A);const P=Ou.add([],v,k);Ou.transformMat4(P,P,x);const I=qd/rd,D=Ou.length(P),O=tp(Math.max(D*I-qd,Number.EPSILON),0),L=Math.min(o.zoomFromMercatorZAdjusted(O),a.maxZoom);return L>.5*(id+nd)?(o.setProjection({name:"mercator"}),o.zoom=L,this._cameraForBounds(o,e,i,n,r,s)):{center:o.center,zoom:L,bearing:n,pitch:r}}queryTerrainElevation(t,e){const i=this.transform.elevation;return i?(e=R({},{exaggerated:!0},e),i.getAtPoint(cp.fromLngLat(t),null,e.exaggerated)):null}_cameraForBounds(t,e,i,n,r,s){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,e,i,n,r,s);const o=t.clone(),a=this._extendCameraOptions(s),l=o.padding;o.bearing=n,o.pitch=r;const c=Zd.convert(e),h=Zd.convert(i),u=new Zd(c.lng,h.lat),d=new Zd(h.lng,c.lat),p=o.project(c),f=o.project(h),m=this.queryTerrainElevation(c),g=this.queryTerrainElevation(h),_=this.queryTerrainElevation(u),y=this.queryTerrainElevation(d),b=[[p.x,p.y,Math.min(m||0,g||0,_||0,y||0)],[f.x,f.y,Math.max(m||0,g||0,_||0,y||0)]];let x=ed.fromPoints(b);const w=o.getWorldToCameraMatrix(),S=Au.invert(new Float64Array(16),w);x=ed.applyTransform(x,w);const T=Ou.sub([],x.max,x.min),M=l.left||0,A=l.right||0,C=l.bottom||0,k=l.top||0,{left:P,right:I,top:D,bottom:O}=a.padding,L=.5*(M+A),z=.5*(k+C),R=Math.min(o.scaleZoom(o.scale*Math.min((o.width-(M+A+P+I))/T[0],(o.height-(C+k+O+D))/T[1])),a.maxZoom),F=o.scale/o.zoomScale(R);x=new ed([x.min[0]-(P+L)*F,x.min[1]-(O+z)*F,x.min[2]],[x.max[0]+(I+L)*F,x.max[1]+(D+z)*F,x.max[2]]);const B=.5*T[2],N=this._minimumAABBFrustumDistance(o,x),j=[0,0,1,0];vu.transformMat4(j,j,w),vu.normalize(j,j);const V=Ou.scale([],j,N+B),U=Ou.add([],x.center,V),$=("number"==typeof a.offset.x&&"number"==typeof a.offset.y?new v(a.offset.x,a.offset.y):v.convert(a.offset)).rotate(-E(n));x.center[0]-=$.x*F,x.center[1]+=$.y*F,Ou.transformMat4(x.center,x.center,S),Ou.transformMat4(U,U,S);const H=[x.center[0],x.center[1],U[2]*o.pixelsPerMeter];Ou.scale(H,H,1/o.worldSize);const q=ep(H[0]),W=ip(H[1]),G=Math.min(o._zoomFromMercatorZ(H[2]),a.maxZoom),Z=new Zd(q,W);return o.mercatorFromTransition&&G<.5*(id+nd)?(o.setProjection({name:"globe"}),o.zoom=G,this._cameraForBounds(o,e,i,n,r,s)):{center:Z,zoom:G,bearing:n,pitch:r}}fitBounds(t,e,i){const n=this.cameraForBounds(t,e);return this._fitInternal(n,e,i)}fitScreenCoordinates(t,e,i,n,r){const s=v.convert(t),o=v.convert(e),a=new v(Math.min(s.x,o.x),Math.min(s.y,o.y)),l=new v(Math.max(s.x,o.x),Math.max(s.y,o.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(s,o))return this;const c=this.transform.pointLocation3D(a),h=this.transform.pointLocation3D(l),u=this.transform.pointLocation3D(new v(a.x,l.y)),d=this.transform.pointLocation3D(new v(l.x,a.y)),p=[Math.min(c.lng,h.lng,u.lng,d.lng),Math.min(c.lat,h.lat,u.lat,d.lat)],f=[Math.max(c.lng,h.lng,u.lng,d.lng),Math.max(c.lat,h.lat,u.lat,d.lat)],m=n&&n.pitch?n.pitch:this.getPitch(),g=this._cameraForBounds(this.transform,p,f,i,m,n);return this._fitInternal(g,n,r)}_fitInternal(t,e,i){return t?(delete(e=R(t,e)).padding,e.linear?this.easeTo(e,i):this.flyTo(e,i)):this}jumpTo(t,e){this.stop();const i=t.preloadOnly?this.transform.clone():this.transform;let n=!1,r=!1,s=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(n=!0,i.zoom=+t.zoom),void 0!==t.center&&(i.center=Zd.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(r=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(s=!0,i.pitch=+t.pitch),null==t.padding||i.isPaddingEqual(t.padding)||(i.padding=t.padding),t.preloadOnly?(this._preloadTiles(i),this):(this.fire(new ke("movestart",e)).fire(new ke("move",e)),n&&this.fire(new ke("zoomstart",e)).fire(new ke("zoom",e)).fire(new ke("zoomend",e)),r&&this.fire(new ke("rotatestart",e)).fire(new ke("rotate",e)).fire(new ke("rotateend",e)),s&&this.fire(new ke("pitchstart",e)).fire(new ke("pitch",e)).fire(new ke("pitchend",e)),this.fire(new ke("moveend",e)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||Y(eC),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,e){const i=this.transform;if(!i.projection.supportsFreeCamera)return Y(eC),this;this.stop();const n=i.zoom,r=i.pitch,s=i.bearing;i.setFreeCameraOptions(t);const o=n!==i.zoom,a=r!==i.pitch,l=s!==i.bearing;return this.fire(new ke("movestart",e)).fire(new ke("move",e)),o&&this.fire(new ke("zoomstart",e)).fire(new ke("zoom",e)).fire(new ke("zoomend",e)),l&&this.fire(new ke("rotatestart",e)).fire(new ke("rotate",e)).fire(new ke("rotateend",e)),a&&this.fire(new ke("pitchstart",e)).fire(new ke("pitch",e)).fire(new ke("pitchend",e)),this.fire(new ke("moveend",e)),this}easeTo(t,e){this._stop(!1,t.easeId),(!1===(t=R({offset:[0,0],duration:500,easing:P},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const i=this.transform,n=this.getZoom(),r=this.getBearing(),s=this.getPitch(),o=this.getPadding(),a="zoom"in t?+t.zoom:n,l="bearing"in t?this._normalizeBearing(t.bearing,r):r,c="pitch"in t?+t.pitch:s,h="padding"in t?t.padding:i.padding,u=v.convert(t.offset);let d,p,f;if("globe"===i.projection.name){const e=cp.fromLngLat(i.center),n=u.rotate(-i.angle);e.x+=n.x/i.worldSize,e.y+=n.y/i.worldSize;const r=e.toLngLat(),s=Zd.convert(t.center||r);this._normalizeCenter(s),d=i.centerPoint.add(n),p=new v(e.x,e.y).mult(i.worldSize),f=new v(Qd(s.lng),Jd(s.lat)).mult(i.worldSize).sub(p)}else{d=i.centerPoint.add(u);const e=i.pointLocation(d),n=Zd.convert(t.center||e);this._normalizeCenter(n),p=i.project(e),f=i.project(n).sub(p)}const m=i.zoomScale(a-n);let g,_;t.around&&(g=Zd.convert(t.around),_=i.locationPoint(g));const y=this._zooming||a!==n,b=this._rotating||r!==l,x=this._pitching||c!==s,w=!i.isPaddingEqual(h),E=i=>v=>{if(y&&(i.zoom=Jn(n,a,v)),b&&(i.bearing=Jn(r,l,v)),x&&(i.pitch=Jn(s,c,v)),w&&(i.interpolatePadding(o,h,v),d=i.centerPoint.add(u)),g)i.setLocationAtPoint(g,_);else{const t=i.zoomScale(i.zoom-n),e=a>n?Math.min(2,m):Math.max(.5,m),r=Math.pow(e,1-v),s=i.unproject(p.add(f.mult(v*r)).mult(t));i.setLocationAtPoint(i.renderWorldCopies?s.wrap():s,d)}return t.preloadOnly||this._fireMoveEvents(e),i};if(t.preloadOnly){const e=this._emulate(E,t.duration,i);return this._preloadTiles(e),this}const S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=y,this._rotating=b,this._pitching=x,this._padding=w,this._easeId=t.easeId,this._prepareEase(e,t.noMoveStart,S),this._ease(E(i),(t=>{"sea"===i.cameraElevationReference&&i.recenterOnTerrain(),this._afterEase(e,t)}),t),this}_prepareEase(t,e,i={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),e||i.moving||this.fire(new ke("movestart",t)),this._zooming&&!i.zooming&&this.fire(new ke("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new ke("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new ke("pitchstart",t))}_fireMoveEvents(t){this.fire(new ke("move",t)),this._zooming&&this.fire(new ke("zoom",t)),this._rotating&&this.fire(new ke("rotate",t)),this._pitching&&this.fire(new ke("pitch",t))}_afterEase(t,e){if(this._easeId&&e&&this._easeId===e)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const i=this._zooming,n=this._rotating,r=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new ke("zoomend",t)),n&&this.fire(new ke("rotateend",t)),r&&this.fire(new ke("pitchend",t)),this.fire(new ke("moveend",t))}flyTo(t,e){if(this._prefersReducedMotion(t)){const i=F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,e)}this.stop(),t=R({offset:[0,0],speed:1.2,curve:1.42,easing:P},t);const i=this.transform,n=this.getZoom(),r=this.getBearing(),s=this.getPitch(),o=this.getPadding(),a="zoom"in t?I(+t.zoom,i.minZoom,i.maxZoom):n,l="bearing"in t?this._normalizeBearing(t.bearing,r):r,c="pitch"in t?+t.pitch:s,h="padding"in t?t.padding:i.padding,u=i.zoomScale(a-n),d=v.convert(t.offset);let p=i.centerPoint.add(d);const f=i.pointLocation(p),m=Zd.convert(t.center||f);this._normalizeCenter(m);const g=i.project(f),_=i.project(m).sub(g);let y=t.curve;const b=Math.max(i.width,i.height),x=b/u,w=_.mag();if("minZoom"in t){const e=I(Math.min(t.minZoom,n,a),i.minZoom,i.maxZoom),r=b/i.zoomScale(e-n);y=Math.sqrt(r/w*2)}const E=y*y;function S(t){const e=(x*x-b*b+(t?-1:1)*E*E*w*w)/(2*(t?x:b)*E*w);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}const A=S(0);let C=function(t){return M(A)/M(A+y*t)},k=function(t){return b*((M(A)*(T(e=A+y*t)/M(e))-T(A))/E)/w;var e},D=(S(1)-A)/y;if(Math.abs(w)<1e-6||!isFinite(D)){if(Math.abs(b-x)<1e-6)return this.easeTo(t,e);const i=x<b?-1:1;D=Math.abs(Math.log(x/b))/y,k=function(){return 0},C=function(t){return Math.exp(i*y*t)}}t.duration="duration"in t?+t.duration:1e3*D/("screenSpeed"in t?+t.screenSpeed/y:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const O=r!==l,L=c!==s,z=!i.isPaddingEqual(h),B=i=>u=>{const f=u*D,y=1/C(f);i.zoom=1===u?a:n+i.scaleZoom(y),O&&(i.bearing=Jn(r,l,u)),L&&(i.pitch=Jn(s,c,u)),z&&(i.interpolatePadding(o,h,u),p=i.centerPoint.add(d));const v=1===u?m:i.unproject(g.add(_.mult(k(f))).mult(y));return i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,p),i._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(e),i};if(t.preloadOnly){const e=this._emulate(B,t.duration,i);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=O,this._pitching=L,this._padding=z,this._prepareEase(e,!1),this._ease(B(i),(()=>this._afterEase(e)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const t=this._onEaseEnd;this._onEaseEnd=void 0,t.call(this,e)}if(!t){const t=this.handlers;t&&t.stop(!1)}return this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=pe.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((pe.now()-this._easeStart)/this._easeOptions.duration,1),e=this._onEaseFrame;e&&e(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,e){t=O(t,-180,180);const i=Math.abs(t-e);return Math.abs(t-360-e)<i&&(t-=360),Math.abs(t+360-e)<i&&(t+=360),t}_normalizeCenter(t){const e=this.transform;if(e.maxBounds)return;if("globe"!==e.projection.name&&!e.renderWorldCopies)return;const i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&pe.prefersReducedMotion&&!(t&&t.essential)}_emulate(t,e,i){const n=Math.ceil(15*e/1e3),r=[],s=t(i.clone());for(let t=0;t<=n;t++){const e=s(t/n);r.push(e.clone())}return r}}class nC{constructor(t={}){this.options=t,$(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const e=this.options&&this.options.compact;return this._map=t,this._container=fe("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=fe("button","mapboxgl-ctrl-attrib-button",this._container),fe("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=fe("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.removeAttribute("title"),t.firstElementChild&&t.firstElementChild.setAttribute("title",i)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||s.ACCESS_TOKEN}];if(t){const i=e.reduce(((t,i,n)=>(i.value&&(t+=`${i.key}=${i.value}${n<e.length-1?"&":""}`),t)),"?");t.href=`${s.FEEDBACK_URL}/${i}#${oA(this._map,!0)}`,t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}}_updateData(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let t=[];if(this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style._mergedSourceCaches;for(const i in e){const n=e[i];if(n.used){const e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=[...this.options.customAttribution,...t]:t.unshift(this.options.customAttribution));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class rC{constructor(){$(["_updateLogo","_updateCompact"],this)}onAdd(t){this._map=t,this._container=fe("div","mapboxgl-ctrl");const e=fe("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const t=this._map.style._sourceCaches;if(0===Object.entries(t).length)return!0;for(const e in t){const i=t[e].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}}}class sC{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=!0)}run(t=0){const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function oC(t,e,i){if(t=new Zd(t.lng,t.lat),e){const n=new Zd(t.lng-360,t.lat),r=new Zd(t.lng+360,t.lat),s=360*Math.ceil(Math.abs(t.lng-i.center.lng)/360),o=i.locationPoint(t).distSqr(e),a=e.x<0||e.y<0||e.x>i.width||e.y>i.height;i.locationPoint(n).distSqr(e)<o&&(a||Math.abs(n.lng-i.center.lng)<s)?t=n:i.locationPoint(r).distSqr(e)<o&&(a||Math.abs(r.lng-i.center.lng)<s)&&(t=r)}for(;Math.abs(t.lng-i.center.lng)>180;){const e=i.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=i.width&&e.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}const aC={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class lC extends Ie{constructor(t,i){if(super(),(t instanceof e.HTMLElement||i)&&(t=R({element:t},i)),$(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=v.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=fe("div");const e=41,i=27,n=me("svg",{display:"block",height:e*this._scale+"px",width:i*this._scale+"px",viewBox:`0 0 ${i} ${e}`},this._element),r=me("radialGradient",{id:"shadowGradient"},me("defs",{},n));me("stop",{offset:"10%","stop-opacity":.4},r),me("stop",{offset:"100%","stop-opacity":.05},r),me("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},n),me("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},n),me("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},n),me("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},n),this._offset=v.convert(t&&t.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()}));const n=this._element.classList;for(const t in aC)n.remove(`mapboxgl-marker-anchor-${t}`);n.add(`mapboxgl-marker-anchor-${this._anchor}`);const r=t&&t.className?t.className.trim().split(/\s+/):[];n.add(...r),this._popup=null}addTo(t){return t===this._map||(this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._updateMoving),t.on("moveend",this._update),t.on("remove",this._clearFadeTimer),t._addMarker(this),this.setDraggable(this._draggable),this._update(),t.on("click",this._onMapClick)),this}remove(){const t=this._map;return t&&(t.off("click",this._onMapClick),t.off("move",this._updateMoving),t.off("moveend",this._update),t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler),t.off("mouseup",this._onUp),t.off("touchend",this._onUp),t.off("mousemove",this._onMove),t.off("touchmove",this._onMove),t.off("remove",this._clearFadeTimer),t._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=Zd.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-i+n)],"bottom-right":[-n,-1*(e-i+n)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,t._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(t){const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()}_onMapClick(t){const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?(t.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(t.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const t=this._map,e=this._pos;if(!t||!e)return!1;const i=t.unproject(e),n=t.getFreeCameraOptions();if(!n.position)return!1;const r=n.position.toLngLat();return r.distanceTo(i)<.9*r.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const e=this._pos;if(!e||e.x<0||e.x>t.transform.width||e.y<0||e.y>t.transform.height)return void this._clearFadeTimer();const i=t.unproject(e);let n;t._showingGlobe()&&jd(t.transform,this._lngLat)?n=0:(n=1-t._queryFogOpacity(i),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(n*=this._occludedOpacity)),this._element.style.opacity=`${n}`,this._element.style.pointerEvents=n>0?"auto":"none",this._popup&&this._popup._setOpacity(n),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const t=this._pos;if(!t||!this._map)return;const e=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${t.x}px,${t.y}px)\n ${aC[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${e.x}px,${e.y}px)\n `}_calculateXYTransform(){const t=this._pos,e=this._map,i=this.getPitchAlignment();if(!e||!t||"map"!==i)return"";if(!e._showingGlobe()){const t=e.getPitch();return t?`rotateX(${t}deg)`:""}const n=S(Nd(e.transform,this._lngLat)),r=t.sub(Bd(e.transform)),s=Math.abs(r.x)+Math.abs(r.y);if(0===s)return"";const o=n/s;return`rotateX(${-r.y*o}deg) rotateY(${r.x*o}deg)`}_calculateZTransform(){const t=this._pos,e=this._map;if(!e||!t)return"";let i=0;const n=this.getRotationAlignment();if("map"===n)if(e._showingGlobe()){const t=e.project(new Zd(this._lngLat.lng,this._lngLat.lat+.001)),n=e.project(new Zd(this._lngLat.lng,this._lngLat.lat-.001)).sub(t);i=S(Math.atan2(n.y,n.x))-90}else i=-e.getBearing();else if("horizon"===n){const n=D(4,6,e.getZoom()),r=Bd(e.transform);r.y+=n*e.transform.height;const s=t.sub(r),o=S(Math.atan2(s.y,s.x));i=(o>90?o-270:o+90)*(1-n)}return i+=this._rotation,i?`rotateZ(${i}deg)`:""}_update(t){e.cancelAnimationFrame(this._updateFrameId);const i=this._map;i&&(i.transform.renderWorldCopies&&(this._lngLat=oC(this._lngLat,this._pos,i.transform)),this._pos=i.project(this._lngLat),!0===t?this._updateFrameId=e.requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),i._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(i._showingGlobe()||i.getTerrain()||i.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=v.convert(t),this._update(),this}addClassName(t){return this._element.classList.add(t),this}removeClassName(t){return this._element.classList.remove(t),this}toggleClassName(t){return this._element.classList.toggle(t)}_onMove(t){const e=this._map;if(!e)return;const i=this._pointerdownPos,n=this._positionDelta;if(i&&n){if(!this._isDragging){const n=this._clickTolerance||e._clickTolerance;if(t.point.dist(i)<n)return;this._isDragging=!0}this._pos=t.point.sub(n),this._lngLat=e.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new ke("dragstart"))),this.fire(new ke("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new ke("dragend")),this._state="inactive"}_addDragHandler(t){const e=this._map,i=this._pos;e&&i&&this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(i),this._pointerdownPos=t.point,this._state="pending",e.on("mousemove",this._onMove),e.on("touchmove",this._onMove),e.once("mouseup",this._onUp),e.once("touchend",this._onUp))}setDraggable(t){this._draggable=!!t;const e=this._map;return e&&(t?(e.on("mousedown",this._addDragHandler),e.on("touchstart",this._addDragHandler)):(e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(t){return this._occludedOpacity=t||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const cC={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},hC=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function uC(t=new v(0,0),e="bottom"){if("number"==typeof t){const i=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(e){case"top":return new v(0,t);case"top-left":return new v(i,i);case"top-right":return new v(-i,i);case"bottom":return new v(0,-t);case"bottom-left":return new v(i,-i);case"bottom-right":return new v(-i,-i);case"left":return new v(t,0);case"right":return new v(-t,0)}return new v(0,0)}return t instanceof v||Array.isArray(t)?v.convert(t):v.convert(t[e]||[0,0])}class dC{constructor(t){this.jumpTo(t)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const e=M((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-e)+this._end*e}isEasing(t){return t>=this._startTime&&t<=this._endTime}jumpTo(t){this._startTime=-1/0,this._endTime=-1/0,this._start=t,this._end=t}easeTo(t,e,i){this._start=this.getValue(e),this._end=t,this._startTime=e,this._endTime=e+i}}const pC={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},fC={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1},mC={showCompass:!0,showZoom:!0,visualizePitch:!1};class gC{constructor(t,e,i=!1){this._clickTolerance=10,this.element=e,this.mouseRotate=new CA({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new kA({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),$(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),e.addEventListener("mousedown",this.mousedown),e.addEventListener("touchstart",this.touchstart,{passive:!1}),e.addEventListener("touchmove",this.touchmove),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.reset)}down(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),ve()}move(t,e){const i=this.map,n=this.mouseRotate.mousemoveWindow(t,e),r=n&&n.bearingDelta;if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const n=this.mousePitch.mousemoveWindow(t,e),r=n&&n.pitchDelta;r&&i.setPitch(i.getPitch()+r)}}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart,{passive:!1}),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){be(),e.removeEventListener("mousemove",this.mousemove),e.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(R({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),Ee(this.element,t)),e.addEventListener("mousemove",this.mousemove),e.addEventListener("mouseup",this.mouseup)}mousemove(t){this.move(t,Ee(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=Se(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){1!==t.targetTouches.length?this.reset():(this._lastPos=Se(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const _C={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},yC={maxWidth:100,unit:"metric"},vC={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},bC={version:i,supported:re,setRTLTextPlugin:function(t,e,i=!1){if(Qo===Zo||Qo===Yo||Qo===Xo)throw new Error("setRTLTextPlugin cannot be called multiple times.");Jo=pe.resolveURL(t),Qo=Zo,Ko=e,ea(),i||ra()},getRTLTextPluginStatus:na,Map:class extends iC{constructor(t){te.mark(Jt.create);const i=t;if(null!=(t=R({},fC,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&function(t){const e=t.navigator?t.navigator.userAgent:null;return!!function(t){if(null==it){const e=t.navigator?t.navigator.userAgent:null;it=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return it}(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))}(e)&&(t.antialias=!1,Y("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Sb(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t),this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new sC,this._domRenderTaskQueue=new sC,this._controls=[],this._markers=[],this._popups=[],this._mapId=N(),this._locale=R({},pC,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new dC(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new It(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?{...t.contextCreateOptions}:{},"string"==typeof t.container){if(this._container=e.document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container.toString()}' not found.`)}else{if(!(t.container instanceof e.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&Y("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),$(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),void 0!==e&&(this._fullscreenchangeEvent="onfullscreenchange"in e.document?"fullscreenchange":"webkitfullscreenchange",e.addEventListener("online",this._onWindowOnline,!1),e.addEventListener("resize",this._onWindowResize,!1),e.addEventListener("orientationchange",this._onWindowResize,!1),e.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),e.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new tC(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||s.DEFAULT_STYLE,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),t.hash&&(this._hash=new sA("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==i.center&&null==i.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const e=t.bounds;e&&(this.resize(),this.fitBounds(e,R({},t.fitBoundsOptions,{duration:0})))}this.resize(),t.attributionControl&&this.addControl(new nC({customAttribution:t.customAttribution})),this._logoControl=new rC,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new ke(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new ke(`${t.dataType}dataloading`,t))}))}_getMapId(){return this._mapId}addControl(t,e){if(void 0===e&&(e=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new Pe(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const i=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[e];return-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new Pe(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(t);return e>-1&&this._controls.splice(e,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const e=!this._moving;return e&&this.fire(new ke("movestart",t)).fire(new ke("move",t)),this.fire(new ke("resize",t)),e&&this.fire(new ke("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(ac.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new ke("zoomstart")).fire(new ke("zoom")).fire(new ke("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new ke("zoomstart")).fire(new ke("zoom")).fire(new ke("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new ke("pitchstart")).fire(new ke("pitch")).fire(new ke("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?85:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new ke("pitchstart")).fire(new ke("pitch")).fire(new ke("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(t){return"auto"===t?e.navigator.language:Array.isArray(t)?0===t.length?void 0:t.map((t=>"auto"===t?e.navigator.language:t)):t}setLanguage(t){const e=this._parseLanguage(t);if(!this.style||e===this._language)return this;this._language=e,this.style.reloadSources();for(const t of this._controls)t._setLanguage&&t._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(t){return this.style&&t!==this._worldview?(this._worldview=t,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(t){return this._lazyInitEmptyStyle(),t?"string"==typeof t&&(t={name:t}):t=null,this._useExplicitProjection=!!t,this._prioritizeAndUpdateProjection(t,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,e=t.projection.name;let i;"globe"===e&&t.zoom>=nd?(t.setMercatorFromTransition(),i=!0):"mercator"===e&&t.zoom<nd&&(t.setProjection({name:"globe"}),i=!0),i&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(t,e){return this._updateProjection(t||e||{name:"mercator"})}_updateProjection(t){let e;return e="globe"===t.name&&this.transform.zoom>=nd?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),e&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t){return this.transform.locationPoint3D(Zd.convert(t))}unproject(t){return this.transform.pointLocation3D(v.convert(t))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let n=!1;const r=r=>{const s=e.filter((t=>this.getLayer(t))),o=s.length?this.queryRenderedFeatures(r.point,{layers:s}):[];o.length?n||(n=!0,i.call(this,new mA(t,this,r.originalEvent,{features:o}))):n=!1},s=()=>{n=!1};return{layers:new Set(e),listener:i,delegates:{mousemove:r,mouseout:s}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const r=r=>{const s=e.filter((t=>this.getLayer(t)));(s.length?this.queryRenderedFeatures(r.point,{layers:s}):[]).length?n=!0:n&&(n=!1,i.call(this,new mA(t,this,r.originalEvent)))},s=e=>{n&&(n=!1,i.call(this,new mA(t,this,e.originalEvent)))};return{layers:new Set(e),listener:i,delegates:{mousemove:r,mouseout:s}}}{const n=t=>{const n=e.filter((t=>this.getLayer(t))),r=n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];r.length&&(t.features=r,i.call(this,t),delete t.features)};return{layers:new Set(e),listener:i,delegates:{[t]:n}}}}on(t,e,i){if(void 0===i)return super.on(t,e);if(Array.isArray(e)||(e=[e]),e)for(const t of e)if(!this._isValidId(t))return this;const n=this._createDelegatedListener(t,e,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n);for(const t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);if(Array.isArray(e)||(e=[e]),e)for(const t of e)if(!this._isValidId(t))return this;const n=this._createDelegatedListener(t,e,i);for(const t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){if(void 0===i)return super.off(t,e);e=new Set(Array.isArray(e)?e:[e]);for(const t of e)if(!this._isValidId(t))return this;const n=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},r=this._delegatedListeners?this._delegatedListeners[t]:void 0;return r&&(t=>{for(let r=0;r<t.length;r++){const s=t[r];if(s.listener===i&&n(s.layers,e)){for(const t in s.delegates)this.off(t,s.delegates[t]);return t.splice(r,1),this}}})(r),this}queryRenderedFeatures(t,e){if(!this.style)return[];if(void 0!==e||void 0===t||t instanceof v||Array.isArray(t)||(e=t,t=void 0),t=t||[[0,0],[this.transform.width,this.transform.height]],(e=e||{}).layers&&Array.isArray(e.layers))for(const t of e.layers)if(!this._isValidId(t))return[];return this.style.queryRenderedFeatures(t,e,this.transform)}querySourceFeatures(t,e){return this._isValidId(t)?this.style.querySourceFeatures(t,e):[]}isPointOnSurface(t){const{name:e}=this.transform.projection;return"globe"!==e&&"mercator"!==e&&Y(`${e} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(v.convert(t))}setStyle(t,e){return!1!==(e=R({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},e)).diff&&e.localIdeographFontFamily===this._localIdeographFontFamily&&e.localFontFamily===this._localFontFamily&&this.style&&t?(this._diffStyle(t,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._localFontFamily=e.localFontFamily,this._updateStyle(t,e))}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),t&&(this.style=new nA(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new nA(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,e){if("string"==typeof t){const i=this._requestManager.normalizeStyleURL(t),n=this._requestManager.transformRequest(i,vt.Style);Et(n,((t,i)=>{t?this.fire(new Pe(t)):i&&this._updateDiff(i,e)}))}else"object"==typeof t&&this._updateDiff(t,e)}_updateDiff(t,e){try{this.style.setState(t)&&this._update(!0)}catch(i){Y(`Unable to perform style diff: ${i.message||i.error||i}. Rebuilding the style from scratch.`),this._updateStyle(t,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(Y("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new Pe(new Error("IDs can't be empty."))),!1):!ba(t)||(this.fire(new Pe(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}addSource(t,e){return this._isValidId(t)?(this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)):this}isSourceLoaded(t){return!!this._isValidId(t)&&!!this.style&&this.style._isSourceCacheLoaded(t)}areTilesLoaded(){const t=this.style&&this.style._sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}addSourceType(t,e,i){this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)}removeSource(t){return this._isValidId(t)?(this.style.removeSource(t),this._updateTerrain(),this._update(!0)):this}getSource(t){return this._isValidId(t)?this.style.getOwnSource(t):null}addImage(t,i,{pixelRatio:n=1,sdf:r=!1,stretchX:s,stretchY:o,content:a}={}){if(this._lazyInitEmptyStyle(),i instanceof e.HTMLImageElement||e.ImageBitmap&&i instanceof e.ImageBitmap){const{width:e,height:l,data:c}=pe.getImageData(i);this.style.addImage(t,{data:new ef({width:e,height:l},c),pixelRatio:n,stretchX:s,stretchY:o,content:a,sdf:r,version:0})}else if(void 0===i.width||void 0===i.height)this.fire(new Pe(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:e,height:l}=i,c=i;this.style.addImage(t,{data:new ef({width:e,height:l},new Uint8Array(c.data)),pixelRatio:n,stretchX:s,stretchY:o,content:a,sdf:r,version:0,userImage:c}),c.onAdd&&c.onAdd(this,t)}}updateImage(t,i){this._lazyInitEmptyStyle();const n=this.style.getImage(t);if(!n)return void this.fire(new Pe(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const r=i instanceof e.HTMLImageElement||e.ImageBitmap&&i instanceof e.ImageBitmap?pe.getImageData(i):i,{width:s,height:o}=r;void 0!==s&&void 0!==o?s===n.data.width&&o===n.data.height?(n.data.replace(r.data,!(i instanceof e.HTMLImageElement||e.ImageBitmap&&i instanceof e.ImageBitmap)),this.style.updateImage(t,n)):this.fire(new Pe(new Error(`The width and height of the updated image (${s}, ${o})\n must be that same as the previous version of the image\n (${n.data.width}, ${n.data.height})`))):this.fire(new Pe(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(t){return t?!!this.style&&!!this.style.getImage(t):(this.fire(new Pe(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t,i){kt(this._requestManager.transformRequest(t,vt.Image),((t,n)=>{i(t,n instanceof e.HTMLImageElement?pe.getImageData(n):n)}))}listImages(){return this.style.listImages()}addModel(t,e){this._lazyInitEmptyStyle(),this.style.addModel(t,e)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new Pe(new Error("Missing required model id"))),!1)}removeModel(t){this.style.removeModel(t)}listModels(){return this.style.listModels()}addLayer(t,e){return this._isValidId(t.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)):this}moveLayer(t,e){return this._isValidId(t)?(this.style.moveLayer(t,e),this._update(!0)):this}removeLayer(t){return this._isValidId(t)?(this.style.removeLayer(t),this._update(!0)):this}getLayer(t){return this._isValidId(t)?this.style.getOwnLayer(t):null}setLayerZoomRange(t,e,i){return this._isValidId(t)?(this.style.setLayerZoomRange(t,e,i),this._update(!0)):this}setFilter(t,e,i={}){return this._isValidId(t)?(this.style.setFilter(t,e,i),this._update(!0)):this}getFilter(t){return this._isValidId(t)?this.style.getFilter(t):null}setPaintProperty(t,e,i,n={}){return this._isValidId(t)?(this.style.setPaintProperty(t,e,i,n),this._update(!0)):this}getPaintProperty(t,e){return this._isValidId(t)?this.style.getPaintProperty(t,e):null}setLayoutProperty(t,e,i,n={}){return this._isValidId(t)?(this.style.setLayoutProperty(t,e,i,n),this._update(!0)):this}getLayoutProperty(t,e){return this._isValidId(t)?this.style.getLayoutProperty(t,e):null}getConfigProperty(t,e){return this.style.getConfigProperty(t,e)}setConfigProperty(t,e,i){return this.style.setConfigProperty(t,e,i),this._update(!0)}setLights(t){if(this._lazyInitEmptyStyle(),t&&1===t.length&&"flat"===t[0].type){const e=t[0];e.properties?this.style.setFlatLight(e.properties,e.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(t),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const t=this.style.getLights()||[];return 0===t.length&&t.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),t}setLight(t,e={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:t}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(t){return this._lazyInitEmptyStyle(),!t&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(t),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(t){return this._lazyInitEmptyStyle(),this.style.setFog(t),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setCamera(t){return this.style.setCamera(t),this._triggerCameraUpdate(t)}_triggerCameraUpdate(t){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===t["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(Zd.convert(t),this.transform):0}setFeatureState(t,e){return this._isValidId(t.source)?(this.style.setFeatureState(t,e),this._update()):this}removeFeatureState(t,e){return this._isValidId(t.source)?(this.style.removeFeatureState(t,e),this._update()):this}getFeatureState(t){return this._isValidId(t.source)?this.style.getFeatureState(t):null}_updateContainerDimensions(){if(!this._container)return;const t=this._container.getBoundingClientRect().width||400,i=this._container.getBoundingClientRect().height||300;let n,r,s,o=this._container;for(;o&&(!r||!s);){const t=e.getComputedStyle(o).transform;t&&"none"!==t&&(n=t.match(/matrix.*\((.+)\)/)[1].split(", "),n[0]&&"0"!==n[0]&&"1"!==n[0]&&(r=n[0]),n[3]&&"0"!==n[3]&&"1"!==n[3]&&(s=n[3])),o=o.parentElement}this._containerWidth=r?Math.abs(t/r):t,this._containerHeight=s?Math.abs(i/s):i}_detectMissingCSS(){"rgb(250, 128, 114)"!==e.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&Y("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=fe("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();const e=this._canvasContainer=fe("div","mapboxgl-canvas-container",t);this._canvas=fe("canvas","mapboxgl-canvas",e),this._interactive&&(e.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=fe("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{n[t]=fe("div",`mapboxgl-ctrl-${t}`,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e){const i=pe.devicePixelRatio||1;this._canvas.width=i*Math.ceil(t),this._canvas.height=i*Math.ceil(e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_addMarker(t){this._markers.push(t)}_removeMarker(t){const e=this._markers.indexOf(t);-1!==e&&this._markers.splice(e,1)}_addPopup(t){this._popups.push(t)}_removePopup(t){const e=this._popups.indexOf(t);-1!==e&&this._popups.splice(e,1)}_setupPainter(){const t=R({},re.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),e=this._canvas.getContext("webgl2",t);e?(Qt(e,!0),this.painter=new VM(e,this._contextCreateOptions,this.transform),this.on("data",(t=>{"source"===t.dataType&&this.painter.setTileLoadedFlag(!0)})),o.testSupport(e)):this.fire(new Pe(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new ke("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new ke("webglcontextrestored",{originalEvent:t}))}_onMapScroll(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_requestDomTask(t){!this.loaded()||this.loaded()&&!this.isMoving()?t():this._domRenderTaskQueue.add(t)}_render(t){let i;this.fire(new ke("renderstart"));const n=this.painter.context.extTimerQuery,r=pe.now(),s=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=s.createQuery(),s.beginQuery(n.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],e.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],e.performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const o=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,e=this.transform.pitch,i=pe.now(),n=new oa(t,{now:i,fadeDuration:o,pitch:e,transition:this.style.transition});this.style.update(n)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let a=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),a=this._updateAverageElevation(r),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):a=this._updateAverageElevation(r),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new ke("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new ke("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const t=pe.now()-r;s.endQuery(n.TIME_ELAPSED_EXT),setTimeout((()=>{const n=s.getQueryParameter(i,s.QUERY_RESULT)/1e6;s.deleteQuery(i),this.fire(new ke("gpu-timing-frame",{cpuTime:t,gpuTime:n})),e.performance.mark("frame-gpu",{startTime:r,detail:{gpuTime:n}})}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const e=this.painter.queryGpuTimers(t);this.fire(new ke("gpu-timing-layer",{layerTimes:e}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const e=this.painter.queryGpuTimeDeferredRender(t);this.fire(new ke("gpu-timing-deferred-render",{gpuTime:e}))}),50)}const l=this._sourcesDirty||this._styleDirty||this._placementDirty||a;if(l||this._repaint)this.triggerRepaint();else{const t=!this.isMoving()&&this.loaded();if(t&&(a=this._updateAverageElevation(r,!0)),a)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new ke("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new ke("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||l||(this._fullyLoaded=!0,te.mark(Jt.fullLoad),this._performanceMetricsCollection&&Zt(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(t){for(const e of this._markers)t&&!this.getRenderWorldCopies()&&(e._lngLat=e._lngLat.wrap()),e._update();for(const e of this._popups)!t||this.getRenderWorldCopies()||e._trackPointer||(e._lngLat=e._lngLat.wrap()),e._update()}_updateAverageElevation(t,e=!1){const i=t=>(this.transform.averageElevation=t,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);const n=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(n||(e||t-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(t)){const e=this.transform.averageElevation;let r=this.transform.sampleAverageElevation();this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(r)?r=0:this._averageElevationLastSampledAt=t;const s=Math.abs(e-r);if(s>1){if(this._isInitialLoad||n)return this._averageElevation.jumpTo(r),i(r);this._averageElevation.easeTo(r,t,300)}else if(s>1e-4)return this._averageElevation.jumpTo(r),i(r)}return!!this._averageElevation.isEasing(t)&&i(this._averageElevation.getValue(t))}_authenticate(){Xt(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>{if(t&&(t.message===Pt||401===t.status)){const t=this.painter.context.gl;Qt(t,!1),this._logoControl instanceof rC&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new Pe(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),Wt(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){const t=this._isDragging();this.painter.updateTerrain(this.style,t)}_calculateSpeedIndex(){const t=this.painter.canvasCopy(),e=this.painter.getCanvasCopiesAndTimestamps();e.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(t){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0);const e=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,e),e}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(t),e.canvasCopies.map(r),e.timeStamps)}_canvasPixelComparison(t,e,i){let n=i[1]-i[0];const r=t.length/4;for(let s=0;s<e.length;s++){const o=e[s];let a=0;for(let e=0;e<o.length;e+=4)o[e]===t[e]&&o[e+1]===t[e+1]&&o[e+2]===t[e+2]&&o[e+3]===t[e+3]&&(a+=1);n+=(i[s+2]-i[s+1])*(1-a/r)}return n}remove(){this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),void 0!==e&&(e.removeEventListener("resize",this._onWindowResize,!1),e.removeEventListener("orientationchange",this._onWindowResize,!1),e.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),e.removeEventListener("online",this._onWindowOnline,!1),e.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),Kt.delete(this.painter.context.gl),this._removed=!0,this.fire(new ke("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=pe.frame((t=>{const e=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,e&&this._render(t)})))}_preloadTiles(t){return L(this.style?Object.values(this.style._sourceCaches):[],((e,i)=>e._preloadTiles(t,i)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(t){this._trackResize&&this.resize({originalEvent:t})._update()}_onVisibilityChange(){"hidden"===e.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(t){this._showTerrainWireframe!==t&&(this._showTerrainWireframe=t,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(t){this._showLayers2DWireframe!==t&&(this._showLayers2DWireframe=t,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(t){this._showLayers3DWireframe!==t&&(this._showLayers3DWireframe=t,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(t){this._speedIndexTiming!==t&&(this._speedIndexTiming=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(t){this._showTileAABBs!==t&&(this._showTileAABBs=t,t&&this._update())}_setCacheLimits(t,e){!function(t,e){dt=t,pt=e}(t,e)}get version(){return i}},NavigationControl:class{constructor(t){this.options=R({},mC,t),this._container=fe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&($(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(t=>{this._map&&this._map.zoomIn({},{originalEvent:t})})),fe("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(t=>{this._map&&this._map.zoomOut({},{originalEvent:t})})),fe("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&($(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(t=>{const e=this._map;e&&(this.options.visualizePitch?e.resetNorthPitch({},{originalEvent:t}):e.resetNorth({},{originalEvent:t}))})),this._compassIcon=fe("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const t=this._map;if(!t)return;const e=t.getZoom(),i=e===t.getMaxZoom(),n=e===t.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const t=this._map;if(!t)return;const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(t.transform.pitch*(Math.PI/180)),.5)}) rotateX(${t.transform.pitch}deg) rotateZ(${t.transform.angle*(180/Math.PI)}deg)`:`rotate(${t.transform.angle*(180/Math.PI)}deg)`;t._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=e)}))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),t.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&t.on("pitch",this._rotateCompassArrow),t.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new gC(t,this._compass,this.options.visualizePitch)),this._container}onRemove(){const t=this._map;t&&(this._container.remove(),this.options.showZoom&&t.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&t.off("pitch",this._rotateCompassArrow),t.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(t,e){const i=fe("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}_setButtonTitle(t,e){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${e}`);t.setAttribute("aria-label",i),t.firstElementChild&&t.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends Ie{constructor(t){super(),this.options=R({geolocation:e.navigator.geolocation},_C,t),$(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=rA(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(t){return this._map=t,this._container=fe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(t){const i=(e=!!this.options.geolocation)=>{this._supportsGeolocation=e,t(e)};void 0!==this._supportsGeolocation?t(this._supportsGeolocation):void 0!==e.navigator.permissions?e.navigator.permissions.query({name:"geolocation"}).then((t=>i("denied"!==t.state))).catch((()=>i())):i()}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return!!e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new ke("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new ke("geolocate",t)),this._finish()}}_updateCamera(t){const e=new Zd(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,n=R({bearing:this._map.getBearing()},this.options.fitBoundsOptions);this._map.fitBounds(e.toBounds(i),n,{geolocateSource:!0})}_updateMarker(t){if(t){const e=new Zd(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(e).addTo(this._map),this._userLocationDotMarker.setLngLat(e).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,e=tp(1,t._center.lat)*t.worldSize,i=Math.ceil(2*this._accuracy*e);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new ke("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=fe("button","mapboxgl-ctrl-geolocate",this._container),fe("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){Y("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=fe("div","mapboxgl-user-location"),this._dotElement.appendChild(fe("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(fe("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new lC({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=fe("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new lC({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new ke("trackuserlocationend")))}))}}_onDeviceOrientation(t){this._userLocationDotMarker&&(t.webkitCompassHeading?this._heading=t.webkitCompassHeading:!0===t.absolute&&(this._heading=-1*t.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return Y("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new ke("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new ke("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new ke("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(t={maximumAge:6e5,timeout:0},this._noTimeout=!0):(t=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,t),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const t=()=>{e.addEventListener("ondeviceorientationabsolute"in e?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==e.DeviceMotionEvent&&"function"==typeof e.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((e=>{"granted"===e&&t()})).catch(console.error):t()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),e.removeEventListener("deviceorientation",this._onDeviceOrientation),e.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:nC,ScaleControl:class{constructor(t){this.options=R({},yC,t),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(t){return!1}}(),$(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const t=this.options.maxWidth||100,e=this._map,i=e._containerHeight/2,n=e._containerWidth/2-t/2,r=e.unproject([n,i]),s=e.unproject([n+t,i]),o=r.distanceTo(s);if("imperial"===this.options.unit){const e=3.2808*o;e>5280?this._setScale(t,e/5280,"mile"):this._setScale(t,e,"foot")}else"nautical"===this.options.unit?this._setScale(t,o/1852,"nautical-mile"):o>=1e3?this._setScale(t,o/1e3,"kilometer"):this._setScale(t,o,"meter")}_setScale(t,e,i){this._map._requestDomTask((()=>{const n=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(e),r=n/e;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(n):`${n} ${vC[i]}`,this._container.style.width=t*r+"px"}))}onAdd(t){return this._map=t,this._language=t.getLanguage(),this._container=fe("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(t){this._language=t,this._update()}setUnit(t){this.options.unit=t,this._update()}},FullscreenControl:class{constructor(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.HTMLElement?this._container=t.container:Y("Full screen control 'container' must be a DOM element.")),$(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in e.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=fe("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",Y("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,e.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!e.document.fullscreenEnabled&&!e.document.webkitFullscreenEnabled)}_setupUI(){const t=this._fullscreenButton=fe("button","mapboxgl-ctrl-fullscreen",this._controlContainer);fe("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",t)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(e.document.fullscreenElement||e.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?e.document.exitFullscreen?e.document.exitFullscreen():e.document.webkitCancelFullScreen&&e.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends Ie{constructor(t){super(),this.options=R(Object.create(cC),t),$(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new ke("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new ke("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=Zd.convert(t),this._pos=null,this._trackPointer=!1,this._update();const e=this._map;return e&&(e.on("move",this._update),e.off("mousemove",this._onMouseEvent),e._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const t=this._map;return t&&(t.off("move",this._update),t.on("mousemove",this._onMouseEvent),t.on("drag",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(e.document.createTextNode(t))}setHTML(t){const i=e.document.createDocumentFragment(),n=e.document.createElement("body");let r;for(n.innerHTML=t;r=n.firstChild,r;)i.appendChild(r);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){let e=this._content;if(e)for(;e.hasChildNodes();)e.firstChild&&e.removeChild(e.firstChild);else e=this._content=fe("div","mapboxgl-popup-content",this._container||void 0);if(e.appendChild(t),this.options.closeButton){const t=this._closeButton=fe("button","mapboxgl-popup-close-button",e);t.type="button",t.setAttribute("aria-label","Close popup"),t.setAttribute("aria-hidden","true"),t.innerHTML="×",t.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(t){return this._classList.add(t),this._updateClassList(),this}removeClassName(t){return this._classList.delete(t),this._updateClassList(),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){let e;return this._classList.delete(t)?e=!1:(this._classList.add(t),e=!0),this._updateClassList(),e}_onMouseEvent(t){this._update(t.point)}_getAnchor(t){if(this.options.anchor)return this.options.anchor;const e=this._map,i=this._container,n=this._pos;if(!e||!i||!n)return"bottom";const r=i.offsetWidth,s=i.offsetHeight,o=n.x<r/2,a=n.x>e.transform.width-r/2;if(n.y+t<s)return o?"top-left":a?"top-right":"top";if(n.y>e.transform.height-s){if(o)return"bottom-left";if(a)return"bottom-right"}return o?"left":a?"right":"bottom"}_updateClassList(){const t=this._container;if(!t)return;const e=[...this._classList];e.push("mapboxgl-popup"),this._anchor&&e.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&e.push("mapboxgl-popup-track-pointer"),t.className=e.join(" ")}_update(t){const e=this._map,i=this._content;if(!e||!this._lngLat&&!this._trackPointer||!i)return;let n=this._container;if(n||(n=this._container=fe("div","mapboxgl-popup",e.getContainer()),this._tip=fe("div","mapboxgl-popup-tip",n),n.appendChild(i)),this.options.maxWidth&&n.style.maxWidth!==this.options.maxWidth&&(n.style.maxWidth=this.options.maxWidth),e.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=oC(this._lngLat,this._pos,e.transform)),!this._trackPointer||t){const i=this._pos=this._trackPointer&&t?t:e.project(this._lngLat),n=uC(this.options.offset),r=this._anchor=this._getAnchor(n.y),s=uC(this.options.offset,r),o=i.add(s).round();e._requestDomTask((()=>{this._container&&r&&(this._container.style.transform=`${aC[r]} translate(${o.x}px,${o.y}px)`)}))}if(!this._marker&&e._showingGlobe()){const t=jd(e.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(hC);t&&t.focus()}_onClose(){this.remove()}_setOpacity(t){this._container&&(this._container.style.opacity=`${t}`),this._content&&(this._content.style.pointerEvents=t?"auto":"none")}},Marker:lC,Style:nA,LngLat:Zd,LngLatBounds:ac,Point:v,MercatorCoordinate:cp,FreeCameraOptions:Xv,Evented:Ie,config:s,prewarm:function(){Zw().acquire(qw)},clearPrewarmedResources:function(){const t=Gw;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(qw),Gw=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return s.ACCESS_TOKEN},set accessToken(t){s.ACCESS_TOKEN=t},get baseApiUrl(){return s.API_URL},set baseApiUrl(t){s.API_URL=t},get workerCount(){return Ww.workerCount},set workerCount(t){Ww.workerCount=t},get maxParallelImageRequests(){return s.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){s.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){!function(t){if(!ft())return;const i=e.caches.delete(ct);t&&i.catch(t).then((()=>t()))}(t)},workerUrl:"",workerClass:null,get dracoUrl(){return Jw()},set dracoUrl(t){!function(t){Xw=pe.resolveURL(t),Qw||(Qw=new Tw(Zw(),new Ie)),Qw.broadcast("setDracoUrl",Xw)}(t)},setNow:pe.setNow,restoreNow:pe.restoreNow};t.A=Sw,t.D=Km,t.E=un,t.F=tg,t.K=bS,t.O=qu,t.P=v,t.T=Wb,t.V=um,t.a=Qf,t.b=mm,t.c=ow,t.d=class extends Ie{constructor(t,e,i,n,r,s){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=r||Vw,this.loading={},this.loaded={},this.deduped=new jw(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler,this.brightness=s}loadTile(t,e){const i=t.uid,n=t&&t.request,r=n&&n.collectResourceTiming,s=this.loading[i]=new Bw(t);s.abort=this.loadVectorData(t,((o,a)=>{const l=!this.loading[i];if(delete this.loading[i],l||o||!a)return s.status="done",l||(this.loaded[i]=s),e(o);const c=a.rawData,h={};a.expires&&(h.expires=a.expires),a.cacheControl&&(h.cacheControl=a.cacheControl),s.vectorTile=a.vectorTile||new hm(new Rm(c));const u=()=>{s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,i)=>{if(t||!i)return e(t);const s={};if(r){const t=ne(n);t.length>0&&(s.resourceTiming=JSON.parse(JSON.stringify(t)))}e(null,R({rawTileData:c.slice(0)},i,h,s))}))};this.isSpriteLoaded?u():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(u,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):u()})),this.loaded=this.loaded||{},this.loaded[i]=s}))}reloadTile(t,e){const i=this.loaded,n=t.uid,r=this;if(i&&i[n]){const s=i[n];s.showCollisionBoxes=t.showCollisionBoxes,s.projection=t.projection,s.brightness=t.brightness,s.tileTransform=D_(t.tileID.canonical,t.projection),s.extraShadowCaster=t.extraShadowCaster;const o=(t,i)=>{const n=s.reloadCallback;n&&(delete s.reloadCallback,s.parse(s.vectorTile,r.layerIndex,this.availableImages,r.actor,n)),e(t,i)};"parsing"===s.status?s.reloadCallback=o:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,o):o())}else e(null,void 0)}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},t.e=Ss,t.f=ne,t.g=p,t.h=Et,t.i=St,t.j=function(t,e){const i=SE(t);for(const t of i){for(const e of t.meshes)TE(e);t.lights&&(t.lightMeshIndex=t.meshes.length,t.meshes.push(ME(t.lights,e)))}return i},t.k=oa,t.l=function(t){let e=0;if(new Uint32Array(t,0,1)[0]!==lE){const i=new Uint32Array(t,0,7),[,,n,r,s,o]=i;e=i.byteLength+r+s+o+s,(n!==t.byteLength||e>=t.byteLength)&&Y("Invalid b3dm header information.")}return fE(t,e)},t.m=iy,t.n=sa,t.o=ke,t.p=_,t.q=function(t){mt(),ht&&ht.then((e=>{e.keys().then((i=>{for(let n=0;n<i.length-t;n++)e.delete(i[n])}))}))},t.r=LE,t.s=bC,t.t=lp,t.v=z,t.w=e})),r(["./shared"],(function(t){function e(t){if("number"==typeof t||"boolean"==typeof t||"string"==typeof t||null==t)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(const n of t)i+=`${e(n)},`;return`${i}]`}let i="{";for(const n of Object.keys(t).sort())i+=`${n}:${e(t[n])},`;return`${i}}`}function i(i){let n="";for(const r of t.r)n+=`/${e(i[r])}`;return n}class n{constructor(t){this.keyCache={},this._layers={},this._layerConfigs={},t&&this.replace(t)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(e,n,r){this._options=r;for(const i of e){this._layerConfigs[i.id]=i;const e=this._layers[i.id]=t.c(i,this._options);e.setScope(this.scope),e.compileFilter(),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const t of n)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const s=function(t,e){const n={};for(let r=0;r<t.length;r++){const s=e&&e[t[r].id]||i(t[r]);e&&(e[t[r].id]=s);let o=n[s];o||(o=n[s]=[]),o.push(t[r])}const r=[];for(const t in n)r.push(n[t]);return r}(t.v(this._layerConfigs),this.keyCache);for(const t of s){const e=t.map((t=>this._layers[t.id])),i=e[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]={});const s=i.sourceLayer||"_geojsonTileLayer";let o=r[s];o||(o=r[s]=[]),o.push(e)}}}class r{loadTile(e,i){const{uid:n,encoding:r,rawImageData:s,padding:o}=e,a=t.w.ImageBitmap&&s instanceof t.w.ImageBitmap?this.getImageData(s,o):s;i(null,new t.D(n,a,r,o<1))}getImageData(t,e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);const i=this.offscreenCanvasContext.getImageData(-e,-e,t.width+2*e,t.height+2*e);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}function s(t,e){if(0!==t.length){o(t[0],e);for(var i=1;i<t.length;i++)o(t[i],!e)}}function o(t,e){for(var i=0,n=0,r=0,s=t.length,o=s-1;r<s;o=r++){var a=(t[r][0]-t[o][0])*(t[o][1]+t[r][1]),l=i+a;n+=Math.abs(i)>=Math.abs(a)?i-l+a:a-l+i,i=l}i+n>=0!=!!e&&t.reverse()}var a=t.g((function t(e,i){var n,r=e&&e.type;if("FeatureCollection"===r)for(n=0;n<e.features.length;n++)t(e.features[n],i);else if("GeometryCollection"===r)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],i);else if("Feature"===r)t(e.geometry,i);else if("Polygon"===r)s(e.coordinates,i);else if("MultiPolygon"===r)for(n=0;n<e.coordinates.length;n++)s(e.coordinates[n],i);return e}));const l=t.V.prototype.toGeoJSON;var c={exports:{}},h=t.p,u=t.a.VectorTileFeature,d=p;function p(t,e){this.options=e||{},this.features=t,this.length=t.length}function f(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}p.prototype.feature=function(t){return new f(this.features[t],this.options.extent)},f.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],n=[],r=0;r<i.length;r++)n.push(new h(i[r][0],i[r][1]));this.geometry.push(n)}return this.geometry},f.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,n=1/0,r=-1/0,s=0;s<t.length;s++)for(var o=t[s],a=0;a<o.length;a++){var l=o[a];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.y)}return[e,n,i,r]},f.prototype.toGeoJSON=u.prototype.toGeoJSON;var m=t.b,g=d;function _(t){var e=new m;return function(t,e){for(var i in t.layers)e.writeMessage(3,y,t.layers[i])}(t,e),e.finish()}function y(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)n.feature=t.feature(i),e.writeMessage(2,v,n);var r=n.keys;for(i=0;i<r.length;i++)e.writeStringField(3,r[i]);var s=n.values;for(i=0;i<s.length;i++)e.writeMessage(4,S,s[i])}function v(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,b,t),e.writeVarintField(3,i.type),e.writeMessage(4,E,i)}function b(t,e){var i=t.feature,n=t.keys,r=t.values,s=t.keycache,o=t.valuecache;for(var a in i.properties){var l=i.properties[a],c=s[a];if(null!==l){void 0===c&&(n.push(a),s[a]=c=n.length-1),e.writeVarint(c);var h=typeof l;"string"!==h&&"boolean"!==h&&"number"!==h&&(l=JSON.stringify(l));var u=h+":"+l,d=o[u];void 0===d&&(r.push(l),o[u]=d=r.length-1),e.writeVarint(d)}}}function x(t,e){return(e<<3)+(7&t)}function w(t){return t<<1^t>>31}function E(t,e){for(var i=t.loadGeometry(),n=t.type,r=0,s=0,o=i.length,a=0;a<o;a++){var l=i[a],c=1;1===n&&(c=l.length),e.writeVarint(x(1,c));for(var h=3===n?l.length-1:l.length,u=0;u<h;u++){1===u&&1!==n&&e.writeVarint(x(2,h-1));var d=l[u].x-r,p=l[u].y-s;e.writeVarint(w(d)),e.writeVarint(w(p)),r+=d,s+=p}3===n&&e.writeVarint(x(7,1))}}function S(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}c.exports=_,c.exports.fromVectorTileJs=_,c.exports.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var n in t)i[n]=new g(t[n].features,e),i[n].name=n,i[n].version=e.version,i[n].extent=e.extent;return _({layers:i})},c.exports.GeoJSONWrapper=g;var T=t.g(c.exports);const M={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},A=Math.fround||(C=new Float32Array(1),t=>(C[0]=+t,C[0]));var C;const k=3,P=5,I=6;class D{constructor(t){this.options=Object.assign(Object.create(M),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:i,maxZoom:n}=this.options;e&&console.time("total time");const r=`prepare ${t.length} points`;e&&console.time(r),this.points=t;const s=[];for(let e=0;e<t.length;e++){const i=t[e];if(!i.geometry)continue;const[n,r]=i.geometry.coordinates,o=A(z(n)),a=A(R(r));s.push(o,a,1/0,e,-1,1),this.options.reduce&&s.push(0)}let o=this.trees[n+1]=this._createTree(s);e&&console.timeEnd(r);for(let t=n;t>=i;t--){const i=+Date.now();o=this.trees[t]=this._createTree(this._cluster(o,t)),e&&console.log("z%d: %d clusters in %dms",t,o.numItems,+Date.now()-i)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let r=180===t[2]?180:((t[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,r=180;else if(i>r){const t=this.getClusters([i,n,180,s],e),o=this.getClusters([-180,n,r,s],e);return t.concat(o)}const o=this.trees[this._limitZoom(e)],a=o.range(z(i),R(s),z(r),R(n)),l=o.data,c=[];for(const t of a){const e=this.stride*t;c.push(l[e+P]>1?O(l,e,this.clusterProps):this.points[l[e+k]])}return c}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const s=r.data;if(e*this.stride>=s.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=r.within(s[e*this.stride],s[e*this.stride+1],o),l=[];for(const e of a){const i=e*this.stride;s[i+4]===t&&l.push(s[i+P]>1?O(s,i,this.clusterProps):this.points[s[i+k]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,i){const n=[];return this._appendLeaves(n,t,e=e||10,i=i||0,0),n}getTile(t,e,i){const n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),{extent:s,radius:o}=this.options,a=o/s,l=(i-a)/r,c=(i+1+a)/r,h={features:[]};return this._addTileFeatures(n.range((e-a)/r,l,(e+1+a)/r,c),n.data,e,i,r,h),0===e&&this._addTileFeatures(n.range(1-a/r,l,1,c),n.data,r,i,r,h),e===r-1&&this._addTileFeatures(n.range(0,l,a/r,c),n.data,-1,i,r,h),h.features.length?h:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,n,r){const s=this.getChildren(e);for(const e of s){const s=e.properties;if(s&&s.cluster?r+s.point_count<=n?r+=s.point_count:r=this._appendLeaves(t,s.cluster_id,i,n,r):r<n?r++:t.push(e),t.length===i)break}return r}_createTree(e){const i=new t.K(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)i.add(e[t],e[t+1]);return i.finish(),i.data=e,i}_addTileFeatures(t,e,i,n,r,s){for(const o of t){const t=o*this.stride,a=e[t+P]>1;let l,c,h;if(a)l=L(e,t,this.clusterProps),c=e[t],h=e[t+1];else{const i=this.points[e[t+k]];l=i.properties;const[n,r]=i.geometry.coordinates;c=z(n),h=R(r)}const u={type:1,geometry:[[Math.round(this.options.extent*(c*r-i)),Math.round(this.options.extent*(h*r-n))]],tags:l};let d;d=a||this.options.generateId?e[t+k]:this.points[e[t+k]].id,void 0!==d&&(u.id=d),s.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:i,extent:n,reduce:r,minPoints:s}=this.options,o=i/(n*Math.pow(2,e)),a=t.data,l=[],c=this.stride;for(let i=0;i<a.length;i+=c){if(a[i+2]<=e)continue;a[i+2]=e;const n=a[i],h=a[i+1],u=t.within(a[i],a[i+1],o),d=a[i+P];let p=d;for(const t of u){const i=t*c;a[i+2]>e&&(p+=a[i+P])}if(p>d&&p>=s){let t,s=n*d,o=h*d,f=-1;const m=((i/c|0)<<5)+(e+1)+this.points.length;for(const n of u){const l=n*c;if(a[l+2]<=e)continue;a[l+2]=e;const h=a[l+P];s+=a[l]*h,o+=a[l+1]*h,a[l+4]=m,r&&(t||(t=this._map(a,i,!0),f=this.clusterProps.length,this.clusterProps.push(t)),r(t,this._map(a,l)))}a[i+4]=m,l.push(s/p,o/p,1/0,m,-1,p),r&&l.push(f)}else{for(let t=0;t<c;t++)l.push(a[i+t]);if(p>1)for(const t of u){const i=t*c;if(!(a[i+2]<=e)){a[i+2]=e;for(let t=0;t<c;t++)l.push(a[i+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,i){if(t[e+P]>1){const n=this.clusterProps[t[e+I]];return i?Object.assign({},n):n}const n=this.points[t[e+k]].properties,r=this.options.map(n);return i&&r===n?Object.assign({},r):r}}function O(t,e,i){return{type:"Feature",id:t[e+k],properties:L(t,e,i),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),F(t[e+1])]}};var n}function L(t,e,i){const n=t[e+P],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,s=t[e+I],o=-1===s?{}:Object.assign({},i[s]);return Object.assign(o,{cluster:!0,cluster_id:t[e+k],point_count:n,point_count_abbreviated:r})}function z(t){return t/360+.5}function R(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function F(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var B={exports:{}};B.exports=function(){function t(i,n,r,s){for(var o,a=s,l=r-n>>1,c=r-n,h=i[n],u=i[n+1],d=i[r],p=i[r+1],f=n+3;f<r;f+=3){var m=e(i[f],i[f+1],h,u,d,p);if(m>a)o=f,a=m;else if(m===a){var g=Math.abs(f-l);g<c&&(o=f,c=g)}}a>s&&(o-n>3&&t(i,n,o,s),i[o+2]=a,r-o>3&&t(i,o,r,s))}function e(t,e,i,n,r,s){var o=r-i,a=s-n;if(0!==o||0!==a){var l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return(o=t-i)*o+(a=e-n)*a}function i(t,e,i,r){var s={id:void 0===t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)n(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var r=0;r<e.length;r++)n(t,e[r]);else if("MultiPolygon"===i)for(r=0;r<e.length;r++)for(var s=0;s<e[r].length;s++)n(t,e[r][s])}(s),s}function n(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function r(t,e,n,l){if(e.geometry){var c=e.geometry.coordinates,h=e.geometry.type,u=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),d=[],p=e.id;if(n.promoteId?p=e.properties[n.promoteId]:n.generateId&&(p=l||0),"Point"===h)s(c,d);else if("MultiPoint"===h)for(var f=0;f<c.length;f++)s(c[f],d);else if("LineString"===h)o(c,d,u,!1);else if("MultiLineString"===h){if(n.lineMetrics){for(f=0;f<c.length;f++)o(c[f],d=[],u,!1),t.push(i(p,"LineString",d,e.properties));return}a(c,d,u,!1)}else if("Polygon"===h)a(c,d,u,!0);else{if("MultiPolygon"!==h){if("GeometryCollection"===h){for(f=0;f<e.geometry.geometries.length;f++)r(t,{id:p,geometry:e.geometry.geometries[f],properties:e.properties},n,l);return}throw new Error("Input data is not a valid GeoJSON object.")}for(f=0;f<c.length;f++){var m=[];a(c[f],m,u,!0),d.push(m)}}t.push(i(p,h,d,e.properties))}}function s(t,e){e.push(l(t[0])),e.push(c(t[1])),e.push(0)}function o(e,i,n,r){for(var s,o,a=0,h=0;h<e.length;h++){var u=l(e[h][0]),d=c(e[h][1]);i.push(u),i.push(d),i.push(0),h>0&&(a+=r?(s*d-u*o)/2:Math.sqrt(Math.pow(u-s,2)+Math.pow(d-o,2))),s=u,o=d}var p=i.length-3;i[2]=1,t(i,0,p,n),i[p+2]=1,i.size=Math.abs(a),i.start=0,i.end=i.size}function a(t,e,i,n){for(var r=0;r<t.length;r++){var s=[];o(t[r],s,i,n),e.push(s)}}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function h(t,e,n,r,s,o,a,l){if(r/=e,o>=(n/=e)&&a<r)return t;if(a<n||o>=r)return null;for(var c=[],h=0;h<t.length;h++){var p=t[h],m=p.geometry,g=p.type,_=0===s?p.minX:p.minY,y=0===s?p.maxX:p.maxY;if(_>=n&&y<r)c.push(p);else if(!(y<n||_>=r)){var v=[];if("Point"===g||"MultiPoint"===g)u(m,v,n,r,s);else if("LineString"===g)d(m,v,n,r,s,!1,l.lineMetrics);else if("MultiLineString"===g)f(m,v,n,r,s,!1);else if("Polygon"===g)f(m,v,n,r,s,!0);else if("MultiPolygon"===g)for(var b=0;b<m.length;b++){var x=[];f(m[b],x,n,r,s,!0),x.length&&v.push(x)}if(v.length){if(l.lineMetrics&&"LineString"===g){for(b=0;b<v.length;b++)c.push(i(p.id,g,v[b],p.tags));continue}"LineString"!==g&&"MultiLineString"!==g||(1===v.length?(g="LineString",v=v[0]):g="MultiLineString"),"Point"!==g&&"MultiPoint"!==g||(g=3===v.length?"Point":"MultiPoint"),c.push(i(p.id,g,v,p.tags))}}}return c.length?c:null}function u(t,e,i,n,r){for(var s=0;s<t.length;s+=3){var o=t[s+r];o>=i&&o<=n&&(e.push(t[s]),e.push(t[s+1]),e.push(t[s+2]))}}function d(t,e,i,n,r,s,o){for(var a,l,c=p(t),h=0===r?g:_,u=t.start,d=0;d<t.length-3;d+=3){var f=t[d],y=t[d+1],v=t[d+2],b=t[d+3],x=t[d+4],w=0===r?f:y,E=0===r?b:x,S=!1;o&&(a=Math.sqrt(Math.pow(f-b,2)+Math.pow(y-x,2))),w<i?E>i&&(l=h(c,f,y,b,x,i),o&&(c.start=u+a*l)):w>n?E<n&&(l=h(c,f,y,b,x,n),o&&(c.start=u+a*l)):m(c,f,y,v),E<i&&w>=i&&(l=h(c,f,y,b,x,i),S=!0),E>n&&w<=n&&(l=h(c,f,y,b,x,n),S=!0),!s&&S&&(o&&(c.end=u+a*l),e.push(c),c=p(t)),o&&(u+=a)}var T=t.length-3;f=t[T],y=t[T+1],v=t[T+2],(w=0===r?f:y)>=i&&w<=n&&m(c,f,y,v),T=c.length-3,s&&T>=3&&(c[T]!==c[0]||c[T+1]!==c[1])&&m(c,c[0],c[1],c[2]),c.length&&e.push(c)}function p(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function f(t,e,i,n,r,s){for(var o=0;o<t.length;o++)d(t[o],e,i,n,r,s,!1)}function m(t,e,i,n){t.push(e),t.push(i),t.push(n)}function g(t,e,i,n,r,s){var o=(s-e)/(n-e);return t.push(s),t.push(i+(r-i)*o),t.push(1),o}function _(t,e,i,n,r,s){var o=(s-i)/(r-i);return t.push(e+(n-e)*o),t.push(s),t.push(1),o}function y(t,e){for(var n=[],r=0;r<t.length;r++){var s,o=t[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)s=v(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){s=[];for(var l=0;l<o.geometry.length;l++)s.push(v(o.geometry[l],e))}else if("MultiPolygon"===a)for(s=[],l=0;l<o.geometry.length;l++){for(var c=[],h=0;h<o.geometry[l].length;h++)c.push(v(o.geometry[l][h],e));s.push(c)}n.push(i(o.id,a,s,o.tags))}return n}function v(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var n=0;n<t.length;n+=3)i.push(t[n]+e,t[n+1],t[n+2]);return i}function b(t,e){if(t.transformed)return t;var i,n,r,s=1<<t.z,o=t.x,a=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],c=l.geometry,h=l.type;if(l.geometry=[],1===h)for(n=0;n<c.length;n+=2)l.geometry.push(x(c[n],c[n+1],e,s,o,a));else for(n=0;n<c.length;n++){var u=[];for(r=0;r<c[n].length;r+=2)u.push(x(c[n][r],c[n][r+1],e,s,o,a));l.geometry.push(u)}}return t.transformed=!0,t}function x(t,e,i,n,r,s){return[Math.round(i*(t*n-r)),Math.round(i*(e*n-s))]}function w(t,e,i,n,r){for(var s=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){o.numFeatures++,E(o,t[a],s,r);var l=t[a].minX,c=t[a].minY,h=t[a].maxX,u=t[a].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),h>o.maxX&&(o.maxX=h),u>o.maxY&&(o.maxY=u)}return o}function E(t,e,i,n){var r=e.geometry,s=e.type,o=[];if("Point"===s||"MultiPoint"===s)for(var a=0;a<r.length;a+=3)o.push(r[a]),o.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===s)S(o,r,t,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(a=0;a<r.length;a++)S(o,r[a],t,i,"Polygon"===s,0===a);else if("MultiPolygon"===s)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)S(o,c[a],t,i,!0,0===a)}if(o.length){var h=e.tags||null;if("LineString"===s&&n.lineMetrics){for(var u in h={},e.tags)h[u]=e.tags[u];h.mapbox_clip_start=r.start/r.size,h.mapbox_clip_end=r.end/r.size}var d={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:h};null!==e.id&&(d.id=e.id),t.features.push(d)}}function S(t,e,i,n,r,s){var o=n*n;if(n>0&&e.size<(r?o:n))i.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(i.numSimplified++,a.push(e[l]),a.push(e[l+1])),i.numPoints++;r&&function(t,e){for(var i=0,n=0,r=t.length,s=r-2;n<r;s=n,n+=2)i+=(t[n]-t[s])*(t[n+1]+t[s+1]);if(i>0===e)for(n=0,r=t.length;n<r/2;n+=2){var o=t[n],a=t[n+1];t[n]=t[r-2-n],t[n+1]=t[r-1-n],t[r-2-n]=o,t[r-1-n]=a}}(a,s),t.push(a)}}function T(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)r(i,t.features[n],e,n);else r(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var i=e.buffer/e.extent,n=t,r=h(t,1,-1-i,i,0,-1,2,e),s=h(t,1,1-i,2+i,0,-1,2,e);return(r||s)&&(n=h(t,1,-i,1+i,0,-1,2,e)||[],r&&(n=y(r,1).concat(n)),s&&(n=n.concat(y(s,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function M(t,e,i){return 32*((1<<t)*i+e)+t}return T.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},T.prototype.splitTile=function(t,e,i,n,r,s,o){for(var a=[t,e,i,n],l=this.options,c=l.debug;a.length;){n=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();var u=1<<e,d=M(e,i,n),p=this.tiles[d];if(!p&&(c>1&&console.time("creation"),p=this.tiles[d]=w(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,r){if(e===l.maxZoom||e===r)continue;var m=1<<r-e;if(i!==Math.floor(s/m)||n!==Math.floor(o/m))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){c>1&&console.time("clipping");var g,_,y,v,b,x,E=.5*l.buffer/l.extent,S=.5-E,T=.5+E,A=1+E;g=_=y=v=null,b=h(t,u,i-E,i+T,0,p.minX,p.maxX,l),x=h(t,u,i+S,i+A,0,p.minX,p.maxX,l),t=null,b&&(g=h(b,u,n-E,n+T,1,p.minY,p.maxY,l),_=h(b,u,n+S,n+A,1,p.minY,p.maxY,l),b=null),x&&(y=h(x,u,n-E,n+T,1,p.minY,p.maxY,l),v=h(x,u,n+S,n+A,1,p.minY,p.maxY,l),x=null),c>1&&console.timeEnd("clipping"),a.push(g||[],e+1,2*i,2*n),a.push(_||[],e+1,2*i,2*n+1),a.push(y||[],e+1,2*i+1,2*n),a.push(v||[],e+1,2*i+1,2*n+1)}}},T.prototype.getTile=function(t,e,i){var n=this.options,r=n.extent,s=n.debug;if(t<0||t>24)return null;var o=1<<t,a=M(t,e=(e%o+o)%o,i);if(this.tiles[a])return b(this.tiles[a],r);s>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,h=e,u=i;!l&&c>0;)c--,h=Math.floor(h/2),u=Math.floor(u/2),l=this.tiles[M(c,h,u)];return l&&l.source?(s>1&&console.log("found parent tile z%d-%d-%d",c,h,u),s>1&&console.time("drilling down"),this.splitTile(l.source,c,h,u,t,e,i),s>1&&console.timeEnd("drilling down"),this.tiles[a]?b(this.tiles[a],r):null):null},function(t,e){return new T(t,e)}}();var N=t.g(B.exports);function j(e,i){const n=e.tileID.canonical;if(!this._geoJSONIndex)return i(null,null);const r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return i(null,null);const s=new class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.E,this.length=e.length,this._features=e}feature(e){return new class{constructor(e){this._feature=e,this.extent=t.E,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.P(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const n=[];for(const e of i)n.push(new t.P(e[0],e[1]));e.push(n)}return e}}toGeoJSON(t,e,i){return l.call(this,t,e,i)}}(this._features[e])}}(r.features);let o=T(s);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),i(null,{vectorTile:s,rawData:o.buffer})}class V extends t.d{constructor(t,e,i,n,r,s){super(t,e,i,n,j,s),r&&(this.loadGeoJSON=r)}loadData(e,i){const n=e&&e.request,r=n&&n.collectResourceTiming;this.loadGeoJSON(e,((s,o)=>{if(s||!o)return i(s);if("object"!=typeof o)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));{a(o,!0);try{if(e.filter){const i=t.e(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const n=o.features.filter((t=>i.value.evaluate({zoom:0},t)));o={type:"FeatureCollection",features:n}}this._geoJSONIndex=e.cluster?new D(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const n={},r={},s={accumulated:null,zoom:0},o={properties:null},a=Object.keys(i);for(const e of a){const[s,o]=i[e],a=t.e(o),l=t.e("string"==typeof s?[s,["accumulated"],["get",e]]:s);n[e]=a.value,r[e]=l.value}return e.map=t=>{o.properties=t;const e={};for(const t of a)e[t]=n[t].evaluate(s,o);return e},e.reduce=(t,e)=>{o.properties=e;for(const e of a)s.accumulated=t[e],t[e]=r[e].evaluate(s,o)},e}(e)).load(o.features):N(o,e.geojsonVtOptions)}catch(s){return i(s)}this.loaded={};const l={};if(r){const i=t.f(n);i&&(l.resourceTiming={},l.resourceTiming[e.source]=JSON.parse(JSON.stringify(i)))}i(null,l)}}))}reloadTile(t,e){const i=this.loaded;return i&&i[t.uid]?super.reloadTile(t,e):this.loadTile(t,e)}loadGeoJSON(e,i){if(e.request)t.h(e.request,i);else{if("string"!=typeof e.data)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}}getClusterChildren(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}}getClusterLeaves(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}}}class U{constructor(e,i){this.tileID=new t.O(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=e.projection,this.brightness=i}parse(e,i,n,r){this.status="parsing";const s=new t.O(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),o={},a=i.familiesBySource[n.source],l=new t.F(s,n.promoteId);return l.bucketLayerIDs=[],t.l(e).then((e=>{if(!e)return r(new Error("Could not parse tile"));const i=t.j(e,1/t.t(n.tileID.canonical)),c=e.json.extensionsUsed&&e.json.extensionsUsed.includes("MAPBOX_mesh_features"),h=new t.k(this.zoom,{brightness:this.brightness});for(const n in a)for(const r of a[n]){const n=r[0],a=e.json.extensionsUsed;n.recalculate(h,[]);const l=new t.T(i,s,a&&a.includes("MAPBOX_mesh_features"),this.brightness);c||(l.needsUpload=!0),o[n.fqid]=l,l.evaluate(n)}this.status="done",r(null,{buckets:o,featureIndex:l})})).catch((t=>r(new Error(t.message))))}}class ${constructor(t,e,i,n,r,s){this.actor=t,this.layerIndex=e,this.brightness=s,this.loading={},this.loaded={}}loadTile(e,i){const n=e.uid,r=this.loading[n]=new U(e,this.brightness);t.i(e.request,((t,s)=>{const o=!this.loading[n];return delete this.loading[n],o||t?(r.status="done",o||(this.loaded[n]=r),i(t)):s&&0!==s.byteLength?void r.parse(s,this.layerIndex,e,((t,e)=>{r.status="done",this.loaded=this.loaded||{},this.loaded[n]=r,t||!e?i(t):i(null,e)})):(r.status="done",this.loaded[n]=r,i())}))}reloadTile(t,e){const i=this.loaded,n=t.uid;if(i&&i[n]){const r=i[n];r.projection=t.projection,r.brightness=t.brightness;const s=(i,n)=>{r.reloadCallback&&(delete r.reloadCallback,this.loadTile(t,e)),e(i,n)};"parsing"===r.status?r.reloadCallback=s:"done"===r.status&&this.loadTile(t,e)}}abortTile(t,e){const i=t.uid;this.loading[i]&&delete this.loading[i],e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}}class H{constructor(e){this.self=e,this.actor=new t.A(e,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=t.m({name:"mercator"}),this.workerSourceTypes={vector:t.d,geojson:V,"batched-model":$},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(t,e)=>{if(this.workerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=e=>{if(t.n.isParsed())throw new Error("RTL text plugin already registered.");t.n.applyArabicShaping=e.applyArabicShaping,t.n.processBidirectionalText=e.processBidirectionalText,t.n.processStyledBidirectionalText=e.processStyledBidirectionalText}}clearCaches(t,e,i){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t],i()}checkIfReady(t,e,i){i()}setReferrer(t,e){this.referrer=e}spriteLoaded(e,{scope:i,isLoaded:n}){if(this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),this.isSpriteLoaded[e][i]=n,this.workerSources[e]&&this.workerSources[e][i])for(const r in this.workerSources[e][i]){const s=this.workerSources[e][i][r];for(const e in s)s[e]instanceof t.d&&(s[e].isSpriteLoaded=n,s[e].fire(new t.o("isSpriteLoaded")))}}setImages(t,{scope:e,images:i},n){if(this.availableImages[t]||(this.availableImages[t]={}),this.availableImages[t][e]=i,this.workerSources[t]&&this.workerSources[t][e]){for(const n in this.workerSources[t][e]){const r=this.workerSources[t][e][n];for(const t in r)r[t].availableImages=i}n()}else n()}setProjection(e,i){this.projections[e]=t.m(i)}setBrightness(t,e,i){this.brightness=e,i()}setLayers(t,e,i){this.getLayerIndex(t,e.scope).replace(e.layers,e.options),i()}updateLayers(t,e,i){this.getLayerIndex(t,e.scope).update(e.layers,e.removedIds,e.options),i()}loadTile(t,e,i){e.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,e.type,e.source,e.scope).loadTile(e,i)}loadDEMTile(t,e,i){this.getDEMWorkerSource(t,e.source,e.scope).loadTile(e,i)}reloadTile(t,e,i){e.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,e.type,e.source,e.scope).reloadTile(e,i)}abortTile(t,e,i){this.getWorkerSource(t,e.type,e.source,e.scope).abortTile(e,i)}removeTile(t,e,i){this.getWorkerSource(t,e.type,e.source,e.scope).removeTile(e,i)}removeSource(t,e,i){if(!(this.workerSources[t]&&this.workerSources[t][e.scope]&&this.workerSources[t][e.scope][e.type]&&this.workerSources[t][e.scope][e.type][e.source]))return;const n=this.workerSources[t][e.scope][e.type][e.source];delete this.workerSources[t][e.scope][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,i):i()}loadWorkerSource(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}}syncRTLPluginState(e,i,n){try{t.n.setState(i);const e=t.n.getPluginURL();if(t.n.isLoaded()&&!t.n.isParsed()&&null!=e){this.self.importScripts(e);const i=t.n.isParsed();n(i?void 0:new Error(`RTL Text Plugin failed to import scripts from ${e}`),i)}}catch(t){n(t.toString())}}setDracoUrl(t,e){this.dracoUrl=e}getAvailableImages(t,e){this.availableImages[t]||(this.availableImages[t]={});let i=this.availableImages[t][e];return i||(i=[]),i}getLayerIndex(t,e){this.layerIndexes[t]||(this.layerIndexes[t]={});let i=this.layerIndexes[t][e];return i||(i=this.layerIndexes[t][e]=new n,i.scope=e),i}getWorkerSource(t,e,i,n){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][n]||(this.workerSources[t][n]={}),this.workerSources[t][n][e]||(this.workerSources[t][n][e]={}),this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={}),!this.workerSources[t][n][e][i]){const r={send:(e,i,n,r,s,o)=>{this.actor.send(e,i,n,t,s,o)},scheduler:this.actor.scheduler};this.workerSources[t][n][e][i]=new this.workerSourceTypes[e](r,this.getLayerIndex(t,n),this.getAvailableImages(t,n),this.isSpriteLoaded[t][n],void 0,this.brightness)}return this.workerSources[t][n][e][i]}getDEMWorkerSource(t,e,i){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][i]||(this.demWorkerSources[t][i]={}),this.demWorkerSources[t][i][e]||(this.demWorkerSources[t][i][e]=new r),this.demWorkerSources[t][i][e]}enforceCacheSizeLimit(e,i){t.q(i)}getWorkerPerformanceMetrics(t,e,i){i(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new H(self)),H})),r(["./shared"],(function(t){return t.s})),i}()},1608:function(t){t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,i){"use strict";var n={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0};t.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:n,OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(t,e,i){"use strict";var n,r=i(2),s=i(0),o=s.BROWSER_TYPES,a=s.OS_TYPES,l=s.DEVICE_TYPES,c=i(4),h=c.checkType,u=c.broPayload,d=c.mobilePayload,p=c.wearPayload,f=c.consolePayload,m=c.stvPayload,g=c.getNavigatorInstance,_=c.isIOS13Check,y=new r,v=y.getBrowser(),b=y.getDevice(),x=y.getEngine(),w=y.getOS(),E=y.getUA(),S=o.CHROME,T=o.CHROMIUM,M=o.IE,A=o.INTERNET_EXPLORER,C=o.OPERA,k=o.FIREFOX,P=o.SAFARI,I=o.EDGE,D=o.YANDEX,O=o.MOBILE_SAFARI,L=l.MOBILE,z=l.TABLET,R=l.SMART_TV,F=l.BROWSER,B=l.WEARABLE,N=l.CONSOLE,j=a.ANDROID,V=a.WINDOWS_PHONE,U=a.IOS,$=a.WINDOWS,H=a.MAC_OS,q=function(){return w.name===a.WINDOWS&&"10"===w.version&&("string"==typeof E&&-1!==E.indexOf("Edg/"))},W=function(){return v.name===I},G=function(){return _("iPad")},Z=b.type===R,Y=b.type===N,X=b.type===B,K=v.name===O||G(),Q=v.name===T,J=function(){switch(b.type){case L:case z:return!0;default:return!1}}()||G(),tt=b.type===L,et=b.type===z||G(),it=b.type===F,nt=w.name===j,rt=w.name===V,st=w.name===U||G(),ot=v.name===S,at=v.name===k,lt=v.name===P||v.name===O,ct=v.name===C,ht=v.name===A||v.name===M,ut=w.version?w.version:"none",dt=w.name?w.name:"none",pt=v.major,ft=v.version,mt=v.name,gt=b.vendor?b.vendor:"none",_t=b.model?b.model:"none",yt=x.name,vt=x.version,bt=E,xt=W()||q(),wt=v.name===D,Et=b.type,St=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Tt=G(),Mt=_("iPhone"),At=_("iPod"),Ct=function(){var t=g(),e=t&&t.userAgent.toLowerCase();return"string"==typeof e&&/electron/.test(e)}(),kt=q(),Pt=W(),It=w.name===$,Dt=w.name===H,Ot=h(b.type);t.exports={deviceDetect:function(){var t=Ot.isBrowser,e=Ot.isMobile,i=Ot.isTablet,n=Ot.isSmartTV,r=Ot.isConsole,s=Ot.isWearable;return t?u(t,v,x,w,E):n?m(n,x,w,E):r?f(r,x,w,E):e||i?d(Ot,b,w,E):s?p(s,x,w,E):void 0},isSmartTV:Z,isConsole:Y,isWearable:X,isMobileSafari:K,isChromium:Q,isMobile:J,isMobileOnly:tt,isTablet:et,isBrowser:it,isAndroid:nt,isWinPhone:rt,isIOS:st,isChrome:ot,isFirefox:at,isSafari:lt,isOpera:ct,isIE:ht,osVersion:ut,osName:dt,fullBrowserVersion:pt,browserVersion:ft,browserName:mt,mobileVendor:gt,mobileModel:_t,engineName:yt,engineVersion:vt,getUA:bt,isEdge:xt,isYandex:wt,deviceType:Et,isIOS13:St,isIPad13:Tt,isIPhone13:Mt,isIPod13:At,isElectron:Ct,isEdgeChromium:kt,isLegacyEdge:Pt,isWindows:It,isMacOs:Dt}},function(t,e,i){var n;!function(r,s){"use strict";var o="function",a="undefined",l="object",c="model",h="name",u="type",d="vendor",p="version",f="architecture",m="console",g="mobile",_="tablet",y="smarttv",v="wearable",b={extend:function(t,e){var i={};for(var n in t)e[n]&&e[n].length%2==0?i[n]=e[n].concat(t[n]):i[n]=t[n];return i},has:function(t,e){return"string"==typeof t&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return"string"==typeof t?t.replace(/[^\d\.]/g,"").split(".")[0]:s},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},x={rgx:function(t,e){for(var i,n,r,a,c,h,u=0;u<e.length&&!c;){var d=e[u],p=e[u+1];for(i=n=0;i<d.length&&!c;)if(c=d[i++].exec(t))for(r=0;r<p.length;r++)h=c[++n],typeof(a=p[r])===l&&a.length>0?2==a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,h):this[a[0]]=a[1]:3==a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=h?h.replace(a[1],a[2]):s:this[a[0]]=h?a[1].call(this,h,a[2]):s:4==a.length&&(this[a[0]]=h?a[3].call(this,h.replace(a[1],a[2])):s):this[a]=h||s;u+=2}},str:function(t,e){for(var i in e)if(typeof e[i]===l&&e[i].length>0){for(var n=0;n<e[i].length;n++)if(b.has(e[i][n],t))return"?"===i?s:i}else if(b.has(e[i],t))return"?"===i?s:i;return t}},w={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},E={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[h,p],[/(opios)[\/\s]+([\w\.]+)/i],[[h,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[h,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[h,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[h,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[h,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[h,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[h,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[h,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[h,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[h,p],[/(QQ)\/([\d\.]+)/i],[h,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[h,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[h,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[h,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[h],[/(LBBROWSER)/i],[h],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[h,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[h,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[h,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[h,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[h,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[h,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[h,p],[/(dolfin)\/([\w\.]+)/i],[[h,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[h,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[h,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[h,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[h,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,h],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[h,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[h,[p,x.str,w.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[h,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[h,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[h,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,b.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[f,/ower/,"",b.lowerize]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[f,b.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[c,d,[u,_]],[/applecoremedia\/[\w\.]+ \((ipad)/],[c,[d,"Apple"],[u,_]],[/(apple\s{0,1}tv)/i],[[c,"Apple TV"],[d,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[d,c,[u,_]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[c,[d,"Amazon"],[u,_]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[c,x.str,w.device.amazon.model],[d,"Amazon"],[u,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[c,d,[u,g]],[/\((ip[honed|\s\w*]+);/i],[c,[d,"Apple"],[u,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[d,c,[u,g]],[/\(bb10;\s(\w+)/i],[c,[d,"BlackBerry"],[u,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[c,[d,"Asus"],[u,_]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[d,"Sony"],[c,"Xperia Tablet"],[u,_]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[c,[d,"Sony"],[u,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[d,c,[u,m]],[/android.+;\s(shield)\sbuild/i],[c,[d,"Nvidia"],[u,m]],[/(playstation\s[34portablevi]+)/i],[c,[d,"Sony"],[u,m]],[/(sprint\s(\w+))/i],[[d,x.str,w.device.sprint.vendor],[c,x.str,w.device.sprint.model],[u,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[d,c,[u,_]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[d,[c,/_/g," "],[u,g]],[/(nexus\s9)/i],[c,[d,"HTC"],[u,_]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[c,[d,"Huawei"],[u,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[d,c,[u,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[c,[d,"Microsoft"],[u,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[d,"Microsoft"],[u,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[c,[d,"Motorola"],[u,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[c,[d,"Motorola"],[u,_]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[d,b.trim],[c,b.trim],[u,y]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[d,"Samsung"],[u,y]],[/\(dtv[\);].+(aquos)/i],[c,[d,"Sharp"],[u,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[d,"Samsung"],c,[u,_]],[/smart-tv.+(samsung)/i],[d,[u,y],c],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[d,"Samsung"],c,[u,g]],[/sie-(\w*)/i],[c,[d,"Siemens"],[u,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[d,"Nokia"],c,[u,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[c,[d,"Acer"],[u,_]],[/android.+([vl]k\-?\d{3})\s+build/i],[c,[d,"LG"],[u,_]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[d,"LG"],c,[u,_]],[/(lg) netcast\.tv/i],[d,c,[u,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[c,[d,"LG"],[u,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[c,[d,"Lenovo"],[u,_]],[/linux;.+((jolla));/i],[d,c,[u,g]],[/((pebble))app\/[\d\.]+\s/i],[d,c,[u,v]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[d,c,[u,g]],[/crkey/i],[[c,"Chromecast"],[d,"Google"]],[/android.+;\s(glass)\s\d/i],[c,[d,"Google"],[u,v]],[/android.+;\s(pixel c)\s/i],[c,[d,"Google"],[u,_]],[/android.+;\s(pixel xl|pixel)\s/i],[c,[d,"Google"],[u,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[c,/_/g," "],[d,"Xiaomi"],[u,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[c,/_/g," "],[d,"Xiaomi"],[u,_]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[c,[d,"Meizu"],[u,_]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[c,[d,"OnePlus"],[u,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[c,[d,"RCA"],[u,_]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[c,[d,"Dell"],[u,_]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[c,[d,"Verizon"],[u,_]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[d,"Barnes & Noble"],c,[u,_]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[c,[d,"NuVision"],[u,_]],[/android.+;\s(k88)\sbuild/i],[c,[d,"ZTE"],[u,_]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[c,[d,"Swiss"],[u,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[c,[d,"Swiss"],[u,_]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[c,[d,"Zeki"],[u,_]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[d,"Dragon Touch"],c,[u,_]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[c,[d,"Insignia"],[u,_]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[c,[d,"NextBook"],[u,_]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[d,"Voice"],c,[u,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[d,"LvTel"],c,[u,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[c,[d,"Envizen"],[u,_]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[d,c,[u,_]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[c,[d,"MachSpeed"],[u,_]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[d,c,[u,_]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[c,[d,"Rotor"],[u,_]],[/android.+(KS(.+))\s+build/i],[c,[d,"Amazon"],[u,_]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[d,c,[u,_]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[u,b.lowerize],d,c],[/(android[\w\.\s\-]{0,9});.+build/i],[c,[d,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[h,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[h,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,h]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[h,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[h,[p,x.str,w.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[h,"Windows"],[p,x.str,w.os.windows.version]],[/\((bb)(10);/i],[[h,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[h,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[h,"Symbian"],p],[/\((series40);/i],[h],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[h,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[h,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[h,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[h,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[h,p],[/(haiku)\s(\w+)/i],[h,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[h,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[h,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[h,p]]},S=function(t,e){if("object"==typeof t&&(e=t,t=s),!(this instanceof S))return new S(t,e).getResult();var i=t||(r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),n=e?b.extend(E,e):E;return this.getBrowser=function(){var t={name:s,version:s};return x.rgx.call(t,i,n.browser),t.major=b.major(t.version),t},this.getCPU=function(){var t={architecture:s};return x.rgx.call(t,i,n.cpu),t},this.getDevice=function(){var t={vendor:s,model:s,type:s};return x.rgx.call(t,i,n.device),t},this.getEngine=function(){var t={name:s,version:s};return x.rgx.call(t,i,n.engine),t},this.getOS=function(){var t={name:s,version:s};return x.rgx.call(t,i,n.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i=t,this},this};S.VERSION="0.7.18",S.BROWSER={NAME:h,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:f},S.DEVICE={MODEL:c,VENDOR:d,TYPE:u,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:_,WEARABLE:v,EMBEDDED:"embedded"},S.ENGINE={NAME:h,VERSION:p},S.OS={NAME:h,VERSION:p},typeof e!==a?(typeof t!==a&&t.exports&&(e=t.exports=S),e.UAParser=S):i(3)?(n=function(){return S}.call(e,i,e,t))===s||(t.exports=n):r&&(r.UAParser=S);var T=r&&(r.jQuery||r.Zepto);if(typeof T!==a){var M=new S;T.ua=M.getResult(),T.ua.get=function(){return M.getUA()},T.ua.set=function(t){M.setUA(t);var e=M.getResult();for(var i in e)T.ua[i]=e[i]}}}("object"==typeof window?window:this)},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},r=i(0),s=r.DEVICE_TYPES,o=r.defaultData,a=e.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},l=e.isIOS13Check=function(t){var e=a();return e&&e.platform&&(-1!==e.platform.indexOf(t)||"MacIntel"===e.platform&&e.maxTouchPoints>1&&!window.MSStream)};t.exports={checkType:function(t){switch(t){case s.MOBILE:return{isMobile:!0};case s.TABLET:return{isTablet:!0};case s.SMART_TV:return{isSmartTV:!0};case s.CONSOLE:return{isConsole:!0};case s.WEARABLE:return{isWearable:!0};case s.BROWSER:return{isBrowser:!0};default:return o}},broPayload:function(t,e,i,n,r){return{isBrowser:t,browserMajorVersion:e.major,browserFullVersion:e.version,browserName:e.name,engineName:i.name||!1,engineVersion:i.version,osName:n.name,osVersion:n.version,userAgent:r}},mobilePayload:function(t,e,i,r){return n({},t,{vendor:e.vendor,model:e.model,os:i.name,osVersion:i.version,ua:r})},stvPayload:function(t,e,i,n){return{isSmartTV:t,engineName:e.name,engineVersion:e.version,osName:i.name,osVersion:i.version,userAgent:n}},consolePayload:function(t,e,i,n){return{isConsole:t,engineName:e.name,engineVersion:e.version,osName:i.name,osVersion:i.version,userAgent:n}},wearPayload:function(t,e,i,n){return{isWearable:t,engineName:e.name,engineVersion:e.version,osName:i.name,osVersion:i.version,userAgent:n}},getNavigatorInstance:a,isIOS13Check:l}}])},4406:function(t){var e,i,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:r}catch(t){e=r}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var a,l=[],c=!1,h=-1;function u(){c&&a&&(c=!1,a.length?l=a.concat(l):h=-1,l.length&&d())}function d(){if(!c){var t=o(u);c=!0;for(var e=l.length;e;){for(a=l,l=[];++h<e;)a&&a[h].run();h=-1,e=l.length}a=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function f(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||c||o(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=f,n.addListener=f,n.once=f,n.off=f,n.removeListener=f,n.removeAllListeners=f,n.emit=f,n.prependListener=f,n.prependOnceListener=f,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},2279:function(t){var e,i;e=this,i=function(t){var e=function(t){return new e.lib.init(t)};function i(t,e){return e.offset[t]?isNaN(e.offset[t])?e.offset[t]:e.offset[t]+"px":"0px"}function n(t,e){return!(!t||"string"!=typeof e||!(t.className&&t.className.trim().split(/\s+/gi).indexOf(e)>-1))}return e.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},e.lib=e.prototype={toastify:"1.12.0",constructor:e,init:function(t){return t||(t={}),this.options={},this.toastElement=null,this.options.text=t.text||e.defaults.text,this.options.node=t.node||e.defaults.node,this.options.duration=0===t.duration?0:t.duration||e.defaults.duration,this.options.selector=t.selector||e.defaults.selector,this.options.callback=t.callback||e.defaults.callback,this.options.destination=t.destination||e.defaults.destination,this.options.newWindow=t.newWindow||e.defaults.newWindow,this.options.close=t.close||e.defaults.close,this.options.gravity="bottom"===t.gravity?"toastify-bottom":e.defaults.gravity,this.options.positionLeft=t.positionLeft||e.defaults.positionLeft,this.options.position=t.position||e.defaults.position,this.options.backgroundColor=t.backgroundColor||e.defaults.backgroundColor,this.options.avatar=t.avatar||e.defaults.avatar,this.options.className=t.className||e.defaults.className,this.options.stopOnFocus=void 0===t.stopOnFocus?e.defaults.stopOnFocus:t.stopOnFocus,this.options.onClick=t.onClick||e.defaults.onClick,this.options.offset=t.offset||e.defaults.offset,this.options.escapeMarkup=void 0!==t.escapeMarkup?t.escapeMarkup:e.defaults.escapeMarkup,this.options.ariaLive=t.ariaLive||e.defaults.ariaLive,this.options.style=t.style||e.defaults.style,t.backgroundColor&&(this.options.style.background=t.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var t=document.createElement("div");for(var e in t.className="toastify on "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'),this.options.style)t.style[e]=this.options.style[e];if(this.options.ariaLive&&t.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else if(this.options.escapeMarkup?t.innerText=this.options.text:t.innerHTML=this.options.text,""!==this.options.avatar){var n=document.createElement("img");n.src=this.options.avatar,n.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(n):t.insertAdjacentElement("afterbegin",n)}if(!0===this.options.close){var r=document.createElement("button");r.type="button",r.setAttribute("aria-label","Close"),r.className="toast-close",r.innerHTML="✖",r.addEventListener("click",function(t){t.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var s=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&s>360?t.insertAdjacentElement("afterbegin",r):t.appendChild(r)}if(this.options.stopOnFocus&&this.options.duration>0){var o=this;t.addEventListener("mouseover",(function(e){window.clearTimeout(t.timeOutValue)})),t.addEventListener("mouseleave",(function(){t.timeOutValue=window.setTimeout((function(){o.removeElement(t)}),o.options.duration)}))}if(void 0!==this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var a=i("x",this.options),l=i("y",this.options),c="left"==this.options.position?a:"-"+a,h="toastify-top"==this.options.gravity?l:"-"+l;t.style.transform="translate("+c+","+h+")"}return t},showToast:function(){var t;if(this.toastElement=this.buildToast(),!(t="string"==typeof this.options.selector?document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||"undefined"!=typeof ShadowRoot&&this.options.selector instanceof ShadowRoot?this.options.selector:document.body))throw"Root element is not defined";var i=e.defaults.oldestFirst?t.firstChild:t.lastChild;return t.insertBefore(this.toastElement,i),e.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(t){t.className=t.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),e.reposition()}.bind(this),400)}},e.reposition=function(){for(var t,e={top:15,bottom:15},i={top:15,bottom:15},r={top:15,bottom:15},s=document.getElementsByClassName("toastify"),o=0;o<s.length;o++){t=!0===n(s[o],"toastify-top")?"toastify-top":"toastify-bottom";var a=s[o].offsetHeight;t=t.substr(9,t.length-1),(window.innerWidth>0?window.innerWidth:screen.width)<=360?(s[o].style[t]=r[t]+"px",r[t]+=a+15):!0===n(s[o],"toastify-left")?(s[o].style[t]=e[t]+"px",e[t]+=a+15):(s[o].style[t]=i[t]+"px",i[t]+=a+15)}return this},e.lib.init.prototype=e.lib,e},t.exports?t.exports=i():e.Toastify=i()},9766:function(t){t.exports=function(){"use strict";const t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),i=t&&window.devicePixelRatio>1,n={elements_selector:".lazy",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},r=t=>Object.assign({},n,t),s=function(t,e){let i;const n="LazyLoad::Initialized",r=new t(e);try{i=new CustomEvent(n,{detail:{instance:r}})}catch(t){i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!1,!1,{instance:r})}window.dispatchEvent(i)},o="src",a="srcset",l="sizes",c="poster",h="llOriginalAttrs",u="data",d="loading",p="loaded",f="applied",m="error",g="native",_="data-",y="ll-status",v=(t,e)=>t.getAttribute(_+e),b=t=>v(t,y),x=(t,e)=>((t,e,i)=>{const n=_+e;null!==i?t.setAttribute(n,i):t.removeAttribute(n)})(t,y,e),w=t=>x(t,null),E=t=>null===b(t),S=t=>b(t)===g,T=[d,p,f,m],M=(t,e,i,n)=>{t&&"function"==typeof t&&(void 0===n?void 0===i?t(e):t(e,i):t(e,i,n))},A=(e,i)=>{t&&""!==i&&e.classList.add(i)},C=(e,i)=>{t&&""!==i&&e.classList.remove(i)},k=t=>t.llTempImage,P=(t,e)=>{if(!e)return;const i=e._observer;i&&i.unobserve(t)},I=(t,e)=>{t&&(t.loadingCount+=e)},D=(t,e)=>{t&&(t.toLoadCount=e)},O=t=>{let e=[];for(let i,n=0;i=t.children[n];n+=1)"SOURCE"===i.tagName&&e.push(i);return e},L=(t,e)=>{const i=t.parentNode;i&&"PICTURE"===i.tagName&&O(i).forEach(e)},z=(t,e)=>{O(t).forEach(e)},R=[o],F=[o,c],B=[o,a,l],N=[u],j=t=>!!t[h],V=t=>t[h],U=t=>delete t[h],$=(t,e)=>{if(j(t))return;const i={};e.forEach((e=>{i[e]=t.getAttribute(e)})),t[h]=i},H=(t,e)=>{if(!j(t))return;const i=V(t);e.forEach((e=>{((t,e,i)=>{i?t.setAttribute(e,i):t.removeAttribute(e)})(t,e,i[e])}))},q=(t,e,i)=>{A(t,e.class_applied),x(t,f),i&&(e.unobserve_completed&&P(t,e),M(e.callback_applied,t,i))},W=(t,e,i)=>{A(t,e.class_loading),x(t,d),i&&(I(i,1),M(e.callback_loading,t,i))},G=(t,e,i)=>{i&&t.setAttribute(e,i)},Z=(t,e)=>{G(t,l,v(t,e.data_sizes)),G(t,a,v(t,e.data_srcset)),G(t,o,v(t,e.data_src))},Y={IMG:(t,e)=>{L(t,(t=>{$(t,B),Z(t,e)})),$(t,B),Z(t,e)},IFRAME:(t,e)=>{$(t,R),G(t,o,v(t,e.data_src))},VIDEO:(t,e)=>{z(t,(t=>{$(t,R),G(t,o,v(t,e.data_src))})),$(t,F),G(t,c,v(t,e.data_poster)),G(t,o,v(t,e.data_src)),t.load()},OBJECT:(t,e)=>{$(t,N),G(t,u,v(t,e.data_src))}},X=["IMG","IFRAME","VIDEO","OBJECT"],K=(t,e)=>{!e||(t=>t.loadingCount>0)(e)||(t=>t.toLoadCount>0)(e)||M(t.callback_finish,e)},Q=(t,e,i)=>{t.addEventListener(e,i),t.llEvLisnrs[e]=i},J=(t,e,i)=>{t.removeEventListener(e,i)},tt=t=>!!t.llEvLisnrs,et=t=>{if(!tt(t))return;const e=t.llEvLisnrs;for(let i in e){const n=e[i];J(t,i,n)}delete t.llEvLisnrs},it=(t,e,i)=>{(t=>{delete t.llTempImage})(t),I(i,-1),(t=>{t&&(t.toLoadCount-=1)})(i),C(t,e.class_loading),e.unobserve_completed&&P(t,i)},nt=(t,e,i)=>{const n=k(t)||t;tt(n)||((t,e,i)=>{tt(t)||(t.llEvLisnrs={});const n="VIDEO"===t.tagName?"loadeddata":"load";Q(t,n,e),Q(t,"error",i)})(n,(r=>{((t,e,i,n)=>{const r=S(e);it(e,i,n),A(e,i.class_loaded),x(e,p),M(i.callback_loaded,e,n),r||K(i,n)})(0,t,e,i),et(n)}),(r=>{((t,e,i,n)=>{const r=S(e);it(e,i,n),A(e,i.class_error),x(e,m),M(i.callback_error,e,n),i.restore_on_error&&H(e,B),r||K(i,n)})(0,t,e,i),et(n)}))},rt=(t,e,n)=>{(t=>X.indexOf(t.tagName)>-1)(t)?((t,e,i)=>{nt(t,e,i),((t,e,i)=>{const n=Y[t.tagName];n&&(n(t,e),W(t,e,i))})(t,e,i)})(t,e,n):((t,e,n)=>{(t=>{t.llTempImage=document.createElement("IMG")})(t),nt(t,e,n),(t=>{j(t)||(t[h]={backgroundImage:t.style.backgroundImage})})(t),((t,e,n)=>{const r=v(t,e.data_bg),s=v(t,e.data_bg_hidpi),a=i&&s?s:r;a&&(t.style.backgroundImage=`url("${a}")`,k(t).setAttribute(o,a),W(t,e,n))})(t,e,n),((t,e,n)=>{const r=v(t,e.data_bg_multi),s=v(t,e.data_bg_multi_hidpi),o=i&&s?s:r;o&&(t.style.backgroundImage=o,q(t,e,n))})(t,e,n),((t,e,i)=>{const n=v(t,e.data_bg_set);if(!n)return;let r=n.split("|").map((t=>`image-set(${t})`));t.style.backgroundImage=r.join(),q(t,e,i)})(t,e,n)})(t,e,n)},st=t=>{t.removeAttribute(o),t.removeAttribute(a),t.removeAttribute(l)},ot=t=>{L(t,(t=>{H(t,B)})),H(t,B)},at={IMG:ot,IFRAME:t=>{H(t,R)},VIDEO:t=>{z(t,(t=>{H(t,R)})),H(t,F),t.load()},OBJECT:t=>{H(t,N)}},lt=(t,e)=>{(t=>{const e=at[t.tagName];e?e(t):(t=>{if(!j(t))return;const e=V(t);t.style.backgroundImage=e.backgroundImage})(t)})(t),((t,e)=>{E(t)||S(t)||(C(t,e.class_entered),C(t,e.class_exited),C(t,e.class_applied),C(t,e.class_loading),C(t,e.class_loaded),C(t,e.class_error))})(t,e),w(t),U(t)},ct=["IMG","IFRAME","VIDEO"],ht=t=>t.use_native&&"loading"in HTMLImageElement.prototype,ut=(t,e,i)=>{t.forEach((t=>(t=>t.isIntersecting||t.intersectionRatio>0)(t)?((t,e,i,n)=>{const r=(t=>T.indexOf(b(t))>=0)(t);x(t,"entered"),A(t,i.class_entered),C(t,i.class_exited),((t,e,i)=>{e.unobserve_entered&&P(t,i)})(t,i,n),M(i.callback_enter,t,e,n),r||rt(t,i,n)})(t.target,t,e,i):((t,e,i,n)=>{E(t)||(A(t,i.class_exited),((t,e,i,n)=>{i.cancel_on_exit&&(t=>b(t)===d)(t)&&"IMG"===t.tagName&&(et(t),(t=>{L(t,(t=>{st(t)})),st(t)})(t),ot(t),C(t,i.class_loading),I(n,-1),w(t),M(i.callback_cancel,t,e,n))})(t,e,i,n),M(i.callback_exit,t,e,n))})(t.target,t,e,i)))},dt=t=>Array.prototype.slice.call(t),pt=t=>t.container.querySelectorAll(t.elements_selector),ft=t=>(t=>b(t)===m)(t),mt=(t,e)=>(t=>dt(t).filter(E))(t||pt(e)),gt=function(e,i){const n=r(e);this._settings=n,this.loadingCount=0,((t,e)=>{ht(t)||(e._observer=new IntersectionObserver((i=>{ut(i,t,e)}),(t=>({root:t.container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}))(t)))})(n,this),((e,i)=>{t&&(i._onlineHandler=()=>{((t,e)=>{var i;(i=pt(t),dt(i).filter(ft)).forEach((e=>{C(e,t.class_error),w(e)})),e.update()})(e,i)},window.addEventListener("online",i._onlineHandler))})(n,this),this.update(i)};return gt.prototype={update:function(t){const i=this._settings,n=mt(t,i);var r,s;D(this,n.length),e?this.loadAll(n):ht(i)?((t,e,i)=>{t.forEach((t=>{-1!==ct.indexOf(t.tagName)&&((t,e,i)=>{t.setAttribute("loading","lazy"),nt(t,e,i),((t,e)=>{const i=Y[t.tagName];i&&i(t,e)})(t,e),x(t,g)})(t,e,i)})),D(i,0)})(n,i,this):(s=n,(t=>{t.disconnect()})(r=this._observer),((t,e)=>{e.forEach((e=>{t.observe(e)}))})(r,s))},destroy:function(){this._observer&&this._observer.disconnect(),t&&window.removeEventListener("online",this._onlineHandler),pt(this._settings).forEach((t=>{U(t)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;mt(t,e).forEach((t=>{P(t,this),rt(t,e,this)}))},restoreAll:function(){const t=this._settings;pt(t).forEach((e=>{lt(e,t)}))}},gt.load=(t,e)=>{const i=r(e);rt(t,i)},gt.resetStatus=t=>{w(t)},t&&((t,e)=>{if(e)if(e.length)for(let i,n=0;i=e[n];n+=1)s(t,i);else s(t,e)})(gt,window.lazyLoadOptions),gt}()},9313:function(t,e,i){var n=i(8746);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(4940).Z)("20d56d9a",n,!0,{})},3692:function(t,e,i){var n=i(8311);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(4940).Z)("2bb1818c",n,!0,{})},7200:function(t,e,i){var n=i(3148);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(4940).Z)("9c255204",n,!0,{})},5156:function(t,e,i){var n=i(5193);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(4940).Z)("427aac18",n,!0,{})},8917:function(t,e,i){var n=i(524);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(4940).Z)("2389e5be",n,!0,{})},69:function(t,e,i){var n=i(9456);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);(0,i(4940).Z)("9eeb6b66",n,!0,{})},4940:function(t,e,i){"use strict";function n(t,e){for(var i=[],n={},r=0;r<e.length;r++){var s=e[r],o=s[0],a={id:t+":"+r,css:s[1],media:s[2],sourceMap:s[3]};n[o]?n[o].parts.push(a):i.push(n[o]={id:o,parts:[a]})}return i}i.d(e,{Z:function(){return f}});var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var s={},o=r&&(document.head||document.getElementsByTagName("head")[0]),a=null,l=0,c=!1,h=function(){},u=null,d="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,i,r){c=i,u=r||{};var o=n(t,e);return m(o),function(e){for(var i=[],r=0;r<o.length;r++){var a=o[r];(l=s[a.id]).refs--,i.push(l)}e?m(o=n(t,e)):o=[];for(r=0;r<i.length;r++){var l;if(0===(l=i[r]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete s[l.id]}}}}function m(t){for(var e=0;e<t.length;e++){var i=t[e],n=s[i.id];if(n){n.refs++;for(var r=0;r<n.parts.length;r++)n.parts[r](i.parts[r]);for(;r<i.parts.length;r++)n.parts.push(_(i.parts[r]));n.parts.length>i.parts.length&&(n.parts.length=i.parts.length)}else{var o=[];for(r=0;r<i.parts.length;r++)o.push(_(i.parts[r]));s[i.id]={id:i.id,refs:1,parts:o}}}}function g(){var t=document.createElement("style");return t.type="text/css",o.appendChild(t),t}function _(t){var e,i,n=document.querySelector("style["+d+'~="'+t.id+'"]');if(n){if(c)return h;n.parentNode.removeChild(n)}if(p){var r=l++;n=a||(a=g()),e=b.bind(null,n,r,!1),i=b.bind(null,n,r,!0)}else n=g(),e=x.bind(null,n),i=function(){n.parentNode.removeChild(n)};return e(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;e(t=n)}else i()}}var y,v=(y=[],function(t,e){return y[t]=e,y.filter(Boolean).join("\n")});function b(t,e,i,n){var r=i?"":n.css;if(t.styleSheet)t.styleSheet.cssText=v(e,r);else{var s=document.createTextNode(r),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(s,o[e]):t.appendChild(s)}}function x(t,e){var i=e.css,n=e.media,r=e.sourceMap;if(n&&t.setAttribute("media",n),u.ssrId&&t.setAttribute(d,e.id),r&&(i+="\n/*# sourceURL="+r.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}},9954:function(t){"use strict";t.exports="data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA"},2179:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill-rule=%27evenodd%27 fill=%27%23fff%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},4026:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill-rule=%27evenodd%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},8469:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23000%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},5422:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23333%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},9387:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%2333b5e5%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27 display=%27none%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},1184:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%2333b5e5%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},469:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23666%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 fill=%27%23f00%27/%3E%3C/svg%3E"},6437:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23999%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 fill=%27%23f00%27/%3E%3C/svg%3E"},2607:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23aaa%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 fill=%27%23f00%27/%3E%3C/svg%3E"},6621:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23e54e33%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27 display=%27none%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},5968:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23e58978%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},4414:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg viewBox=%270 0 20 20%27 xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23fff%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z%27/%3E%3Ccircle id=%27dot%27 cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath id=%27stroke%27 d=%27M14 5l1 1-9 9-1-1 9-9z%27 display=%27none%27/%3E%3C/svg%3E"},5866:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23000%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z%27/%3E%3C/svg%3E"},5363:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23000%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10.5 14l4-8 4 8h-8z%27/%3E%3Cpath id=%27south%27 d=%27M10.5 16l4 8 4-8h-8z%27 fill=%27%23ccc%27/%3E%3C/svg%3E"},5579:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23000%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z%27/%3E%3C/svg%3E"},7378:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23000%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z%27/%3E%3C/svg%3E"},4933:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23000%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z%27/%3E%3C/svg%3E"},7673:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z%27/%3E%3C/svg%3E"},661:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10.5 14l4-8 4 8h-8z%27/%3E%3Cpath id=%27south%27 d=%27M10.5 16l4 8 4-8h-8z%27 fill=%27%23ccc%27/%3E%3C/svg%3E"},1570:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z%27/%3E%3C/svg%3E"},2931:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z%27/%3E%3C/svg%3E"},6807:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z%27/%3E%3C/svg%3E"},1652:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10.5 14l4-8 4 8h-8z%27/%3E%3Cpath id=%27south%27 d=%27M10.5 16l4 8 4-8h-8z%27 fill=%27%23999%27/%3E%3C/svg%3E"},28:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z%27/%3E%3C/svg%3E"},551:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z%27/%3E%3C/svg%3E"},323:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z%27/%3E%3C/svg%3E"},752:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z%27/%3E%3C/svg%3E"},6081:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 xmlns:xlink=%27http://www.w3.org/1999/xlink%27 fill-rule=%27evenodd%27 viewBox=%270 0 88 23%27%3E%3Cdefs%3E%3Cpath id=%27logo%27 d=%27M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z%27/%3E%3Cpath id=%27text%27 d=%27M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z%27/%3E%3C/defs%3E%3Cmask id=%27clip%27%3E%3Crect x=%270%27 y=%270%27 width=%27100%25%27 height=%27100%25%27 fill=%27white%27/%3E%3Cuse xlink:href=%27%23logo%27/%3E%3Cuse xlink:href=%27%23text%27/%3E%3C/mask%3E%3Cg id=%27outline%27 opacity=%270.3%27 stroke=%27%23000%27 stroke-width=%273%27%3E%3Ccircle mask=%27url%28%23clip%29%27 cx=%2711.5%27 cy=%2711.5%27 r=%279.25%27/%3E%3Cuse xlink:href=%27%23text%27 mask=%27url%28%23clip%29%27/%3E%3C/g%3E%3Cg id=%27fill%27 opacity=%270.9%27 fill=%27%23fff%27%3E%3Cuse xlink:href=%27%23logo%27/%3E%3Cuse xlink:href=%27%23text%27/%3E%3C/g%3E%3C/svg%3E"},4354:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 xmlns:xlink=%27http://www.w3.org/1999/xlink%27 fill-rule=%27evenodd%27 viewBox=%270 0 88 23%27%3E%3Cdefs%3E%3Cpath id=%27logo%27 d=%27M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z%27/%3E%3Cpath id=%27text%27 d=%27M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z%27/%3E%3C/defs%3E%3Cmask id=%27clip%27%3E%3Crect x=%270%27 y=%270%27 width=%27100%25%27 height=%27100%25%27 fill=%27white%27/%3E%3Cuse xlink:href=%27%23logo%27/%3E%3Cuse xlink:href=%27%23text%27/%3E%3C/mask%3E%3Cg id=%27outline%27 opacity=%271%27 stroke=%27%23000%27 stroke-width=%273%27%3E%3Ccircle mask=%27url%28%23clip%29%27 cx=%2711.5%27 cy=%2711.5%27 r=%279.25%27/%3E%3Cuse xlink:href=%27%23text%27 mask=%27url%28%23clip%29%27/%3E%3C/g%3E%3Cg id=%27fill%27 opacity=%271%27 fill=%27%23fff%27%3E%3Cuse xlink:href=%27%23logo%27/%3E%3Cuse xlink:href=%27%23text%27/%3E%3C/g%3E%3C/svg%3E"},5650:function(t){"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 xmlns:xlink=%27http://www.w3.org/1999/xlink%27 fill-rule=%27evenodd%27 viewBox=%270 0 88 23%27%3E%3Cdefs%3E%3Cpath id=%27logo%27 d=%27M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z%27/%3E%3Cpath id=%27text%27 d=%27M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z%27/%3E%3C/defs%3E%3Cmask id=%27clip%27%3E%3Crect x=%270%27 y=%270%27 width=%27100%25%27 height=%27100%25%27 fill=%27white%27/%3E%3Cuse xlink:href=%27%23logo%27/%3E%3Cuse xlink:href=%27%23text%27/%3E%3C/mask%3E%3Cg id=%27outline%27 opacity=%271%27 stroke=%27%23fff%27 stroke-width=%273%27 fill=%27%23fff%27%3E%3Ccircle mask=%27url%28%23clip%29%27 cx=%2711.5%27 cy=%2711.5%27 r=%279.25%27/%3E%3Cuse xlink:href=%27%23text%27 mask=%27url%28%23clip%29%27/%3E%3C/g%3E%3Cg id=%27fill%27 opacity=%271%27 fill=%27%23000%27%3E%3Cuse xlink:href=%27%23logo%27/%3E%3Cuse xlink:href=%27%23text%27/%3E%3C/g%3E%3C/svg%3E"}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress;function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__webpack_require__),i.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,{a:e}),e},getProto=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},__webpack_require__.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var i=Object.create(null);__webpack_require__.r(i);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&e&&t;"object"==typeof r&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach((function(e){n[e]=function(){return t[e]}}));return n.default=function(){return t},__webpack_require__.d(i,n),i},__webpack_require__.d=function(t,e){for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},__webpack_require__.f={},__webpack_require__.e=function(t){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(e,i){return __webpack_require__.f[i](t,e),e}),[]))},__webpack_require__.u=function(t){return t+".js"},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},inProgress={},__webpack_require__.l=function(t,e,i,n){if(inProgress[t])inProgress[t].push(e);else{var r,s;if(void 0!==i)for(var o=document.getElementsByTagName("script"),a=0;a<o.length;a++){var l=o[a];if(l.getAttribute("src")==t){r=l;break}}r||(s=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,__webpack_require__.nc&&r.setAttribute("nonce",__webpack_require__.nc),r.src=t),inProgress[t]=[e];var c=function(e,i){r.onerror=r.onload=null,clearTimeout(h);var n=inProgress[t];if(delete inProgress[t],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((function(t){return t(i)})),e)return e(i)},h=setTimeout(c.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=c.bind(null,r.onerror),r.onload=c.bind(null,r.onload),s&&document.head.appendChild(r)}},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;__webpack_require__.g.importScripts&&(t=__webpack_require__.g.location+"");var e=__webpack_require__.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&!t;)t=i[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=t}(),function(){__webpack_require__.b=document.baseURI||self.location.href;var t={143:0};__webpack_require__.f.j=function(e,i){var n=__webpack_require__.o(t,e)?t[e]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise((function(i,r){n=t[e]=[i,r]}));i.push(n[2]=r);var s=__webpack_require__.p+__webpack_require__.u(e),o=new Error;__webpack_require__.l(s,(function(i){if(__webpack_require__.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),s=i&&i.target&&i.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+s+")",o.name="ChunkLoadError",o.type=r,o.request=s,n[1](o)}}),"chunk-"+e,e)}};var e=function(e,i){var n,r,s=i[0],o=i[1],a=i[2],l=0;if(s.some((function(e){return 0!==t[e]}))){for(n in o)__webpack_require__.o(o,n)&&(__webpack_require__.m[n]=o[n]);if(a)a(__webpack_require__)}for(e&&e(i);l<s.length;l++)r=s[l],__webpack_require__.o(t,r)&&t[r]&&t[r][0](),t[r]=0},i=self.webpackChunk=self.webpackChunk||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))}();var __webpack_exports__={};!function(){"use strict";var t={};function e(t,e,i,n,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(n,r)}function i(t){return function(){var i=this,n=arguments;return new Promise((function(r,s){var o=t.apply(i,n);function a(t){e(o,r,s,a,l,"next",t)}function l(t){e(o,r,s,a,l,"throw",t)}a(void 0)}))}}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function s(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}__webpack_require__.r(t),__webpack_require__.d(t,{hasBrowserEnv:function(){return sr},hasStandardBrowserEnv:function(){return or},hasStandardBrowserWebWorkerEnv:function(){return lr}});const o=new WeakMap,a=new WeakMap,l=new WeakMap,c=Symbol("anyProducer"),h=Promise.resolve(),u=Symbol("listenerAdded"),d=Symbol("listenerRemoved");let p=!1,f=!1;function m(t){if("string"!=typeof t&&"symbol"!=typeof t&&"number"!=typeof t)throw new TypeError("`eventName` must be a string, symbol, or number")}function g(t){if("function"!=typeof t)throw new TypeError("listener must be a function")}function _(t,e){const i=a.get(t);if(i.has(e))return i.get(e)}function y(t,e){const i="string"==typeof e||"symbol"==typeof e||"number"==typeof e?e:c,n=l.get(t);if(n.has(i))return n.get(i)}function v(t,e){e=Array.isArray(e)?e:[e];let i=!1,n=()=>{},r=[];const s={enqueue(t){r.push(t),n()},finish(){i=!0,n()}};for(const i of e){let e=y(t,i);if(!e){e=new Set;l.get(t).set(i,e)}e.add(s)}return{async next(){return r?0===r.length?i?(r=void 0,this.next()):(await new Promise((t=>{n=t})),this.next()):{done:!1,value:await r.shift()}:{done:!0}},async return(i){r=void 0;for(const i of e){const e=y(t,i);if(e&&(e.delete(s),0===e.size)){l.get(t).delete(i)}}return n(),arguments.length>0?{done:!0,value:await i}:{done:!0}},[Symbol.asyncIterator](){return this}}}function b(t){if(void 0===t)return S;if(!Array.isArray(t))throw new TypeError("`methodNames` must be an array of strings");for(const e of t)if(!S.includes(e)){if("string"!=typeof e)throw new TypeError("`methodNames` element must be a string");throw new Error(`${e} is not Emittery method`)}return t}const x=t=>t===u||t===d;function w(t,e,i){if(x(e))try{p=!0,t.emit(e,i)}finally{p=!1}}class E{static mixin(t,e){return e=b(e),i=>{if("function"!=typeof i)throw new TypeError("`target` must be function");for(const t of e)if(void 0!==i.prototype[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(i.prototype,t,{enumerable:!1,get:function(){return Object.defineProperty(this,t,{enumerable:!1,value:new E}),this[t]}});const n=e=>function(...i){return this[t][e](...i)};for(const t of e)Object.defineProperty(i.prototype,t,{enumerable:!1,value:n(t)});return i}}static get isDebugEnabled(){if("object"!=typeof globalThis.process?.env)return f;const{env:t}=globalThis.process??{env:{}};return"emittery"===t.DEBUG||"*"===t.DEBUG||f}static set isDebugEnabled(t){f=t}constructor(t={}){o.set(this,new Set),a.set(this,new Map),l.set(this,new Map),l.get(this).set(c,new Set),this.debug=t.debug??{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(t,e,i,n)=>{try{n=JSON.stringify(n)}catch{n=`Object with the following keys failed to stringify: ${Object.keys(n).join(",")}`}"symbol"!=typeof i&&"number"!=typeof i||(i=i.toString());const r=new Date,s=`${r.getHours()}:${r.getMinutes()}:${r.getSeconds()}.${r.getMilliseconds()}`;console.log(`[${s}][emittery:${t}][${e}] Event Name: ${i}\n\tdata: ${n}`)})}logIfDebugEnabled(t,e,i){(E.isDebugEnabled||this.debug.enabled)&&this.debug.logger(t,this.debug.name,e,i)}on(t,e){g(e),t=Array.isArray(t)?t:[t];for(const i of t){m(i);let t=_(this,i);if(!t){t=new Set;a.get(this).set(i,t)}t.add(e),this.logIfDebugEnabled("subscribe",i,void 0),x(i)||w(this,u,{eventName:i,listener:e})}return this.off.bind(this,t,e)}off(t,e){g(e),t=Array.isArray(t)?t:[t];for(const i of t){m(i);const t=_(this,i);if(t&&(t.delete(e),0===t.size)){a.get(this).delete(i)}this.logIfDebugEnabled("unsubscribe",i,void 0),x(i)||w(this,d,{eventName:i,listener:e})}}once(t){let e;const i=new Promise((i=>{e=this.on(t,(t=>{e(),i(t)}))}));return i.off=e,i}events(t){t=Array.isArray(t)?t:[t];for(const e of t)m(e);return v(this,t)}async emit(t,e){if(m(t),x(t)&&!p)throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled("emit",t,e),function(t,e,i){const n=l.get(t);if(n.has(e))for(const t of n.get(e))t.enqueue(i);if(n.has(c)){const t=Promise.all([e,i]);for(const e of n.get(c))e.enqueue(t)}}(this,t,e);const i=_(this,t)??new Set,n=o.get(this),r=[...i],s=x(t)?[]:[...n];await h,await Promise.all([...r.map((async t=>{if(i.has(t))return t(e)})),...s.map((async i=>{if(n.has(i))return i(t,e)}))])}async emitSerial(t,e){if(m(t),x(t)&&!p)throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled("emitSerial",t,e);const i=_(this,t)??new Set,n=o.get(this),r=[...i],s=[...n];await h;for(const t of r)i.has(t)&&await t(e);for(const i of s)n.has(i)&&await i(t,e)}onAny(t){return g(t),this.logIfDebugEnabled("subscribeAny",void 0,void 0),o.get(this).add(t),w(this,u,{listener:t}),this.offAny.bind(this,t)}anyEvent(){return v(this)}offAny(t){g(t),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),w(this,d,{listener:t}),o.get(this).delete(t)}clearListeners(t){t=Array.isArray(t)?t:[t];for(const e of t)if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e||"number"==typeof e){const t=_(this,e);t&&t.clear();const i=y(this,e);if(i){for(const t of i)t.finish();i.clear()}}else{o.get(this).clear();for(const[t,e]of a.get(this).entries())e.clear(),a.get(this).delete(t);for(const[t,e]of l.get(this).entries()){for(const t of e)t.finish();e.clear(),l.get(this).delete(t)}}}listenerCount(t){t=Array.isArray(t)?t:[t];let e=0;for(const i of t)if("string"!=typeof i){void 0!==i&&m(i),e+=o.get(this).size;for(const t of a.get(this).values())e+=t.size;for(const t of l.get(this).values())e+=t.size}else e+=o.get(this).size+(_(this,i)?.size??0)+(y(this,i)?.size??0)+(y(this)?.size??0);return e}bindMethods(t,e){if("object"!=typeof t||null===t)throw new TypeError("`target` must be an object");e=b(e);for(const i of e){if(void 0!==t[i])throw new Error(`The property \`${i}\` already exists on \`target\``);Object.defineProperty(t,i,{enumerable:!1,value:this[i].bind(this)})}}}const S=Object.getOwnPropertyNames(E.prototype).filter((t=>"constructor"!==t));Object.defineProperty(E,"listenerAdded",{value:u,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(E,"listenerRemoved",{value:d,writable:!1,enumerable:!0,configurable:!1});var T=767,M=1023;class A{constructor(){s(this,"mobile",!1),s(this,"tablet",!1),s(this,"fromMobile",!1),s(this,"fromTablet",!1),this.update(),window.addEventListener("resize",(()=>{this.update()}))}update(){this.mobile=A.isMediaQuery("(max-width: ".concat(T,"px)")),this.tablet=A.isMediaQuery("(max-width: ".concat(M,"px)")),this.fromMobile=A.isMediaQuery("(min-width: ".concat(T+1,"px)")),this.fromTablet=A.isMediaQuery("(min-width: ".concat(M+1,"px)"))}}s(A,"isMediaQuery",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return window.matchMedia(t).matches}));var C=t=>{dO.plugins.responsive=new A},k=__webpack_require__(4902);function P(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var I,D,O,L,z,R,F,B,N,j,V,U,$,H=function(){return I||"undefined"!=typeof window&&(I=window.gsap)&&I.registerPlugin&&I},q=1,W=[],G=[],Z=[],Y=Date.now,X=function(t,e){return e},K=function(t,e){return~Z.indexOf(t)&&Z[Z.indexOf(t)+1][e]},Q=function(t){return!!~j.indexOf(t)},J=function(t,e,i,n,r){return t.addEventListener(e,i,{passive:!n,capture:!!r})},tt=function(t,e,i,n){return t.removeEventListener(e,i,!!n)},et="scrollLeft",it="scrollTop",nt=function(){return V&&V.isPressed||G.cache++},rt=function(t,e){var i=function i(n){if(n||0===n){q&&(O.history.scrollRestoration="manual");var r=V&&V.isPressed;n=i.v=Math.round(n)||(V&&V.iOS?1:0),t(n),i.cacheID=G.cache,r&&X("ss",n)}else(e||G.cache!==i.cacheID||X("ref"))&&(i.cacheID=G.cache,i.v=t());return i.v+i.offset};return i.offset=0,t&&i},st={s:et,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:rt((function(t){return arguments.length?O.scrollTo(t,ot.sc()):O.pageXOffset||L[et]||z[et]||R[et]||0}))},ot={s:it,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:st,sc:rt((function(t){return arguments.length?O.scrollTo(st.sc(),t):O.pageYOffset||L[it]||z[it]||R[it]||0}))},at=function(t,e){return(e&&e._ctx&&e._ctx.selector||I.utils.toArray)(t)[0]||("string"==typeof t&&!1!==I.config().nullTargetWarn?console.warn("Element not found:",t):null)},lt=function(t,e){var i=e.s,n=e.sc;Q(t)&&(t=L.scrollingElement||z);var r=G.indexOf(t),s=n===ot.sc?1:2;!~r&&(r=G.push(t)-1),G[r+s]||J(t,"scroll",nt);var o=G[r+s],a=o||(G[r+s]=rt(K(t,i),!0)||(Q(t)?n:rt((function(e){return arguments.length?t[i]=e:t[i]}))));return a.target=t,o||(a.smooth="smooth"===I.getProperty(t,"scrollBehavior")),a},ct=function(t,e,i){var n=t,r=t,s=Y(),o=s,a=e||50,l=Math.max(500,3*a),c=function(t,e){var l=Y();e||l-s>a?(r=n,n=t,o=s,s=l):i?n+=t:n=r+(t-r)/(l-o)*(s-o)};return{update:c,reset:function(){r=n=i?0:n,o=s=0},getVelocity:function(t){var e=o,a=r,h=Y();return(t||0===t)&&t!==n&&c(t),s===o||h-o>l?0:(n+(i?a:-a))/((i?h:s)-e)*1e3}}},ht=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},ut=function(t){var e=Math.max.apply(Math,t),i=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(i)?e:i},dt=function(){var t,e,i,n;(N=I.core.globals().ScrollTrigger)&&N.core&&(t=N.core,e=t.bridge||{},i=t._scrollers,n=t._proxies,i.push.apply(i,G),n.push.apply(n,Z),G=i,Z=n,X=function(t,i){return e[t](i)})},pt=function(t){return I=t||H(),!D&&I&&"undefined"!=typeof document&&document.body&&(O=window,L=document,z=L.documentElement,R=L.body,j=[O,L,z,R],I.utils.clamp,$=I.core.context||function(){},B="onpointerenter"in R?"pointer":"mouse",F=ft.isTouch=O.matchMedia&&O.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in O||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,U=ft.eventTypes=("ontouchstart"in z?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in z?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout((function(){return q=0}),500),dt(),D=1),D};st.op=ot,G.cache=0;var ft=function(){function t(t){this.init(t)}var e,i,n;return t.prototype.init=function(t){D||pt(I)||console.warn("Please gsap.registerPlugin(Observer)"),N||dt();var e=t.tolerance,i=t.dragMinimum,n=t.type,r=t.target,s=t.lineHeight,o=t.debounce,a=t.preventDefault,l=t.onStop,c=t.onStopDelay,h=t.ignore,u=t.wheelSpeed,d=t.event,p=t.onDragStart,f=t.onDragEnd,m=t.onDrag,g=t.onPress,_=t.onRelease,y=t.onRight,v=t.onLeft,b=t.onUp,x=t.onDown,w=t.onChangeX,E=t.onChangeY,S=t.onChange,T=t.onToggleX,M=t.onToggleY,A=t.onHover,C=t.onHoverEnd,k=t.onMove,P=t.ignoreCheck,j=t.isNormalizer,H=t.onGestureStart,q=t.onGestureEnd,G=t.onWheel,Z=t.onEnable,X=t.onDisable,K=t.onClick,et=t.scrollSpeed,it=t.capture,rt=t.allowClicks,ft=t.lockAxis,mt=t.onLockAxis;this.target=r=at(r)||z,this.vars=t,h&&(h=I.utils.toArray(h)),e=e||1e-9,i=i||0,u=u||1,et=et||1,n=n||"wheel,touch,pointer",o=!1!==o,s||(s=parseFloat(O.getComputedStyle(R).lineHeight)||22);var gt,_t,yt,vt,bt,xt,wt,Et=this,St=0,Tt=0,Mt=lt(r,st),At=lt(r,ot),Ct=Mt(),kt=At(),Pt=~n.indexOf("touch")&&!~n.indexOf("pointer")&&"pointerdown"===U[0],It=Q(r),Dt=r.ownerDocument||L,Ot=[0,0,0],Lt=[0,0,0],zt=0,Rt=function(){return zt=Y()},Ft=function(t,e){return(Et.event=t)&&h&&~h.indexOf(t.target)||e&&Pt&&"touch"!==t.pointerType||P&&P(t,e)},Bt=function(){var t=Et.deltaX=ut(Ot),i=Et.deltaY=ut(Lt),n=Math.abs(t)>=e,r=Math.abs(i)>=e;S&&(n||r)&&S(Et,t,i,Ot,Lt),n&&(y&&Et.deltaX>0&&y(Et),v&&Et.deltaX<0&&v(Et),w&&w(Et),T&&Et.deltaX<0!=St<0&&T(Et),St=Et.deltaX,Ot[0]=Ot[1]=Ot[2]=0),r&&(x&&Et.deltaY>0&&x(Et),b&&Et.deltaY<0&&b(Et),E&&E(Et),M&&Et.deltaY<0!=Tt<0&&M(Et),Tt=Et.deltaY,Lt[0]=Lt[1]=Lt[2]=0),(vt||yt)&&(k&&k(Et),yt&&(m(Et),yt=!1),vt=!1),xt&&!(xt=!1)&&mt&&mt(Et),bt&&(G(Et),bt=!1),gt=0},Nt=function(t,e,i){Ot[i]+=t,Lt[i]+=e,Et._vx.update(t),Et._vy.update(e),o?gt||(gt=requestAnimationFrame(Bt)):Bt()},jt=function(t,e){ft&&!wt&&(Et.axis=wt=Math.abs(t)>Math.abs(e)?"x":"y",xt=!0),"y"!==wt&&(Ot[2]+=t,Et._vx.update(t,!0)),"x"!==wt&&(Lt[2]+=e,Et._vy.update(e,!0)),o?gt||(gt=requestAnimationFrame(Bt)):Bt()},Vt=function(t){if(!Ft(t,1)){var e=(t=ht(t,a)).clientX,n=t.clientY,r=e-Et.x,s=n-Et.y,o=Et.isDragging;Et.x=e,Et.y=n,(o||Math.abs(Et.startX-e)>=i||Math.abs(Et.startY-n)>=i)&&(m&&(yt=!0),o||(Et.isDragging=!0),jt(r,s),o||p&&p(Et))}},Ut=Et.onPress=function(t){Ft(t,1)||t&&t.button||(Et.axis=wt=null,_t.pause(),Et.isPressed=!0,t=ht(t),St=Tt=0,Et.startX=Et.x=t.clientX,Et.startY=Et.y=t.clientY,Et._vx.reset(),Et._vy.reset(),J(j?r:Dt,U[1],Vt,a,!0),Et.deltaX=Et.deltaY=0,g&&g(Et))},$t=Et.onRelease=function(t){if(!Ft(t,1)){tt(j?r:Dt,U[1],Vt,!0);var e=!isNaN(Et.y-Et.startY),i=Et.isDragging,n=i&&(Math.abs(Et.x-Et.startX)>3||Math.abs(Et.y-Et.startY)>3),s=ht(t);!n&&e&&(Et._vx.reset(),Et._vy.reset(),a&&rt&&I.delayedCall(.08,(function(){if(Y()-zt>300&&!t.defaultPrevented)if(t.target.click)t.target.click();else if(Dt.createEvent){var e=Dt.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,O,1,s.screenX,s.screenY,s.clientX,s.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(e)}}))),Et.isDragging=Et.isGesturing=Et.isPressed=!1,l&&i&&!j&&_t.restart(!0),f&&i&&f(Et),_&&_(Et,n)}},Ht=function(t){return t.touches&&t.touches.length>1&&(Et.isGesturing=!0)&&H(t,Et.isDragging)},qt=function(){return(Et.isGesturing=!1)||q(Et)},Wt=function(t){if(!Ft(t)){var e=Mt(),i=At();Nt((e-Ct)*et,(i-kt)*et,1),Ct=e,kt=i,l&&_t.restart(!0)}},Gt=function(t){if(!Ft(t)){t=ht(t,a),G&&(bt=!0);var e=(1===t.deltaMode?s:2===t.deltaMode?O.innerHeight:1)*u;Nt(t.deltaX*e,t.deltaY*e,0),l&&!j&&_t.restart(!0)}},Zt=function(t){if(!Ft(t)){var e=t.clientX,i=t.clientY,n=e-Et.x,r=i-Et.y;Et.x=e,Et.y=i,vt=!0,l&&_t.restart(!0),(n||r)&&jt(n,r)}},Yt=function(t){Et.event=t,A(Et)},Xt=function(t){Et.event=t,C(Et)},Kt=function(t){return Ft(t)||ht(t,a)&&K(Et)};_t=Et._dc=I.delayedCall(c||.25,(function(){Et._vx.reset(),Et._vy.reset(),_t.pause(),l&&l(Et)})).pause(),Et.deltaX=Et.deltaY=0,Et._vx=ct(0,50,!0),Et._vy=ct(0,50,!0),Et.scrollX=Mt,Et.scrollY=At,Et.isDragging=Et.isGesturing=Et.isPressed=!1,$(this),Et.enable=function(t){return Et.isEnabled||(J(It?Dt:r,"scroll",nt),n.indexOf("scroll")>=0&&J(It?Dt:r,"scroll",Wt,a,it),n.indexOf("wheel")>=0&&J(r,"wheel",Gt,a,it),(n.indexOf("touch")>=0&&F||n.indexOf("pointer")>=0)&&(J(r,U[0],Ut,a,it),J(Dt,U[2],$t),J(Dt,U[3],$t),rt&&J(r,"click",Rt,!1,!0),K&&J(r,"click",Kt),H&&J(Dt,"gesturestart",Ht),q&&J(Dt,"gestureend",qt),A&&J(r,B+"enter",Yt),C&&J(r,B+"leave",Xt),k&&J(r,B+"move",Zt)),Et.isEnabled=!0,t&&t.type&&Ut(t),Z&&Z(Et)),Et},Et.disable=function(){Et.isEnabled&&(W.filter((function(t){return t!==Et&&Q(t.target)})).length||tt(It?Dt:r,"scroll",nt),Et.isPressed&&(Et._vx.reset(),Et._vy.reset(),tt(j?r:Dt,U[1],Vt,!0)),tt(It?Dt:r,"scroll",Wt,it),tt(r,"wheel",Gt,it),tt(r,U[0],Ut,it),tt(Dt,U[2],$t),tt(Dt,U[3],$t),tt(r,"click",Rt,!0),tt(r,"click",Kt),tt(Dt,"gesturestart",Ht),tt(Dt,"gestureend",qt),tt(r,B+"enter",Yt),tt(r,B+"leave",Xt),tt(r,B+"move",Zt),Et.isEnabled=Et.isPressed=Et.isDragging=!1,X&&X(Et))},Et.kill=Et.revert=function(){Et.disable();var t=W.indexOf(Et);t>=0&&W.splice(t,1),V===Et&&(V=0)},W.push(Et),j&&Q(r)&&(V=Et),Et.enable(d)},e=t,(i=[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}])&&P(e.prototype,i),n&&P(e,n),t}();ft.version="3.12.4",ft.create=function(t){return new ft(t)},ft.register=pt,ft.getAll=function(){return W.slice()},ft.getById=function(t){return W.filter((function(e){return e.vars.id===t}))[0]},H()&&I.registerPlugin(ft);var mt,gt,_t,yt,vt,bt,xt,wt,Et,St,Tt,Mt,At,Ct,kt,Pt,It,Dt,Ot,Lt,zt,Rt,Ft,Bt,Nt,jt,Vt,Ut,$t,Ht,qt,Wt,Gt,Zt,Yt,Xt,Kt,Qt,Jt=1,te=Date.now,ee=te(),ie=0,ne=0,re=function(t,e,i){var n=ye(t)&&("clamp("===t.substr(0,6)||t.indexOf("max")>-1);return i["_"+e+"Clamp"]=n,n?t.substr(6,t.length-7):t},se=function(t,e){return!e||ye(t)&&"clamp("===t.substr(0,6)?t:"clamp("+t+")"},oe=function t(){return ne&&requestAnimationFrame(t)},ae=function(){return Ct=1},le=function(){return Ct=0},ce=function(t){return t},he=function(t){return Math.round(1e5*t)/1e5||0},ue=function(){return"undefined"!=typeof window},de=function(){return mt||ue()&&(mt=window.gsap)&&mt.registerPlugin&&mt},pe=function(t){return!!~xt.indexOf(t)},fe=function(t){return("Height"===t?qt:_t["inner"+t])||vt["client"+t]||bt["client"+t]},me=function(t){return K(t,"getBoundingClientRect")||(pe(t)?function(){return Ci.width=_t.innerWidth,Ci.height=qt,Ci}:function(){return Ve(t)})},ge=function(t,e){var i=e.s,n=e.d2,r=e.d,s=e.a;return Math.max(0,(i="scroll"+n)&&(s=K(t,i))?s()-me(t)()[r]:pe(t)?(vt[i]||bt[i])-fe(n):t[i]-t["offset"+n])},_e=function(t,e){for(var i=0;i<Ot.length;i+=3)(!e||~e.indexOf(Ot[i+1]))&&t(Ot[i],Ot[i+1],Ot[i+2])},ye=function(t){return"string"==typeof t},ve=function(t){return"function"==typeof t},be=function(t){return"number"==typeof t},xe=function(t){return"object"==typeof t},we=function(t,e,i){return t&&t.progress(e?0:1)&&i&&t.pause()},Ee=function(t,e){if(t.enabled){var i=t._ctx?t._ctx.add((function(){return e(t)})):e(t);i&&i.totalTime&&(t.callbackAnimation=i)}},Se=Math.abs,Te="left",Me="right",Ae="bottom",Ce="width",ke="height",Pe="Right",Ie="Left",De="Top",Oe="Bottom",Le="padding",ze="margin",Re="Width",Fe="Height",Be="px",Ne=function(t){return _t.getComputedStyle(t)},je=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},Ve=function(t,e){var i=e&&"matrix(1, 0, 0, 1, 0, 0)"!==Ne(t)[kt]&&mt.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),n=t.getBoundingClientRect();return i&&i.progress(0).kill(),n},Ue=function(t,e){var i=e.d2;return t["offset"+i]||t["client"+i]||0},$e=function(t){var e,i=[],n=t.labels,r=t.duration();for(e in n)i.push(n[e]/r);return i},He=function(t){var e=mt.utils.snap(t),i=Array.isArray(t)&&t.slice(0).sort((function(t,e){return t-e}));return i?function(t,n,r){var s;if(void 0===r&&(r=.001),!n)return e(t);if(n>0){for(t-=r,s=0;s<i.length;s++)if(i[s]>=t)return i[s];return i[s-1]}for(s=i.length,t+=r;s--;)if(i[s]<=t)return i[s];return i[0]}:function(i,n,r){void 0===r&&(r=.001);var s=e(i);return!n||Math.abs(s-i)<r||s-i<0==n<0?s:e(n<0?i-t:i+t)}},qe=function(t,e,i,n){return i.split(",").forEach((function(i){return t(e,i,n)}))},We=function(t,e,i,n,r){return t.addEventListener(e,i,{passive:!n,capture:!!r})},Ge=function(t,e,i,n){return t.removeEventListener(e,i,!!n)},Ze=function(t,e,i){(i=i&&i.wheelHandler)&&(t(e,"wheel",i),t(e,"touchmove",i))},Ye={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Xe={toggleActions:"play",anticipatePin:0},Ke={top:0,left:0,center:.5,bottom:1,right:1},Qe=function(t,e){if(ye(t)){var i=t.indexOf("="),n=~i?+(t.charAt(i-1)+1)*parseFloat(t.substr(i+1)):0;~i&&(t.indexOf("%")>i&&(n*=e/100),t=t.substr(0,i-1)),t=n+(t in Ke?Ke[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Je=function(t,e,i,n,r,s,o,a){var l=r.startColor,c=r.endColor,h=r.fontSize,u=r.indent,d=r.fontWeight,p=yt.createElement("div"),f=pe(i)||"fixed"===K(i,"pinType"),m=-1!==t.indexOf("scroller"),g=f?bt:i,_=-1!==t.indexOf("start"),y=_?l:c,v="border-color:"+y+";font-size:"+h+";color:"+y+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return v+="position:"+((m||a)&&f?"fixed;":"absolute;"),(m||a||!f)&&(v+=(n===ot?Me:Ae)+":"+(s+parseFloat(u))+"px;"),o&&(v+="box-sizing:border-box;text-align:left;width:"+o.offsetWidth+"px;"),p._isStart=_,p.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),p.style.cssText=v,p.innerText=e||0===e?t+"-"+e:t,g.children[0]?g.insertBefore(p,g.children[0]):g.appendChild(p),p._offset=p["offset"+n.op.d2],ti(p,0,n,_),p},ti=function(t,e,i,n){var r={display:"block"},s=i[n?"os2":"p2"],o=i[n?"p2":"os2"];t._isFlipped=n,r[i.a+"Percent"]=n?-100:0,r[i.a]=n?"1px":0,r["border"+s+Re]=1,r["border"+o+Re]=0,r[i.p]=e+"px",mt.set(t,r)},ei=[],ii={},ni=function(){return te()-ie>34&&(Yt||(Yt=requestAnimationFrame(xi)))},ri=function(){(!Ft||!Ft.isPressed||Ft.startX>bt.clientWidth)&&(G.cache++,Ft?Yt||(Yt=requestAnimationFrame(xi)):xi(),ie||hi("scrollStart"),ie=te())},si=function(){jt=_t.innerWidth,Nt=_t.innerHeight},oi=function(){G.cache++,!At&&!Rt&&!yt.fullscreenElement&&!yt.webkitFullscreenElement&&(!Bt||jt!==_t.innerWidth||Math.abs(_t.innerHeight-Nt)>.25*_t.innerHeight)&&wt.restart(!0)},ai={},li=[],ci=function t(){return Ge(zi,"scrollEnd",t)||yi(!0)},hi=function(t){return ai[t]&&ai[t].map((function(t){return t()}))||li},ui=[],di=function(t){for(var e=0;e<ui.length;e+=5)(!t||ui[e+4]&&ui[e+4].query===t)&&(ui[e].style.cssText=ui[e+1],ui[e].getBBox&&ui[e].setAttribute("transform",ui[e+2]||""),ui[e+3].uncache=1)},pi=function(t,e){var i;for(Pt=0;Pt<ei.length;Pt++)!(i=ei[Pt])||e&&i._ctx!==e||(t?i.kill(1):i.revert(!0,!0));Wt=!0,e&&di(e),e||hi("revert")},fi=function(t,e){G.cache++,(e||!Xt)&&G.forEach((function(t){return ve(t)&&t.cacheID++&&(t.rec=0)})),ye(t)&&(_t.history.scrollRestoration=$t=t)},mi=0,gi=function(){bt.appendChild(Ht),qt=!Ft&&Ht.offsetHeight||_t.innerHeight,bt.removeChild(Ht)},_i=function(t){return Et(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach((function(e){return e.style.display=t?"none":"block"}))},yi=function(t,e){if(!ie||t||Wt){gi(),Xt=zi.isRefreshing=!0,G.forEach((function(t){return ve(t)&&++t.cacheID&&(t.rec=t())}));var i=hi("refreshInit");Lt&&zi.sort(),e||pi(),G.forEach((function(t){ve(t)&&(t.smooth&&(t.target.style.scrollBehavior="auto"),t(0))})),ei.slice(0).forEach((function(t){return t.refresh()})),Wt=!1,ei.forEach((function(t){if(t._subPinOffset&&t.pin){var e=t.vars.horizontal?"offsetWidth":"offsetHeight",i=t.pin[e];t.revert(!0,1),t.adjustPinSpacing(t.pin[e]-i),t.refresh()}})),Gt=1,_i(!0),ei.forEach((function(t){var e=ge(t.scroller,t._dir),i="max"===t.vars.end||t._endClamp&&t.end>e,n=t._startClamp&&t.start>=e;(i||n)&&t.setPositions(n?e-1:t.start,i?Math.max(n?e:t.start+1,e):t.end,!0)})),_i(!1),Gt=0,i.forEach((function(t){return t&&t.render&&t.render(-1)})),G.forEach((function(t){ve(t)&&(t.smooth&&requestAnimationFrame((function(){return t.target.style.scrollBehavior="smooth"})),t.rec&&t(t.rec))})),fi($t,1),wt.pause(),mi++,Xt=2,xi(2),ei.forEach((function(t){return ve(t.vars.onRefresh)&&t.vars.onRefresh(t)})),Xt=zi.isRefreshing=!1,hi("refresh")}else We(zi,"scrollEnd",ci)},vi=0,bi=1,xi=function(t){if(2===t||!Xt&&!Wt){zi.isUpdating=!0,Qt&&Qt.update(0);var e=ei.length,i=te(),n=i-ee>=50,r=e&&ei[0].scroll();if(bi=vi>r?-1:1,Xt||(vi=r),n&&(ie&&!Ct&&i-ie>200&&(ie=0,hi("scrollEnd")),Tt=ee,ee=i),bi<0){for(Pt=e;Pt-- >0;)ei[Pt]&&ei[Pt].update(0,n);bi=1}else for(Pt=0;Pt<e;Pt++)ei[Pt]&&ei[Pt].update(0,n);zi.isUpdating=!1}Yt=0},wi=[Te,"top",Ae,Me,ze+Oe,ze+Pe,ze+De,ze+Ie,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Ei=wi.concat([Ce,ke,"boxSizing","max"+Re,"max"+Fe,"position",ze,Le,Le+De,Le+Pe,Le+Oe,Le+Ie]),Si=function(t,e,i,n){if(!t._gsap.swappedIn){for(var r,s=wi.length,o=e.style,a=t.style;s--;)o[r=wi[s]]=i[r];o.position="absolute"===i.position?"absolute":"relative","inline"===i.display&&(o.display="inline-block"),a[Ae]=a[Me]="auto",o.flexBasis=i.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[Ce]=Ue(t,st)+Be,o[ke]=Ue(t,ot)+Be,o[Le]=a[ze]=a.top=a[Te]="0",Mi(n),a[Ce]=a["max"+Re]=i[Ce],a[ke]=a["max"+Fe]=i[ke],a[Le]=i[Le],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},Ti=/([A-Z])/g,Mi=function(t){if(t){var e,i,n=t.t.style,r=t.length,s=0;for((t.t._gsap||mt.core.getCache(t.t)).uncache=1;s<r;s+=2)i=t[s+1],e=t[s],i?n[e]=i:n[e]&&n.removeProperty(e.replace(Ti,"-$1").toLowerCase())}},Ai=function(t){for(var e=Ei.length,i=t.style,n=[],r=0;r<e;r++)n.push(Ei[r],i[Ei[r]]);return n.t=t,n},Ci={left:0,top:0},ki=function(t,e,i,n,r,s,o,a,l,c,h,u,d,p){ve(t)&&(t=t(a)),ye(t)&&"max"===t.substr(0,3)&&(t=u+("="===t.charAt(4)?Qe("0"+t.substr(3),i):0));var f,m,g,_=d?d.time():0;if(d&&d.seek(0),isNaN(t)||(t=+t),be(t))d&&(t=mt.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,u,t)),o&&ti(o,i,n,!0);else{ve(e)&&(e=e(a));var y,v,b,x,w=(t||"0").split(" ");g=at(e,a)||bt,(y=Ve(g)||{})&&(y.left||y.top)||"none"!==Ne(g).display||(x=g.style.display,g.style.display="block",y=Ve(g),x?g.style.display=x:g.style.removeProperty("display")),v=Qe(w[0],y[n.d]),b=Qe(w[1]||"0",i),t=y[n.p]-l[n.p]-c+v+r-b,o&&ti(o,b,n,i-b<20||o._isStart&&b>20),i-=i-b}if(p&&(a[p]=t||-.001,t<0&&(t=0)),s){var E=t+i,S=s._isStart;f="scroll"+n.d2,ti(s,E,n,S&&E>20||!S&&(h?Math.max(bt[f],vt[f]):s.parentNode[f])<=E+1),h&&(l=Ve(o),h&&(s.style[n.op.p]=l[n.op.p]-n.op.m-s._offset+Be))}return d&&g&&(f=Ve(g),d.seek(u),m=Ve(g),d._caScrollDist=f[n.p]-m[n.p],t=t/d._caScrollDist*u),d&&d.seek(_),d?t:Math.round(t)},Pi=/(webkit|moz|length|cssText|inset)/i,Ii=function(t,e,i,n){if(t.parentNode!==e){var r,s,o=t.style;if(e===bt){for(r in t._stOrig=o.cssText,s=Ne(t))+r||Pi.test(r)||!s[r]||"string"!=typeof o[r]||"0"===r||(o[r]=s[r]);o.top=i,o.left=n}else o.cssText=t._stOrig;mt.core.getCache(t).uncache=1,e.appendChild(t)}},Di=function(t,e,i){var n=e,r=n;return function(e){var s=Math.round(t());return s!==n&&s!==r&&Math.abs(s-n)>3&&Math.abs(s-r)>3&&(e=s,i&&i()),r=n,n=e,e}},Oi=function(t,e,i){var n={};n[e.p]="+="+i,mt.set(t,n)},Li=function(t,e){var i=lt(t,e),n="_scroll"+e.p2,r=function e(r,s,o,a,l){var c=e.tween,h=s.onComplete,u={};o=o||i();var d=Di(i,o,(function(){c.kill(),e.tween=0}));return l=a&&l||0,a=a||r-o,c&&c.kill(),s[n]=r,s.modifiers=u,u[n]=function(){return d(o+a*c.ratio+l*c.ratio*c.ratio)},s.onUpdate=function(){G.cache++,e.tween&&xi()},s.onComplete=function(){e.tween=0,h&&h.call(c)},c=e.tween=mt.to(t,s)};return t[n]=i,i.wheelHandler=function(){return r.tween&&r.tween.kill()&&(r.tween=0)},We(t,"wheel",i.wheelHandler),zi.isTouch&&We(t,"touchmove",i.wheelHandler),r},zi=function(){function t(e,i){gt||t.register(mt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),Ut(this),this.init(e,i)}return t.prototype.init=function(e,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),ne){var n,r,s,o,a,l,c,h,u,d,p,f,m,g,_,y,v,b,x,w,E,S,T,M,A,C,k,P,I,D,O,L,z,R,F,B,N,j,V,U,$,H,q=e=je(ye(e)||be(e)||e.nodeType?{trigger:e}:e,Xe),W=q.onUpdate,Y=q.toggleClass,X=q.id,Q=q.onToggle,J=q.onRefresh,tt=q.scrub,et=q.trigger,it=q.pin,nt=q.pinSpacing,rt=q.invalidateOnRefresh,ct=q.anticipatePin,ht=q.onScrubComplete,ut=q.onSnapComplete,dt=q.once,pt=q.snap,ft=q.pinReparent,gt=q.pinSpacer,xt=q.containerAnimation,wt=q.fastScrollEnd,Mt=q.preventOverlaps,kt=e.horizontal||e.containerAnimation&&!1!==e.horizontal?st:ot,It=!tt&&0!==tt,Dt=at(e.scroller||_t),Ot=mt.core.getCache(Dt),Rt=pe(Dt),Ft="fixed"===("pinType"in e?e.pinType:K(Dt,"pinType")||Rt&&"fixed"),Bt=[e.onEnter,e.onLeave,e.onEnterBack,e.onLeaveBack],Nt=It&&e.toggleActions.split(" "),jt="markers"in e?e.markers:Xe.markers,Vt=Rt?0:parseFloat(Ne(Dt)["border"+kt.p2+Re])||0,Ut=this,$t=e.onRefreshInit&&function(){return e.onRefreshInit(Ut)},Ht=function(t,e,i){var n=i.d,r=i.d2,s=i.a;return(s=K(t,"getBoundingClientRect"))?function(){return s()[n]}:function(){return(e?fe(r):t["client"+r])||0}}(Dt,Rt,kt),qt=function(t,e){return!e||~Z.indexOf(t)?me(t):function(){return Ci}}(Dt,Rt),Wt=0,Yt=0,ee=0,oe=lt(Dt,kt);if(Ut._startClamp=Ut._endClamp=!1,Ut._dir=kt,ct*=45,Ut.scroller=Dt,Ut.scroll=xt?xt.time.bind(xt):oe,o=oe(),Ut.vars=e,i=i||e.animation,"refreshPriority"in e&&(Lt=1,-9999===e.refreshPriority&&(Qt=Ut)),Ot.tweenScroll=Ot.tweenScroll||{top:Li(Dt,ot),left:Li(Dt,st)},Ut.tweenTo=n=Ot.tweenScroll[kt.p],Ut.scrubDuration=function(t){(z=be(t)&&t)?L?L.duration(t):L=mt.to(i,{ease:"expo",totalProgress:"+=0",duration:z,paused:!0,onComplete:function(){return ht&&ht(Ut)}}):(L&&L.progress(1).kill(),L=0)},i&&(i.vars.lazy=!1,i._initted&&!Ut.isReverted||!1!==i.vars.immediateRender&&!1!==e.immediateRender&&i.duration()&&i.render(0,!0,!0),Ut.animation=i.pause(),i.scrollTrigger=Ut,Ut.scrubDuration(tt),D=0,X||(X=i.vars.id)),pt&&(xe(pt)&&!pt.push||(pt={snapTo:pt}),"scrollBehavior"in bt.style&&mt.set(Rt?[bt,vt]:Dt,{scrollBehavior:"auto"}),G.forEach((function(t){return ve(t)&&t.target===(Rt?yt.scrollingElement||vt:Dt)&&(t.smooth=!1)})),s=ve(pt.snapTo)?pt.snapTo:"labels"===pt.snapTo?function(t){return function(e){return mt.utils.snap($e(t),e)}}(i):"labelsDirectional"===pt.snapTo?(U=i,function(t,e){return He($e(U))(t,e.direction)}):!1!==pt.directional?function(t,e){return He(pt.snapTo)(t,te()-Yt<500?0:e.direction)}:mt.utils.snap(pt.snapTo),R=pt.duration||{min:.1,max:2},R=xe(R)?St(R.min,R.max):St(R,R),F=mt.delayedCall(pt.delay||z/2||.1,(function(){var t=oe(),e=te()-Yt<500,r=n.tween;if(!(e||Math.abs(Ut.getVelocity())<10)||r||Ct||Wt===t)Ut.isActive&&Wt!==t&&F.restart(!0);else{var o=(t-l)/g,a=i&&!It?i.totalProgress():o,h=e?0:(a-O)/(te()-Tt)*1e3||0,u=mt.utils.clamp(-o,1-o,Se(h/2)*h/.185),d=o+(!1===pt.inertia?0:u),p=St(0,1,s(d,Ut)),f=Math.round(l+p*g),m=pt,_=m.onStart,y=m.onInterrupt,v=m.onComplete;if(t<=c&&t>=l&&f!==t){if(r&&!r._initted&&r.data<=Se(f-t))return;!1===pt.inertia&&(u=p-o),n(f,{duration:R(Se(.185*Math.max(Se(d-a),Se(p-a))/h/.05||0)),ease:pt.ease||"power3",data:Se(f-t),onInterrupt:function(){return F.restart(!0)&&y&&y(Ut)},onComplete:function(){Ut.update(),Wt=oe(),L&&i&&i.progress(p),D=O=i&&!It?i.totalProgress():Ut.progress,ut&&ut(Ut),v&&v(Ut)}},t,u*g,f-t-u*g),_&&_(Ut,n.tween)}}})).pause()),X&&(ii[X]=Ut),(V=(et=Ut.trigger=at(et||!0!==it&&it))&&et._gsap&&et._gsap.stRevert)&&(V=V(Ut)),it=!0===it?et:at(it),ye(Y)&&(Y={targets:et,className:Y}),it&&(!1===nt||nt===ze||(nt=!(!nt&&it.parentNode&&it.parentNode.style&&"flex"===Ne(it.parentNode).display)&&Le),Ut.pin=it,(r=mt.core.getCache(it)).spacer?_=r.pinState:(gt&&((gt=at(gt))&&!gt.nodeType&&(gt=gt.current||gt.nativeElement),r.spacerIsNative=!!gt,gt&&(r.spacerState=Ai(gt))),r.spacer=b=gt||yt.createElement("div"),b.classList.add("pin-spacer"),X&&b.classList.add("pin-spacer-"+X),r.pinState=_=Ai(it)),!1!==e.force3D&&mt.set(it,{force3D:!0}),Ut.spacer=b=r.spacer,I=Ne(it),M=I[nt+kt.os2],w=mt.getProperty(it),E=mt.quickSetter(it,kt.a,Be),Si(it,b,I),v=Ai(it)),jt){f=xe(jt)?je(jt,Ye):Ye,d=Je("scroller-start",X,Dt,kt,f,0),p=Je("scroller-end",X,Dt,kt,f,0,d),x=d["offset"+kt.op.d2];var ae=at(K(Dt,"content")||Dt);h=this.markerStart=Je("start",X,ae,kt,f,x,0,xt),u=this.markerEnd=Je("end",X,ae,kt,f,x,0,xt),xt&&(j=mt.quickSetter([h,u],kt.a,Be)),Ft||Z.length&&!0===K(Dt,"fixedMarkers")||(H=Ne($=Rt?bt:Dt).position,$.style.position="absolute"===H||"fixed"===H?H:"relative",mt.set([d,p],{force3D:!0}),C=mt.quickSetter(d,kt.a,Be),P=mt.quickSetter(p,kt.a,Be))}if(xt){var le=xt.vars.onUpdate,ue=xt.vars.onUpdateParams;xt.eventCallback("onUpdate",(function(){Ut.update(0,0,1),le&&le.apply(xt,ue||[])}))}if(Ut.previous=function(){return ei[ei.indexOf(Ut)-1]},Ut.next=function(){return ei[ei.indexOf(Ut)+1]},Ut.revert=function(t,e){if(!e)return Ut.kill(!0);var n=!1!==t||!Ut.enabled,r=At;n!==Ut.isReverted&&(n&&(B=Math.max(oe(),Ut.scroll.rec||0),ee=Ut.progress,N=i&&i.progress()),h&&[h,u,d,p].forEach((function(t){return t.style.display=n?"none":"block"})),n&&(At=Ut,Ut.update(n)),!it||ft&&Ut.isActive||(n?function(t,e,i){Mi(i);var n=t._gsap;if(n.spacerIsNative)Mi(n.spacerState);else if(t._gsap.swappedIn){var r=e.parentNode;r&&(r.insertBefore(t,e),r.removeChild(e))}t._gsap.swappedIn=!1}(it,b,_):Si(it,b,Ne(it),A)),n||Ut.update(n),At=r,Ut.isReverted=n)},Ut.refresh=function(r,s,f,x){if(!At&&Ut.enabled||s)if(it&&r&&ie)We(t,"scrollEnd",ci);else{!Xt&&$t&&$t(Ut),At=Ut,n.tween&&!f&&(n.tween.kill(),n.tween=0),L&&L.pause(),rt&&i&&i.revert({kill:!1}).invalidate(),Ut.isReverted||Ut.revert(!0,!0),Ut._subPinOffset=!1;var E,M,C,P,I,D,O,z,R,j,V,U,$,H=Ht(),q=qt(),W=xt?xt.duration():ge(Dt,kt),G=g<=.01,Z=0,Y=x||0,X=xe(f)?f.end:e.end,K=e.endTrigger||et,Q=xe(f)?f.start:e.start||(0!==e.start&&et?it?"0 0":"0 100%":0),tt=Ut.pinnedContainer=e.pinnedContainer&&at(e.pinnedContainer,Ut),ct=et&&Math.max(0,ei.indexOf(Ut))||0,ht=ct;for(jt&&xe(f)&&(U=mt.getProperty(d,kt.p),$=mt.getProperty(p,kt.p));ht--;)(D=ei[ht]).end||D.refresh(0,1)||(At=Ut),!(O=D.pin)||O!==et&&O!==it&&O!==tt||D.isReverted||(j||(j=[]),j.unshift(D),D.revert(!0,!0)),D!==ei[ht]&&(ct--,ht--);for(ve(Q)&&(Q=Q(Ut)),Q=re(Q,"start",Ut),l=ki(Q,et,H,kt,oe(),h,d,Ut,q,Vt,Ft,W,xt,Ut._startClamp&&"_startClamp")||(it?-.001:0),ve(X)&&(X=X(Ut)),ye(X)&&!X.indexOf("+=")&&(~X.indexOf(" ")?X=(ye(Q)?Q.split(" ")[0]:"")+X:(Z=Qe(X.substr(2),H),X=ye(Q)?Q:(xt?mt.utils.mapRange(0,xt.duration(),xt.scrollTrigger.start,xt.scrollTrigger.end,l):l)+Z,K=et)),X=re(X,"end",Ut),c=Math.max(l,ki(X||(K?"100% 0":W),K,H,kt,oe()+Z,u,p,Ut,q,Vt,Ft,W,xt,Ut._endClamp&&"_endClamp"))||-.001,Z=0,ht=ct;ht--;)(O=(D=ei[ht]).pin)&&D.start-D._pinPush<=l&&!xt&&D.end>0&&(E=D.end-(Ut._startClamp?Math.max(0,D.start):D.start),(O===et&&D.start-D._pinPush<l||O===tt)&&isNaN(Q)&&(Z+=E*(1-D.progress)),O===it&&(Y+=E));if(l+=Z,c+=Z,Ut._startClamp&&(Ut._startClamp+=Z),Ut._endClamp&&!Xt&&(Ut._endClamp=c||-.001,c=Math.min(c,ge(Dt,kt))),g=c-l||(l-=.01)&&.001,G&&(ee=mt.utils.clamp(0,1,mt.utils.normalize(l,c,B))),Ut._pinPush=Y,h&&Z&&((E={})[kt.a]="+="+Z,tt&&(E[kt.p]="-="+oe()),mt.set([h,u],E)),!it||Gt&&Ut.end>=ge(Dt,kt)){if(et&&oe()&&!xt)for(M=et.parentNode;M&&M!==bt;)M._pinOffset&&(l-=M._pinOffset,c-=M._pinOffset),M=M.parentNode}else E=Ne(it),P=kt===ot,C=oe(),S=parseFloat(w(kt.a))+Y,!W&&c>1&&(V={style:V=(Rt?yt.scrollingElement||vt:Dt).style,value:V["overflow"+kt.a.toUpperCase()]},Rt&&"scroll"!==Ne(bt)["overflow"+kt.a.toUpperCase()]&&(V.style["overflow"+kt.a.toUpperCase()]="scroll")),Si(it,b,E),v=Ai(it),M=Ve(it,!0),z=Ft&<(Dt,P?st:ot)(),nt&&((A=[nt+kt.os2,g+Y+Be]).t=b,(ht=nt===Le?Ue(it,kt)+g+Y:0)&&(A.push(kt.d,ht+Be),"auto"!==b.style.flexBasis&&(b.style.flexBasis=ht+Be)),Mi(A),tt&&ei.forEach((function(t){t.pin===tt&&!1!==t.vars.pinSpacing&&(t._subPinOffset=!0)})),Ft&&oe(B)),Ft&&((I={top:M.top+(P?C-l:z)+Be,left:M.left+(P?z:C-l)+Be,boxSizing:"border-box",position:"fixed"})[Ce]=I["max"+Re]=Math.ceil(M.width)+Be,I[ke]=I["max"+Fe]=Math.ceil(M.height)+Be,I[ze]=I[ze+De]=I[ze+Pe]=I[ze+Oe]=I[ze+Ie]="0",I[Le]=E[Le],I[Le+De]=E[Le+De],I[Le+Pe]=E[Le+Pe],I[Le+Oe]=E[Le+Oe],I[Le+Ie]=E[Le+Ie],y=function(t,e,i){for(var n,r=[],s=t.length,o=i?8:0;o<s;o+=2)n=t[o],r.push(n,n in e?e[n]:t[o+1]);return r.t=t.t,r}(_,I,ft),Xt&&oe(0)),i?(R=i._initted,zt(1),i.render(i.duration(),!0,!0),T=w(kt.a)-S+g+Y,k=Math.abs(g-T)>1,Ft&&k&&y.splice(y.length-2,2),i.render(0,!0,!0),R||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),zt(0)):T=g,V&&(V.value?V.style["overflow"+kt.a.toUpperCase()]=V.value:V.style.removeProperty("overflow-"+kt.a));j&&j.forEach((function(t){return t.revert(!1,!0)})),Ut.start=l,Ut.end=c,o=a=Xt?B:oe(),xt||Xt||(o<B&&oe(B),Ut.scroll.rec=0),Ut.revert(!1,!0),Yt=te(),F&&(Wt=-1,F.restart(!0)),At=0,i&&It&&(i._initted||N)&&i.progress()!==N&&i.progress(N||0,!0).render(i.time(),!0,!0),(G||ee!==Ut.progress||xt)&&(i&&!It&&i.totalProgress(xt&&l<-.001&&!ee?mt.utils.normalize(l,c,0):ee,!0),Ut.progress=G||(o-l)/g===ee?0:ee),it&&nt&&(b._pinOffset=Math.round(Ut.progress*T)),L&&L.invalidate(),isNaN(U)||(U-=mt.getProperty(d,kt.p),$-=mt.getProperty(p,kt.p),Oi(d,kt,U),Oi(h,kt,U-(x||0)),Oi(p,kt,$),Oi(u,kt,$-(x||0))),G&&!Xt&&Ut.update(),!J||Xt||m||(m=!0,J(Ut),m=!1)}},Ut.getVelocity=function(){return(oe()-a)/(te()-Tt)*1e3||0},Ut.endAnimation=function(){we(Ut.callbackAnimation),i&&(L?L.progress(1):i.paused()?It||we(i,Ut.direction<0,1):we(i,i.reversed()))},Ut.labelToScroll=function(t){return i&&i.labels&&(l||Ut.refresh()||l)+i.labels[t]/i.duration()*g||0},Ut.getTrailing=function(t){var e=ei.indexOf(Ut),i=Ut.direction>0?ei.slice(0,e).reverse():ei.slice(e+1);return(ye(t)?i.filter((function(e){return e.vars.preventOverlaps===t})):i).filter((function(t){return Ut.direction>0?t.end<=l:t.start>=c}))},Ut.update=function(t,e,r){if(!xt||r||t){var s,h,u,p,f,m,_,x=!0===Xt?B:Ut.scroll(),w=t?0:(x-l)/g,A=w<0?0:w>1?1:w||0,I=Ut.progress;if(e&&(a=o,o=xt?oe():x,pt&&(O=D,D=i&&!It?i.totalProgress():A)),ct&&!A&&it&&!At&&!Jt&&ie&&l<x+(x-a)/(te()-Tt)*ct&&(A=1e-4),A!==I&&Ut.enabled){if(p=(f=(s=Ut.isActive=!!A&&A<1)!==(!!I&&I<1))||!!A!=!!I,Ut.direction=A>I?1:-1,Ut.progress=A,p&&!At&&(h=A&&!I?0:1===A?1:1===I?2:3,It&&(u=!f&&"none"!==Nt[h+1]&&Nt[h+1]||Nt[h],_=i&&("complete"===u||"reset"===u||u in i))),Mt&&(f||_)&&(_||tt||!i)&&(ve(Mt)?Mt(Ut):Ut.getTrailing(Mt).forEach((function(t){return t.endAnimation()}))),It||(!L||At||Jt?i&&i.totalProgress(A,!(!At||!Yt&&!t)):(L._dp._time-L._start!==L._time&&L.render(L._dp._time-L._start),L.resetTo?L.resetTo("totalProgress",A,i._tTime/i._tDur):(L.vars.totalProgress=A,L.invalidate().restart()))),it)if(t&&nt&&(b.style[nt+kt.os2]=M),Ft){if(p){if(m=!t&&A>I&&c+1>x&&x+1>=ge(Dt,kt),ft)if(t||!s&&!m)Ii(it,b);else{var z=Ve(it,!0),R=x-l;Ii(it,bt,z.top+(kt===ot?R:0)+Be,z.left+(kt===ot?0:R)+Be)}Mi(s||m?y:v),k&&A<1&&s||E(S+(1!==A||m?0:T))}}else E(he(S+T*A));pt&&!n.tween&&!At&&!Jt&&F.restart(!0),Y&&(f||dt&&A&&(A<1||!Zt))&&Et(Y.targets).forEach((function(t){return t.classList[s||dt?"add":"remove"](Y.className)})),W&&!It&&!t&&W(Ut),p&&!At?(It&&(_&&("complete"===u?i.pause().totalProgress(1):"reset"===u?i.restart(!0).pause():"restart"===u?i.restart(!0):i[u]()),W&&W(Ut)),!f&&Zt||(Q&&f&&Ee(Ut,Q),Bt[h]&&Ee(Ut,Bt[h]),dt&&(1===A?Ut.kill(!1,1):Bt[h]=0),f||Bt[h=1===A?1:3]&&Ee(Ut,Bt[h])),wt&&!s&&Math.abs(Ut.getVelocity())>(be(wt)?wt:2500)&&(we(Ut.callbackAnimation),L?L.progress(1):we(i,"reverse"===u?1:!A,1))):It&&W&&!At&&W(Ut)}if(P){var N=xt?x/xt.duration()*(xt._caScrollDist||0):x;C(N+(d._isFlipped?1:0)),P(N)}j&&j(-x/xt.duration()*(xt._caScrollDist||0))}},Ut.enable=function(e,i){Ut.enabled||(Ut.enabled=!0,We(Dt,"resize",oi),Rt||We(Dt,"scroll",ri),$t&&We(t,"refreshInit",$t),!1!==e&&(Ut.progress=ee=0,o=a=Wt=oe()),!1!==i&&Ut.refresh())},Ut.getTween=function(t){return t&&n?n.tween:L},Ut.setPositions=function(t,e,i,n){if(xt){var r=xt.scrollTrigger,s=xt.duration(),o=r.end-r.start;t=r.start+o*t/s,e=r.start+o*e/s}Ut.refresh(!1,!1,{start:se(t,i&&!!Ut._startClamp),end:se(e,i&&!!Ut._endClamp)},n),Ut.update()},Ut.adjustPinSpacing=function(t){if(A&&t){var e=A.indexOf(kt.d)+1;A[e]=parseFloat(A[e])+t+Be,A[1]=parseFloat(A[1])+t+Be,Mi(A)}},Ut.disable=function(e,i){if(Ut.enabled&&(!1!==e&&Ut.revert(!0,!0),Ut.enabled=Ut.isActive=!1,i||L&&L.pause(),B=0,r&&(r.uncache=1),$t&&Ge(t,"refreshInit",$t),F&&(F.pause(),n.tween&&n.tween.kill()&&(n.tween=0)),!Rt)){for(var s=ei.length;s--;)if(ei[s].scroller===Dt&&ei[s]!==Ut)return;Ge(Dt,"resize",oi),Rt||Ge(Dt,"scroll",ri)}},Ut.kill=function(t,n){Ut.disable(t,n),L&&!n&&L.kill(),X&&delete ii[X];var s=ei.indexOf(Ut);s>=0&&ei.splice(s,1),s===Pt&&bi>0&&Pt--,s=0,ei.forEach((function(t){return t.scroller===Ut.scroller&&(s=1)})),s||Xt||(Ut.scroll.rec=0),i&&(i.scrollTrigger=null,t&&i.revert({kill:!1}),n||i.kill()),h&&[h,u,d,p].forEach((function(t){return t.parentNode&&t.parentNode.removeChild(t)})),Qt===Ut&&(Qt=0),it&&(r&&(r.uncache=1),s=0,ei.forEach((function(t){return t.pin===it&&s++})),s||(r.spacer=0)),e.onKill&&e.onKill(Ut)},ei.push(Ut),Ut.enable(!1,!1),V&&V(Ut),i&&i.add&&!g){var de=Ut.update;Ut.update=function(){Ut.update=de,l||c||Ut.refresh()},mt.delayedCall(.01,Ut.update),g=.01,l=c=0}else Ut.refresh();it&&function(){if(Kt!==mi){var t=Kt=mi;requestAnimationFrame((function(){return t===mi&&yi(!0)}))}}()}else this.update=this.refresh=this.kill=ce},t.register=function(e){return gt||(mt=e||de(),ue()&&window.document&&t.enable(),gt=ne),gt},t.defaults=function(t){if(t)for(var e in t)Xe[e]=t[e];return Xe},t.disable=function(t,e){ne=0,ei.forEach((function(i){return i[e?"kill":"disable"](t)})),Ge(_t,"wheel",ri),Ge(yt,"scroll",ri),clearInterval(Mt),Ge(yt,"touchcancel",ce),Ge(bt,"touchstart",ce),qe(Ge,yt,"pointerdown,touchstart,mousedown",ae),qe(Ge,yt,"pointerup,touchend,mouseup",le),wt.kill(),_e(Ge);for(var i=0;i<G.length;i+=3)Ze(Ge,G[i],G[i+1]),Ze(Ge,G[i],G[i+2])},t.enable=function(){if(_t=window,yt=document,vt=yt.documentElement,bt=yt.body,mt&&(Et=mt.utils.toArray,St=mt.utils.clamp,Ut=mt.core.context||ce,zt=mt.core.suppressOverwrites||ce,$t=_t.history.scrollRestoration||"auto",vi=_t.pageYOffset,mt.core.globals("ScrollTrigger",t),bt)){ne=1,(Ht=document.createElement("div")).style.height="100vh",Ht.style.position="absolute",gi(),oe(),ft.register(mt),t.isTouch=ft.isTouch,Vt=ft.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),We(_t,"wheel",ri),xt=[_t,yt,vt,bt],mt.matchMedia?(t.matchMedia=function(t){var e,i=mt.matchMedia();for(e in t)i.add(e,t[e]);return i},mt.addEventListener("matchMediaInit",(function(){return pi()})),mt.addEventListener("matchMediaRevert",(function(){return di()})),mt.addEventListener("matchMedia",(function(){yi(0,1),hi("matchMedia")})),mt.matchMedia("(orientation: portrait)",(function(){return si(),si}))):console.warn("Requires GSAP 3.11.0 or later"),si(),We(yt,"scroll",ri);var e,i,n=bt.style,r=n.borderTopStyle,s=mt.core.Animation.prototype;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",e=Ve(bt),ot.m=Math.round(e.top+ot.sc())||0,st.m=Math.round(e.left+st.sc())||0,r?n.borderTopStyle=r:n.removeProperty("border-top-style"),Mt=setInterval(ni,250),mt.delayedCall(.5,(function(){return Jt=0})),We(yt,"touchcancel",ce),We(bt,"touchstart",ce),qe(We,yt,"pointerdown,touchstart,mousedown",ae),qe(We,yt,"pointerup,touchend,mouseup",le),kt=mt.utils.checkPrefix("transform"),Ei.push(kt),gt=te(),wt=mt.delayedCall(.2,yi).pause(),Ot=[yt,"visibilitychange",function(){var t=_t.innerWidth,e=_t.innerHeight;yt.hidden?(It=t,Dt=e):It===t&&Dt===e||oi()},yt,"DOMContentLoaded",yi,_t,"load",yi,_t,"resize",oi],_e(We),ei.forEach((function(t){return t.enable(0,1)})),i=0;i<G.length;i+=3)Ze(Ge,G[i],G[i+1]),Ze(Ge,G[i],G[i+2])}},t.config=function(e){"limitCallbacks"in e&&(Zt=!!e.limitCallbacks);var i=e.syncInterval;i&&clearInterval(Mt)||(Mt=i)&&setInterval(ni,i),"ignoreMobileResize"in e&&(Bt=1===t.isTouch&&e.ignoreMobileResize),"autoRefreshEvents"in e&&(_e(Ge)||_e(We,e.autoRefreshEvents||"none"),Rt=-1===(e.autoRefreshEvents+"").indexOf("resize"))},t.scrollerProxy=function(t,e){var i=at(t),n=G.indexOf(i),r=pe(i);~n&&G.splice(n,r?6:2),e&&(r?Z.unshift(_t,e,bt,e,vt,e):Z.unshift(i,e))},t.clearMatchMedia=function(t){ei.forEach((function(e){return e._ctx&&e._ctx.query===t&&e._ctx.kill(!0,!0)}))},t.isInViewport=function(t,e,i){var n=(ye(t)?at(t):t).getBoundingClientRect(),r=n[i?Ce:ke]*e||0;return i?n.right-r>0&&n.left+r<_t.innerWidth:n.bottom-r>0&&n.top+r<_t.innerHeight},t.positionInViewport=function(t,e,i){ye(t)&&(t=at(t));var n=t.getBoundingClientRect(),r=n[i?Ce:ke],s=null==e?r/2:e in Ke?Ke[e]*r:~e.indexOf("%")?parseFloat(e)*r/100:parseFloat(e)||0;return i?(n.left+s)/_t.innerWidth:(n.top+s)/_t.innerHeight},t.killAll=function(t){if(ei.slice(0).forEach((function(t){return"ScrollSmoother"!==t.vars.id&&t.kill()})),!0!==t){var e=ai.killAll||[];ai={},e.forEach((function(t){return t()}))}},t}();zi.version="3.12.4",zi.saveStyles=function(t){return t?Et(t).forEach((function(t){if(t&&t.style){var e=ui.indexOf(t);e>=0&&ui.splice(e,5),ui.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),mt.core.getCache(t),Ut())}})):ui},zi.revert=function(t,e){return pi(!t,e)},zi.create=function(t,e){return new zi(t,e)},zi.refresh=function(t){return t?oi():(gt||zi.register())&&yi(!0)},zi.update=function(t){return++G.cache&&xi(!0===t?2:0)},zi.clearScrollMemory=fi,zi.maxScroll=function(t,e){return ge(t,e?st:ot)},zi.getScrollFunc=function(t,e){return lt(at(t),e?st:ot)},zi.getById=function(t){return ii[t]},zi.getAll=function(){return ei.filter((function(t){return"ScrollSmoother"!==t.vars.id}))},zi.isScrolling=function(){return!!ie},zi.snapDirectional=He,zi.addEventListener=function(t,e){var i=ai[t]||(ai[t]=[]);~i.indexOf(e)||i.push(e)},zi.removeEventListener=function(t,e){var i=ai[t],n=i&&i.indexOf(e);n>=0&&i.splice(n,1)},zi.batch=function(t,e){var i,n=[],r={},s=e.interval||.016,o=e.batchMax||1e9,a=function(t,e){var i=[],n=[],r=mt.delayedCall(s,(function(){e(i,n),i=[],n=[]})).pause();return function(t){i.length||r.restart(!0),i.push(t.trigger),n.push(t),o<=i.length&&r.progress(1)}};for(i in e)r[i]="on"===i.substr(0,2)&&ve(e[i])&&"onRefreshInit"!==i?a(0,e[i]):e[i];return ve(o)&&(o=o(),We(zi,"refresh",(function(){return o=e.batchMax()}))),Et(t).forEach((function(t){var e={};for(i in r)e[i]=r[i];e.trigger=t,n.push(zi.create(e))})),n};var Ri,Fi=function(t,e,i,n){return e>n?t(n):e<0&&t(0),i>n?(n-e)/(i-e):i<0?e/(e-i):1},Bi=function t(e,i){!0===i?e.style.removeProperty("touch-action"):e.style.touchAction=!0===i?"auto":i?"pan-"+i+(ft.isTouch?" pinch-zoom":""):"none",e===vt&&t(bt,i)},Ni={auto:1,scroll:1},ji=function(t){var e,i=t.event,n=t.target,r=t.axis,s=(i.changedTouches?i.changedTouches[0]:i).target,o=s._gsap||mt.core.getCache(s),a=te();if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==bt&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!Ni[(e=Ne(s)).overflowY]&&!Ni[e.overflowX]);)s=s.parentNode;o._isScroll=s&&s!==n&&!pe(s)&&(Ni[(e=Ne(s)).overflowY]||Ni[e.overflowX]),o._isScrollT=a}(o._isScroll||"x"===r)&&(i.stopPropagation(),i._gsapAllow=!0)},Vi=function(t,e,i,n){return ft.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:n=n&&ji,onPress:n,onDrag:n,onScroll:n,onEnable:function(){return i&&We(yt,ft.eventTypes[0],$i,!1,!0)},onDisable:function(){return Ge(yt,ft.eventTypes[0],$i,!0)}})},Ui=/(input|label|select|textarea)/i,$i=function(t){var e=Ui.test(t.target.tagName);(e||Ri)&&(t._gsapAllow=!0,Ri=e)},Hi=function(t){xe(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e,i,n,r,s,o,a,l,c=t,h=c.normalizeScrollX,u=c.momentum,d=c.allowNestedScroll,p=c.onRelease,f=at(t.target)||vt,m=mt.core.globals().ScrollSmoother,g=m&&m.get(),_=Vt&&(t.content&&at(t.content)||g&&!1!==t.content&&!g.smooth()&&g.content()),y=lt(f,ot),v=lt(f,st),b=1,x=(ft.isTouch&&_t.visualViewport?_t.visualViewport.scale*_t.visualViewport.width:_t.outerWidth)/_t.innerWidth,w=0,E=ve(u)?function(){return u(e)}:function(){return u||2.8},S=Vi(f,t.type,!0,d),T=function(){return r=!1},M=ce,A=ce,C=function(){i=ge(f,ot),A=St(Vt?1:0,i),h&&(M=St(0,ge(f,st))),n=mi},k=function(){_._gsap.y=he(parseFloat(_._gsap.y)+y.offset)+"px",_.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(_._gsap.y)+", 0, 1)",y.offset=y.cacheID=0},P=function(){C(),s.isActive()&&s.vars.scrollY>i&&(y()>i?s.progress(1)&&y(i):s.resetTo("scrollY",i))};return _&&mt.set(_,{y:"+=0"}),t.ignoreCheck=function(t){return Vt&&"touchmove"===t.type&&function(){if(r){requestAnimationFrame(T);var t=he(e.deltaY/2),i=A(y.v-t);if(_&&i!==y.v+y.offset){y.offset=i-y.v;var n=he((parseFloat(_&&_._gsap.y)||0)-y.offset);_.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+n+", 0, 1)",_._gsap.y=n+"px",y.cacheID=G.cache,xi()}return!0}y.offset&&k(),r=!0}()||b>1.05&&"touchstart"!==t.type||e.isGesturing||t.touches&&t.touches.length>1},t.onPress=function(){r=!1;var t=b;b=he((_t.visualViewport&&_t.visualViewport.scale||1)/x),s.pause(),t!==b&&Bi(f,b>1.01||!h&&"x"),o=v(),a=y(),C(),n=mi},t.onRelease=t.onGestureStart=function(t,e){if(y.offset&&k(),e){G.cache++;var n,r,o=E();h&&(r=(n=v())+.05*o*-t.velocityX/.227,o*=Fi(v,n,r,ge(f,st)),s.vars.scrollX=M(r)),r=(n=y())+.05*o*-t.velocityY/.227,o*=Fi(y,n,r,ge(f,ot)),s.vars.scrollY=A(r),s.invalidate().duration(o).play(.01),(Vt&&s.vars.scrollY>=i||n>=i-1)&&mt.to({},{onUpdate:P,duration:o})}else l.restart(!0);p&&p(t)},t.onWheel=function(){s._ts&&s.pause(),te()-w>1e3&&(n=0,w=te())},t.onChange=function(t,e,i,r,s){if(mi!==n&&C(),e&&h&&v(M(r[2]===e?o+(t.startX-t.x):v()+e-r[1])),i){y.offset&&k();var l=s[2]===i,c=l?a+t.startY-t.y:y()+i-s[1],u=A(c);l&&c!==u&&(a+=u-c),y(u)}(i||e)&&xi()},t.onEnable=function(){Bi(f,!h&&"x"),zi.addEventListener("refresh",P),We(_t,"resize",P),y.smooth&&(y.target.style.scrollBehavior="auto",y.smooth=v.smooth=!1),S.enable()},t.onDisable=function(){Bi(f,!0),Ge(_t,"resize",P),zi.removeEventListener("refresh",P),S.kill()},t.lockAxis=!1!==t.lockAxis,(e=new ft(t)).iOS=Vt,Vt&&!y()&&y(1),Vt&&mt.ticker.add(ce),l=e._dc,s=mt.to(e,{ease:"power4",paused:!0,scrollX:h?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Di(y,y(),(function(){return s.pause()}))},onUpdate:xi,onComplete:l.vars.onComplete}),e};zi.sort=function(t){return ei.sort(t||function(t,e){return-1e6*(t.vars.refreshPriority||0)+t.start-(e.start+-1e6*(e.vars.refreshPriority||0))})},zi.observe=function(t){return new ft(t)},zi.normalizeScroll=function(t){if(void 0===t)return Ft;if(!0===t&&Ft)return Ft.enable();if(!1===t)return Ft&&Ft.kill(),void(Ft=t);var e=t instanceof ft?t:Hi(t);return Ft&&Ft.target===e.target&&Ft.kill(),pe(e.target)&&(Ft=e),e},zi.core={_getVelocityProp:ct,_inputObserver:Vi,_scrollers:G,_proxies:Z,bridge:{ss:function(){ie||hi("scrollStart"),ie=te()},ref:function(){return At}}},de()&&mt.registerPlugin(zi);var qi=t=>{k.gsap.registerPlugin(zi)};function Wi(t,e,i){return Math.max(t,Math.min(e,i))}class Gi{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=(i=this.value,n=this.to,r=60*this.lerp,s=t,function(t,e,i){return(1-i)*t+i*e}(i,n,1-Math.exp(-r*s))),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=Wi(0,this.currentTime/this.duration,1);e=i>=1;const n=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*n}var i,n,r,s;this.onUpdate?.(this.value,e),e&&this.stop()}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:n=1,easing:r=(t=>t),onStart:s,onUpdate:o}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=n,this.easing=r,this.currentTime=0,this.isRunning=!0,s?.(),this.onUpdate=o}}class Zi{constructor({wrapper:t,content:e,autoResize:i=!0}={}){if(this.wrapper=t,this.content=e,i){const t=function(t,e){let i;return function(){let e=arguments,n=this;clearTimeout(i),i=setTimeout((function(){t.apply(n,e)}),250)}}(this.resize);this.wrapper!==window&&(this.wrapperResizeObserver=new ResizeObserver(t),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(t),this.contentResizeObserver.observe(this.content)}this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect()}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Yi{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,n=i.length;t<n;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}class Xi{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=2,normalizeWheel:n=!1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.normalizeWheel=n,this.touchStart={x:null,y:null},this.emitter=new Yi,this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,n=-(e-this.touchStart.x)*this.touchMultiplier,r=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:n,y:r},this.emitter.emit("scroll",{deltaX:n,deltaY:r,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=t=>{let{deltaX:e,deltaY:i}=t;this.normalizeWheel&&(e=Wi(-100,e,100),i=Wi(-100,i,100)),e*=this.wheelMultiplier,i*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:e,deltaY:i,event:t})}}class Ki{constructor({wrapper:t=window,content:e=document.documentElement,wheelEventsTarget:i=t,eventsTarget:n=i,smoothWheel:r=!0,smoothTouch:s=!1,syncTouch:o=!1,syncTouchLerp:a=.075,touchInertiaMultiplier:l=35,duration:c,easing:h=(t=>Math.min(1,1.001-Math.pow(2,-10*t))),lerp:u=!c&&.1,infinite:d=!1,orientation:p="vertical",gestureOrientation:f="vertical",touchMultiplier:m=1,wheelMultiplier:g=1,normalizeWheel:_=!1,autoResize:y=!0}={}){window.lenisVersion="1.0.33",t!==document.documentElement&&t!==document.body||(t=window),this.options={wrapper:t,content:e,wheelEventsTarget:i,eventsTarget:n,smoothWheel:r,smoothTouch:s,syncTouch:o,syncTouchLerp:a,touchInertiaMultiplier:l,duration:c,easing:h,lerp:u,infinite:d,gestureOrientation:f,orientation:p,touchMultiplier:m,wheelMultiplier:g,normalizeWheel:_,autoResize:y},this.animate=new Gi,this.emitter=new Yi,this.dimensions=new Zi({wrapper:t,content:e,autoResize:y}),this.toggleClass("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=o||r||s,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,{passive:!1}),this.virtualScroll=new Xi(n,{touchMultiplier:m,wheelMultiplier:g,normalizeWheel:_}),this.virtualScroll.on("scroll",this.onVirtualScroll)}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,{passive:!1}),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClass("lenis",!1),this.toggleClass("lenis-smooth",!1),this.toggleClass("lenis-scrolling",!1),this.toggleClass("lenis-stopped",!1),this.toggleClass("lenis-locked",!1)}on(t,e){return this.emitter.on(t,e)}off(t,e){return this.emitter.off(t,e)}setScroll(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t}onVirtualScroll=({deltaX:t,deltaY:e,event:i})=>{if(i.ctrlKey)return;const n=i.type.includes("touch"),r=i.type.includes("wheel");if((this.options.smoothTouch||this.options.syncTouch)&&n&&"touchstart"===i.type)return void this.reset();const s=0===t&&0===e,o="vertical"===this.options.gestureOrientation&&0===e||"horizontal"===this.options.gestureOrientation&&0===t;if(s||o)return;let a=i.composedPath();if(a=a.slice(0,a.indexOf(this.rootElement)),a.find((t=>t.hasAttribute?.("data-lenis-prevent")||n&&t.hasAttribute?.("data-lenis-prevent-touch")||r&&t.hasAttribute?.("data-lenis-prevent-wheel")||t.classList?.contains("lenis"))))return;if(this.isStopped||this.isLocked)return void i.preventDefault();if(this.isSmooth=(this.options.smoothTouch||this.options.syncTouch)&&n||this.options.smoothWheel&&r,!this.isSmooth)return this.isScrolling=!1,void this.animate.stop();i.preventDefault();let l=e;"both"===this.options.gestureOrientation?l=Math.abs(e)>Math.abs(t)?e:t:"horizontal"===this.options.gestureOrientation&&(l=t);const c=n&&this.options.syncTouch,h=n&&"touchend"===i.type&&Math.abs(l)>5;h&&(l=this.velocity*this.options.touchInertiaMultiplier),this.scrollTo(this.targetScroll+l,{programmatic:!1,...c?{lerp:h?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})};resize(){this.dimensions.resize()}emit(){this.emitter.emit("scroll",this)}onNativeScroll=()=>{if(!this.__preventNextScrollEvent&&!this.isScrolling){const t=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.direction=Math.sign(this.animatedScroll-t),this.emit()}};reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()}start(){this.isStopped=!1,this.reset()}stop(){this.isStopped=!0,this.animate.stop(),this.reset()}raf(t){const e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)}scrollTo(t,{offset:e=0,immediate:i=!1,lock:n=!1,duration:r=this.options.duration,easing:s=this.options.easing,lerp:o=!r&&this.options.lerp,onComplete:a=null,force:l=!1,programmatic:c=!0}={}){if(!this.isStopped&&!this.isLocked||l){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{let i;if("string"==typeof t?i=document.querySelector(t):t?.nodeType&&(i=t),i){if(this.options.wrapper!==window){const t=this.options.wrapper.getBoundingClientRect();e-=this.isHorizontal?t.left:t.top}const n=i.getBoundingClientRect();t=(this.isHorizontal?n.left:n.top)+this.animatedScroll}}if("number"==typeof t){if(t+=e,t=Math.round(t),this.options.infinite?c&&(this.targetScroll=this.animatedScroll=this.scroll):t=Wi(0,t,this.limit),i)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void a?.(this);if(!c){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:r,easing:s,lerp:o,onStart:()=>{n&&(this.isLocked=!0),this.isScrolling=!0},onUpdate:(t,e)=>{this.isScrolling=!0,this.velocity=t-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=t,this.setScroll(this.scroll),c&&(this.targetScroll=t),e||this.emit(),e&&(this.reset(),this.emit(),a?.(this),this.__preventNextScrollEvent=!0,requestAnimationFrame((()=>{delete this.__preventNextScrollEvent})))}})}}}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return"horizontal"===this.options.orientation}get actualScroll(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop}get scroll(){return this.options.infinite?(this.animatedScroll%(t=this.limit)+t)%t:this.animatedScroll;var t}get progress(){return 0===this.limit?1:this.scroll/this.limit}get isSmooth(){return this.__isSmooth}set isSmooth(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClass("lenis-smooth",t))}get isScrolling(){return this.__isScrolling}set isScrolling(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClass("lenis-scrolling",t))}get isStopped(){return this.__isStopped}set isStopped(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClass("lenis-stopped",t))}get isLocked(){return this.__isLocked}set isLocked(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClass("lenis-locked",t))}get className(){let t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t}toggleClass(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)}}var Qi=()=>{var t=new Ki;return t.on("scroll",zi.update),k.gsap.ticker.add((e=>{t.raf(1e3*e)})),dO.plugins.lenis=t,t},Ji=__webpack_require__(2279),tn=__webpack_require__.n(Ji);class en{success(t){tn()({text:t,duration:4e3,className:"_success"}).showToast()}error(t){tn()({text:t,duration:4e3,className:"_error"}).showToast()}}var nn=t=>{dO.plugins.toasts=new en},rn=__webpack_require__(5881),sn=__webpack_require__.n(rn),on=()=>{var t;dO.plugins.htmx=sn(),sn().defineExtension("multi-swap",{init:function(e){t=e},isInlineSwap:function(t){return 0===t.indexOf("multi:")},handleSwap:function(e,i,n,r){if(0===e.indexOf("multi:")){var s={},o=e.replace(/^multi\s*:\s*/,"").split(/\s*,\s*/);for(var a in o.map((function(t){var e=t.split(/\s*:\s*/),i=e[0],n=void 0!==e[1]?e[1]:"innerHTML";"#"===i.charAt(0)?s[i]=n:console.error("HTMX multi-swap: unsupported selector '"+i+"'. Only ID selectors starting with '#' are supported.")})),s){var l=s[a],c=n.querySelector(a);c?t.oobSwap(l,c,r):console.warn("HTMX multi-swap: selector '"+a+"' not found in source content.")}return!0}}})};function an(t,e){return function(){return t.apply(e,arguments)}}const{toString:ln}=Object.prototype,{getPrototypeOf:cn}=Object,hn=(t=>e=>{const i=ln.call(e);return t[i]||(t[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),un=t=>(t=t.toLowerCase(),e=>hn(e)===t),dn=t=>e=>typeof e===t,{isArray:pn}=Array,fn=dn("undefined");const mn=un("ArrayBuffer");const gn=dn("string"),_n=dn("function"),yn=dn("number"),vn=t=>null!==t&&"object"==typeof t,bn=t=>{if("object"!==hn(t))return!1;const e=cn(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},xn=un("Date"),wn=un("File"),En=un("Blob"),Sn=un("FileList"),Tn=un("URLSearchParams");function Mn(t,e,{allOwnKeys:i=!1}={}){if(null==t)return;let n,r;if("object"!=typeof t&&(t=[t]),pn(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{const r=i?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length;let o;for(n=0;n<s;n++)o=r[n],e.call(null,t[o],o,t)}}function An(t,e){e=e.toLowerCase();const i=Object.keys(t);let n,r=i.length;for(;r-- >0;)if(n=i[r],e===n.toLowerCase())return n;return null}const Cn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,kn=t=>!fn(t)&&t!==Cn;const Pn=(In="undefined"!=typeof Uint8Array&&cn(Uint8Array),t=>In&&t instanceof In);var In;const Dn=un("HTMLFormElement"),On=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),Ln=un("RegExp"),zn=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),n={};Mn(i,((i,r)=>{let s;!1!==(s=e(i,r,t))&&(n[r]=s||i)})),Object.defineProperties(t,n)},Rn="abcdefghijklmnopqrstuvwxyz",Fn="0123456789",Bn={DIGIT:Fn,ALPHA:Rn,ALPHA_DIGIT:Rn+Rn.toUpperCase()+Fn};const Nn=un("AsyncFunction");var jn={isArray:pn,isArrayBuffer:mn,isBuffer:function(t){return null!==t&&!fn(t)&&null!==t.constructor&&!fn(t.constructor)&&_n(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||_n(t.append)&&("formdata"===(e=hn(t))||"object"===e&&_n(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&mn(t.buffer),e},isString:gn,isNumber:yn,isBoolean:t=>!0===t||!1===t,isObject:vn,isPlainObject:bn,isUndefined:fn,isDate:xn,isFile:wn,isBlob:En,isRegExp:Ln,isFunction:_n,isStream:t=>vn(t)&&_n(t.pipe),isURLSearchParams:Tn,isTypedArray:Pn,isFileList:Sn,forEach:Mn,merge:function t(){const{caseless:e}=kn(this)&&this||{},i={},n=(n,r)=>{const s=e&&An(i,r)||r;bn(i[s])&&bn(n)?i[s]=t(i[s],n):bn(n)?i[s]=t({},n):pn(n)?i[s]=n.slice():i[s]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&Mn(arguments[t],n);return i},extend:(t,e,i,{allOwnKeys:n}={})=>(Mn(e,((e,n)=>{i&&_n(e)?t[n]=an(e,i):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,n)=>{let r,s,o;const a={};if(e=e||{},null==t)return e;do{for(r=Object.getOwnPropertyNames(t),s=r.length;s-- >0;)o=r[s],n&&!n(o,t,e)||a[o]||(e[o]=t[o],a[o]=!0);t=!1!==i&&cn(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:hn,kindOfTest:un,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;const n=t.indexOf(e,i);return-1!==n&&n===i},toArray:t=>{if(!t)return null;if(pn(t))return t;let e=t.length;if(!yn(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=i.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll:(t,e)=>{let i;const n=[];for(;null!==(i=t.exec(e));)n.push(i);return n},isHTMLForm:Dn,hasOwnProperty:On,hasOwnProp:On,reduceDescriptors:zn,freezeMethods:t=>{zn(t,((e,i)=>{if(_n(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=t[i];_n(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(t,e)=>{const i={},n=t=>{t.forEach((t=>{i[t]=!0}))};return pn(t)?n(t):n(String(t).split(e)),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,i){return e.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:An,global:Cn,isContextDefined:kn,ALPHABET:Bn,generateString:(t=16,e=Bn.ALPHA_DIGIT)=>{let i="";const{length:n}=e;for(;t--;)i+=e[Math.random()*n|0];return i},isSpecCompliantForm:function(t){return!!(t&&_n(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),i=(t,n)=>{if(vn(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const r=pn(t)?[]:{};return Mn(t,((t,e)=>{const s=i(t,n+1);!fn(s)&&(r[e]=s)})),e[n]=void 0,r}}return t};return i(t,0)},isAsyncFn:Nn,isThenable:t=>t&&(vn(t)||_n(t))&&_n(t.then)&&_n(t.catch)};function Vn(t,e,i,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r)}jn.inherits(Vn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jn.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Un=Vn.prototype,$n={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{$n[t]={value:t}})),Object.defineProperties(Vn,$n),Object.defineProperty(Un,"isAxiosError",{value:!0}),Vn.from=(t,e,i,n,r,s)=>{const o=Object.create(Un);return jn.toFlatObject(t,o,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),Vn.call(o,t.message,e,i,n,r),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Hn=Vn;function qn(t){return jn.isPlainObject(t)||jn.isArray(t)}function Wn(t){return jn.endsWith(t,"[]")?t.slice(0,-2):t}function Gn(t,e,i){return t?t.concat(e).map((function(t,e){return t=Wn(t),!i&&e?"["+t+"]":t})).join(i?".":""):e}const Zn=jn.toFlatObject(jn,{},null,(function(t){return/^is[A-Z]/.test(t)}));var Yn=function(t,e,i){if(!jn.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(i=jn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!jn.isUndefined(e[t])}))).metaTokens,r=i.visitor||c,s=i.dots,o=i.indexes,a=(i.Blob||"undefined"!=typeof Blob&&Blob)&&jn.isSpecCompliantForm(e);if(!jn.isFunction(r))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(jn.isDate(t))return t.toISOString();if(!a&&jn.isBlob(t))throw new Hn("Blob is not supported. Use a Buffer instead.");return jn.isArrayBuffer(t)||jn.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,i,r){let a=t;if(t&&!r&&"object"==typeof t)if(jn.endsWith(i,"{}"))i=n?i:i.slice(0,-2),t=JSON.stringify(t);else if(jn.isArray(t)&&function(t){return jn.isArray(t)&&!t.some(qn)}(t)||(jn.isFileList(t)||jn.endsWith(i,"[]"))&&(a=jn.toArray(t)))return i=Wn(i),a.forEach((function(t,n){!jn.isUndefined(t)&&null!==t&&e.append(!0===o?Gn([i],n,s):null===o?i:i+"[]",l(t))})),!1;return!!qn(t)||(e.append(Gn(r,i,s),l(t)),!1)}const h=[],u=Object.assign(Zn,{defaultVisitor:c,convertValue:l,isVisitable:qn});if(!jn.isObject(t))throw new TypeError("data must be an object");return function t(i,n){if(!jn.isUndefined(i)){if(-1!==h.indexOf(i))throw Error("Circular reference detected in "+n.join("."));h.push(i),jn.forEach(i,(function(i,s){!0===(!(jn.isUndefined(i)||null===i)&&r.call(e,i,jn.isString(s)?s.trim():s,n,u))&&t(i,n?n.concat(s):[s])})),h.pop()}}(t),e};function Xn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Kn(t,e){this._pairs=[],t&&Yn(t,this,e)}const Qn=Kn.prototype;Qn.append=function(t,e){this._pairs.push([t,e])},Qn.toString=function(t){const e=t?function(e){return t.call(this,e,Xn)}:Xn;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var Jn=Kn;function tr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function er(t,e,i){if(!e)return t;const n=i&&i.encode||tr,r=i&&i.serialize;let s;if(s=r?r(e,i):jn.isURLSearchParams(e)?e.toString():new Jn(e,i).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}var ir=class{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){jn.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},nr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Jn,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const sr="undefined"!=typeof window&&"undefined"!=typeof document,or=(ar="undefined"!=typeof navigator&&navigator.product,sr&&["ReactNative","NativeScript","NS"].indexOf(ar)<0);var ar;const lr="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var cr={...t,...rr};var hr=function(t){function e(t,i,n,r){let s=t[r++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=r>=t.length;if(s=!s&&jn.isArray(n)?n.length:s,a)return jn.hasOwnProp(n,s)?n[s]=[n[s],i]:n[s]=i,!o;n[s]&&jn.isObject(n[s])||(n[s]=[]);return e(t,i,n[s],r)&&jn.isArray(n[s])&&(n[s]=function(t){const e={},i=Object.keys(t);let n;const r=i.length;let s;for(n=0;n<r;n++)s=i[n],e[s]=t[s];return e}(n[s])),!o}if(jn.isFormData(t)&&jn.isFunction(t.entries)){const i={};return jn.forEachEntry(t,((t,n)=>{e(function(t){return jn.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,i,0)})),i}return null};const ur={transitional:nr,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,r=jn.isObject(t);r&&jn.isHTMLForm(t)&&(t=new FormData(t));if(jn.isFormData(t))return n&&n?JSON.stringify(hr(t)):t;if(jn.isArrayBuffer(t)||jn.isBuffer(t)||jn.isStream(t)||jn.isFile(t)||jn.isBlob(t))return t;if(jn.isArrayBufferView(t))return t.buffer;if(jn.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Yn(t,new cr.classes.URLSearchParams,Object.assign({visitor:function(t,e,i,n){return cr.isNode&&jn.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=jn.isFileList(t))||i.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Yn(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),function(t,e,i){if(jn.isString(t))try{return(e||JSON.parse)(t),jn.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||ur.transitional,i=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&jn.isString(t)&&(i&&!this.responseType||n)){const i=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw Hn.from(t,Hn.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cr.classes.FormData,Blob:cr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};jn.forEach(["delete","get","head","post","put","patch"],(t=>{ur.headers[t]={}}));var dr=ur;const pr=jn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const fr=Symbol("internals");function mr(t){return t&&String(t).trim().toLowerCase()}function gr(t){return!1===t||null==t?t:jn.isArray(t)?t.map(gr):String(t)}function _r(t,e,i,n,r){return jn.isFunction(n)?n.call(this,e,i):(r&&(e=i),jn.isString(e)?jn.isString(n)?-1!==e.indexOf(n):jn.isRegExp(n)?n.test(e):void 0:void 0)}class yr{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function r(t,e,i){const r=mr(e);if(!r)throw new Error("header name must be a non-empty string");const s=jn.findKey(n,r);(!s||void 0===n[s]||!0===i||void 0===i&&!1!==n[s])&&(n[s||e]=gr(t))}const s=(t,e)=>jn.forEach(t,((t,i)=>r(t,i,e)));return jn.isPlainObject(t)||t instanceof this.constructor?s(t,e):jn.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?s((t=>{const e={};let i,n,r;return t&&t.split("\n").forEach((function(t){r=t.indexOf(":"),i=t.substring(0,r).trim().toLowerCase(),n=t.substring(r+1).trim(),!i||e[i]&&pr[i]||("set-cookie"===i?e[i]?e[i].push(n):e[i]=[n]:e[i]=e[i]?e[i]+", "+n:n)})),e})(t),e):null!=t&&r(e,t,i),this}get(t,e){if(t=mr(t)){const i=jn.findKey(this,t);if(i){const t=this[i];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(t);)e[n[1]]=n[2];return e}(t);if(jn.isFunction(e))return e.call(this,t,i);if(jn.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=mr(t)){const i=jn.findKey(this,t);return!(!i||void 0===this[i]||e&&!_r(0,this[i],i,e))}return!1}delete(t,e){const i=this;let n=!1;function r(t){if(t=mr(t)){const r=jn.findKey(i,t);!r||e&&!_r(0,i[r],r,e)||(delete i[r],n=!0)}}return jn.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const r=e[i];t&&!_r(0,this[r],r,t,!0)||(delete this[r],n=!0)}return n}normalize(t){const e=this,i={};return jn.forEach(this,((n,r)=>{const s=jn.findKey(i,r);if(s)return e[s]=gr(n),void delete e[r];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,i)=>e.toUpperCase()+i))}(r):String(r).trim();o!==r&&delete e[r],e[o]=gr(n),i[o]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return jn.forEach(this,((i,n)=>{null!=i&&!1!==i&&(e[n]=t&&jn.isArray(i)?i.join(", "):i)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach((t=>i.set(t))),i}static accessor(t){const e=(this[fr]=this[fr]={accessors:{}}).accessors,i=this.prototype;function n(t){const n=mr(t);e[n]||(!function(t,e){const i=jn.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+i,{value:function(t,i,r){return this[n].call(this,e,t,i,r)},configurable:!0})}))}(i,t),e[n]=!0)}return jn.isArray(t)?t.forEach(n):n(t),this}}yr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),jn.reduceDescriptors(yr.prototype,(({value:t},e)=>{let i=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[i]=t}}})),jn.freezeMethods(yr);var vr=yr;function br(t,e){const i=this||dr,n=e||i,r=vr.from(n.headers);let s=n.data;return jn.forEach(t,(function(t){s=t.call(i,s,r.normalize(),e?e.status:void 0)})),r.normalize(),s}function xr(t){return!(!t||!t.__CANCEL__)}function wr(t,e,i){Hn.call(this,null==t?"canceled":t,Hn.ERR_CANCELED,e,i),this.name="CanceledError"}jn.inherits(wr,Hn,{__CANCEL__:!0});var Er=wr;var Sr=cr.hasStandardBrowserEnv?{write(t,e,i,n,r,s){const o=[t+"="+encodeURIComponent(e)];jn.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),jn.isString(n)&&o.push("path="+n),jn.isString(r)&&o.push("domain="+r),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Tr(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var Mr=cr.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(i){let n=i;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(t){const e=jn.isString(t)?n(t):t;return e.protocol===i.protocol&&e.host===i.host}}():function(){return!0};var Ar=function(t,e){t=t||10;const i=new Array(t),n=new Array(t);let r,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const l=Date.now(),c=n[o];r||(r=l),i[s]=a,n[s]=l;let h=o,u=0;for(;h!==s;)u+=i[h++],h%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),l-r<e)return;const d=c&&l-c;return d?Math.round(1e3*u/d):void 0}};function Cr(t,e){let i=0;const n=Ar(50,250);return r=>{const s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-i,l=n(a);i=s;const c={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:r};c[e?"download":"upload"]=!0,t(c)}}var kr="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,i){let n=t.data;const r=vr.from(t.headers).normalize();let s,o,{responseType:a,withXSRFToken:l}=t;function c(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}if(jn.isFormData(n))if(cr.hasStandardBrowserEnv||cr.hasStandardBrowserWebWorkerEnv)r.setContentType(!1);else if(!1!==(o=r.getContentType())){const[t,...e]=o?o.split(";").map((t=>t.trim())).filter(Boolean):[];r.setContentType([t||"multipart/form-data",...e].join("; "))}let h=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",i=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";r.set("Authorization","Basic "+btoa(e+":"+i))}const u=Tr(t.baseURL,t.url);function d(){if(!h)return;const n=vr.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(t,e,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?e(new Hn("Request failed with status code "+i.status,[Hn.ERR_BAD_REQUEST,Hn.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}((function(t){e(t),c()}),(function(t){i(t),c()}),{data:a&&"text"!==a&&"json"!==a?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h}),h=null}if(h.open(t.method.toUpperCase(),er(u,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,"onloadend"in h?h.onloadend=d:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(d)},h.onabort=function(){h&&(i(new Hn("Request aborted",Hn.ECONNABORTED,t,h)),h=null)},h.onerror=function(){i(new Hn("Network Error",Hn.ERR_NETWORK,t,h)),h=null},h.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||nr;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(new Hn(e,n.clarifyTimeoutError?Hn.ETIMEDOUT:Hn.ECONNABORTED,t,h)),h=null},cr.hasStandardBrowserEnv&&(l&&jn.isFunction(l)&&(l=l(t)),l||!1!==l&&Mr(u))){const e=t.xsrfHeaderName&&t.xsrfCookieName&&Sr.read(t.xsrfCookieName);e&&r.set(t.xsrfHeaderName,e)}void 0===n&&r.setContentType(null),"setRequestHeader"in h&&jn.forEach(r.toJSON(),(function(t,e){h.setRequestHeader(e,t)})),jn.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),a&&"json"!==a&&(h.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",Cr(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",Cr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=e=>{h&&(i(!e||e.type?new Er(null,t,h):e),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const p=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);p&&-1===cr.protocols.indexOf(p)?i(new Hn("Unsupported protocol "+p+":",Hn.ERR_BAD_REQUEST,t)):h.send(n||null)}))};const Pr={http:null,xhr:kr};jn.forEach(Pr,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ir=t=>`- ${t}`,Dr=t=>jn.isFunction(t)||null===t||!1===t;var Or=t=>{t=jn.isArray(t)?t:[t];const{length:e}=t;let i,n;const r={};for(let s=0;s<e;s++){let e;if(i=t[s],n=i,!Dr(i)&&(n=Pr[(e=String(i)).toLowerCase()],void 0===n))throw new Hn(`Unknown adapter '${e}'`);if(n)break;r[e||"#"+s]=n}if(!n){const t=Object.entries(r).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let i=e?t.length>1?"since :\n"+t.map(Ir).join("\n"):" "+Ir(t[0]):"as no adapter specified";throw new Hn("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n};function Lr(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Er(null,t)}function zr(t){Lr(t),t.headers=vr.from(t.headers),t.data=br.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Or(t.adapter||dr.adapter)(t).then((function(e){return Lr(t),e.data=br.call(t,t.transformResponse,e),e.headers=vr.from(e.headers),e}),(function(e){return xr(e)||(Lr(t),e&&e.response&&(e.response.data=br.call(t,t.transformResponse,e.response),e.response.headers=vr.from(e.response.headers))),Promise.reject(e)}))}const Rr=t=>t instanceof vr?t.toJSON():t;function Fr(t,e){e=e||{};const i={};function n(t,e,i){return jn.isPlainObject(t)&&jn.isPlainObject(e)?jn.merge.call({caseless:i},t,e):jn.isPlainObject(e)?jn.merge({},e):jn.isArray(e)?e.slice():e}function r(t,e,i){return jn.isUndefined(e)?jn.isUndefined(t)?void 0:n(void 0,t,i):n(t,e,i)}function s(t,e){if(!jn.isUndefined(e))return n(void 0,e)}function o(t,e){return jn.isUndefined(e)?jn.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(i,r,s){return s in e?n(i,r):s in t?n(void 0,i):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e)=>r(Rr(t),Rr(e),!0)};return jn.forEach(Object.keys(Object.assign({},t,e)),(function(n){const s=l[n]||r,o=s(t[n],e[n],n);jn.isUndefined(o)&&s!==a||(i[n]=o)})),i}const Br="1.6.5",Nr={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Nr[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));const jr={};Nr.transitional=function(t,e,i){function n(t,e){return"[Axios v1.6.5] Transitional option '"+t+"'"+e+(i?". "+i:"")}return(i,r,s)=>{if(!1===t)throw new Hn(n(r," has been removed"+(e?" in "+e:"")),Hn.ERR_DEPRECATED);return e&&!jr[r]&&(jr[r]=!0,console.warn(n(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,r,s)}};var Vr={assertOptions:function(t,e,i){if("object"!=typeof t)throw new Hn("options must be an object",Hn.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const s=n[r],o=e[s];if(o){const e=t[s],i=void 0===e||o(e,s,t);if(!0!==i)throw new Hn("option "+s+" must be "+i,Hn.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new Hn("Unknown option "+s,Hn.ERR_BAD_OPTION)}},validators:Nr};const Ur=Vr.validators;class $r{constructor(t){this.defaults=t,this.interceptors={request:new ir,response:new ir}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Fr(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:r}=e;void 0!==i&&Vr.assertOptions(i,{silentJSONParsing:Ur.transitional(Ur.boolean),forcedJSONParsing:Ur.transitional(Ur.boolean),clarifyTimeoutError:Ur.transitional(Ur.boolean)},!1),null!=n&&(jn.isFunction(n)?e.paramsSerializer={serialize:n}:Vr.assertOptions(n,{encode:Ur.function,serialize:Ur.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&jn.merge(r.common,r[e.method]);r&&jn.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]})),e.headers=vr.concat(s,r);const o=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));let h,u=0;if(!a){const t=[zr.bind(this),void 0];for(t.unshift.apply(t,o),t.push.apply(t,l),h=t.length,c=Promise.resolve(e);u<h;)c=c.then(t[u++],t[u++]);return c}h=o.length;let d=e;for(u=0;u<h;){const t=o[u++],e=o[u++];try{d=t(d)}catch(t){e.call(this,t);break}}try{c=zr.call(this,d)}catch(t){return Promise.reject(t)}for(u=0,h=l.length;u<h;)c=c.then(l[u++],l[u++]);return c}getUri(t){return er(Tr((t=Fr(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}jn.forEach(["delete","get","head","options"],(function(t){$r.prototype[t]=function(e,i){return this.request(Fr(i||{},{method:t,url:e,data:(i||{}).data}))}})),jn.forEach(["post","put","patch"],(function(t){function e(e){return function(i,n,r){return this.request(Fr(r||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}$r.prototype[t]=e(),$r.prototype[t+"Form"]=e(!0)}));var Hr=$r;class qr{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const i=this;this.promise.then((t=>{if(!i._listeners)return;let e=i._listeners.length;for(;e-- >0;)i._listeners[e](t);i._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{i.subscribe(t),e=t})).then(t);return n.cancel=function(){i.unsubscribe(e)},n},t((function(t,n,r){i.reason||(i.reason=new Er(t,n,r),e(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;const e=new qr((function(e){t=e}));return{token:e,cancel:t}}}var Wr=qr;const Gr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gr).forEach((([t,e])=>{Gr[e]=t}));var Zr=Gr;const Yr=function t(e){const i=new Hr(e),n=an(Hr.prototype.request,i);return jn.extend(n,Hr.prototype,i,{allOwnKeys:!0}),jn.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return t(Fr(e,i))},n}(dr);Yr.Axios=Hr,Yr.CanceledError=Er,Yr.CancelToken=Wr,Yr.isCancel=xr,Yr.VERSION=Br,Yr.toFormData=Yn,Yr.AxiosError=Hn,Yr.Cancel=Yr.CanceledError,Yr.all=function(t){return Promise.all(t)},Yr.spread=function(t){return function(e){return t.apply(null,e)}},Yr.isAxiosError=function(t){return jn.isObject(t)&&!0===t.isAxiosError},Yr.mergeConfig=Fr,Yr.AxiosHeaders=vr,Yr.formToJSON=t=>hr(jn.isHTMLForm(t)?new FormData(t):t),Yr.getAdapter=Or,Yr.HttpStatusCode=Zr,Yr.default=Yr;var Xr=Yr,Kr=function(){var t=i((function*(t){var e=Xr.create();t.plugins.api=(t=>({post:(e,i)=>t.post(e,i),get:e=>t.get(e)}))(e)}));return function(e){return t.apply(this,arguments)}}(),Qr=Kr,Jr=__webpack_require__(1608),ts={light:{"app-bg":"rgba(255, 255, 255, 100%)","app-contrast-bg":"rgba(51, 179, 178, 100%)","app-dark-bg":"rgba(18, 19, 20, 100%)","element-bg":"rgba(255, 255, 255, 100%)","element-2-bg":"rgba(243, 243, 243, 100%)","element-blind-bg":"rgba(234, 235, 237, 100%)","element-blind-contrast-bg":"rgba(255, 255, 255, 10%)","icon-color":"rgba(18, 19, 20, 100%)","icon-contrast-bg":"rgba(255, 255, 255, 100%)","text-color":"rgba(18, 19, 20, 100%)","text-2-color":"rgba(145, 151, 163, 100%)","text-contrast-color":"rgba(255, 255, 255, 100%)","text-contrast-hero-color":"rgba(255, 255, 255, 100%)","text-contrast-2-color":"rgba(255, 255, 255, 70%)","text-contrast-hero-2-color":"rgba(255, 255, 255, 70%)","text-blind-color":"rgba(170, 177, 189, 100%)","text-blind-contrast-color":"rgba(255, 255, 255, 50%)","primary-color":"rgba(51, 179, 178, 100%)","primary-dark-color":"rgba(31, 148, 147, 100%)","primary-light-color":"rgba(77, 198, 197, 100%)","accent-color":"rgba(9, 59, 128, 100%)","accent-dark-color":"rgba(3, 49, 104, 100%)","accent-light-color":"rgba(39, 94, 159, 100%)","divider-color":"rgba(217, 221, 228, 100%)","divider-contrast-color":"rgba(255, 255, 255, 20%)","border-color":"rgba(217, 221, 228, 100%)","border-contrast-color":"rgba(255, 255, 255, 20%)","error-color":"rgba(202, 53, 74, 100%)","overflow-color":"#1213144D","overflow-color-2":"#12131480","ui-contrast-color-primary-button":"#121314","box-shadow":"rgba(34, 60, 80, 0.2)","bg-overlay":"rgba(18, 19, 20, 0.6)"},dark:{"app-bg":"rgba(12, 12, 12, 100%)","app-contrast-bg":"rgba(21, 151, 151, 100%)","app-dark-bg":"rgba(31, 35, 41, 100%)","element-bg":"rgba(12, 12, 12, 100%)","element-2-bg":"rgba(44, 48, 57, 100%)","element-blind-bg":"rgba(43, 47, 54, 100%)","element-blind-contrast-bg":"rgba(255, 255, 255, 10%)","icon-color":"rgba(12, 12, 12, 100%)","icon-contrast-bg":"rgba(251, 252, 252, 100%)","text-color":"rgba(251, 252, 252, 100%)","text-2-color":"rgba(170, 173, 183, 100%)","text-contrast-color":"rgba(251, 252, 252, 100%)","text-contrast-hero-color":"rgba(251, 252, 252, 100%)","text-contrast-2-color":"rgba(251, 252, 252, 50%)","text-contrast-hero-2-color":"rgba(251, 252, 252, 50%)","text-blind-color":"rgba(121, 125, 135, 100%)","text-blind-contrast-color":"rgba(255, 255, 255, 55%)","primary-color":"rgba(55, 197, 196, 100%)","primary-dark-color":"rgba(18, 154, 153, 100%)","primary-light-color":"rgba(101, 192, 191, 100%)","accent-color":"rgba(4, 65, 156, 100%)","accent-dark-color":"rgba(3, 34, 116, 100%)","accent-light-color":"rgba(48, 107, 177, 100%)","divider-color":"rgba(75, 78, 85, 100%)","divider-contrast-color":"rgba(251, 252, 252, 20%)","border-color":"rgba(75, 78, 85, 100%)","border-contrast-color":"rgba(251, 252, 252, 20%)","error-color":"rgba(184, 59, 73, 100%)","overflow-color":"#1F20254D","overflow-color-2":"#1F202580","ui-contrast-color-primary-button":"#121314","box-shadow":"rgba(255, 255, 255, 1)","bg-overlay":"rgba(18, 19, 20, 0.6)"},black:{"app-bg":"#000000","app-contrast-bg":"grey","app-dark-bg":"black","element-bg":"black","element-2-bg":"gray","element-blind-bg":"rgba(255, 255, 255, 0.10)","element-blind-contrast-bg":"grey","element-bg-transparent":"#FFFFFF","icon-color":"rgba(12, 12, 12, 100%)","text-color":"white","text-2-color":"white","text-blind-color":"black","text-contrast-color":"white","text-contrast-hero-color":"white","text-blind-contrast-color":"lightgrey","text-contrast-2-color":"#FFFFFFF","text-contrast-hero-2-color":"#FFFFFFF","primary-color":"#444444","primary-dark-color":"grey","primary-light-color":"grey","accent-color":"grey","accent-dark-color":"lightgrey","accent-light-color":"lightgrey","divider-color":"#D2DAE3","divider-contrast-color":"rgba(210, 218, 227, 0.30)","error-color":"#FFFFFFF","overflow-color":"grey","overflow-color-2":"lightgrey","ui-contrast-color-primary-button":"#121314","box-shadow":"rgba(255, 255, 255, 1)","bg-overlay":"rgba(18, 19, 20, 0.6)"},white:{"app-bg":"#FFFFFF","app-contrast-bg":"grey","app-dark-bg":"whitesmoke","element-bg":"whitesmoke","element-2-bg":"#E7E9ED","element-blind-bg":"#FFFFFF","element-blind-contrast-bg":"#FFFFFF","icon-color":"white","text-color":"black","text-2-color":"black","text-blind-color":"grey","text-blind-contrast-color":"grey","text-contrast-color":"black","text-contrast-hero-color":"#fff","text-contrast-2-color":"black","text-contrast-hero-2-color":"white","primary-color":"grey","primary-dark-color":"grey","primary-light-color":"lightgrey","divider-color":"grey","divider-contrast-color":"rgba(210, 218, 227, 0.30)","accent-color":"lightgrey","accent-dark-color":"lightgrey","accent-light-color":"lightgrey","error-color":"#FFFFFFF","overflow-color":"grey","overflow-color-2":"grey","ui-contrast-color-primary-button":"white","box-shadow":"rgba(34, 60, 80, 0.2)","bg-overlay":"rgba(18, 19, 20, 0.6)"}};function es(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function is(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?es(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):es(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}class ns extends E{constructor(){super(),s(this,"currentTheme",""),this.setTheme(),ns.toggleBtn.forEach((t=>{t.querySelector("input").checked="dark"===this.currentTheme,t.addEventListener("change",(()=>{var t="dark"===this.currentTheme;this.setTheme(t?"light":"dark"),this.setPropertyItems()}))})),this.setPropertyItems()}setTheme(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=!t;t=t||localStorage.getItem("app_theme")||"light";var i=window.colors||{},n=is(is({},ts[t]),i[t]||{});if(!(!n||Jr.isIE||Jr.isMobile&&["black","white"].includes(t))){var r=document.documentElement;this.removeThemeClasses(),r.classList.add("transition-disabled"),r.classList.add("".concat(t,"-theme")),Object.keys(n).forEach((t=>{r.style.setProperty("--".concat(t),n[t])})),setTimeout((()=>{r.classList.remove("transition-disabled")}),500),this.currentTheme=t,localStorage.setItem("app_theme",t),document.querySelectorAll("[data-theme]").forEach((e=>{var i=e.getAttribute(["black","dark"].includes(t)?"data-theme-contrast":"data-theme");e.setAttribute("src",i)})),this.setGrayScale(),e||this.emit("change",this.currentTheme)}}removeThemeClasses(){var t=document.documentElement.className.split(" ").filter((t=>!t.includes("-theme")));document.documentElement.className=t.length&&t.join(" ").trim()}resetBtns(){ns.toggleBtn.forEach((t=>{t.querySelector("input").checked=!1}))}setGrayScale(){document.querySelectorAll("[src], [data-src], [data-bg]").forEach((t=>{["black","white"].includes(this.currentTheme)?t.style.setProperty("filter","grayscale(1)"):t.style.removeProperty("filter")}))}setPropertyItems(){document.querySelectorAll("[data-accent-color], [data-accent-light-color]").forEach((t=>{["accent-color","accent-light-color"].forEach((e=>{var i=t.getAttribute("data-".concat(e));if(!i)return!1;["black","white"].includes(this.currentTheme)?t.style.removeProperty("--".concat(e)):t.style.setProperty("--".concat(e),i)}))}))}}s(ns,"toggleBtn",document.querySelectorAll(".js-toggle-theme"));var rs=t=>{t.plugins.themeManager=new ns};const ss=(t,e=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*e)/e),os=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf("hidden"),r=-1!==i.indexOf("visible");return e&&!n&&!r},as=function(t,e=void 0){return!(!t||t===document.body||e&&t===e)&&(os(t)?t:as(t.parentElement,e))},ls=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body;if(e.childElementCount>1){for(var i=document.createElement("div");e.firstChild;)i.appendChild(e.firstChild);return i}return e.firstChild},cs=t=>`${t||""}`.split(" ").filter((t=>!!t)),hs=(t,e,i)=>{t&&cs(e).forEach((e=>{t.classList.toggle(e,i||!1)}))};class us{constructor(t){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const ds={passive:!1};class ps{constructor(t,{start:e=(()=>!0),move:i=(()=>{}),end:n=(()=>{})}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[t]=this[t].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,ds),this.element.addEventListener("touchstart",this.onTouchStart,ds),this.element.addEventListener("touchmove",this.onMove,ds),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(t){if(!t.buttons||0!==t.button)return;const e=new us(t);this.currentPointers.some((t=>t.id===e.id))||this.triggerPointerStart(e,t)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new us(e),t);window.addEventListener("blur",this.onWindowBlur)}onMove(t){const e=this.currentPointers.slice(),i="changedTouches"in t?Array.from(t.changedTouches||[]).map((t=>new us(t))):[new us(t)],n=[];for(const t of i){const e=this.currentPointers.findIndex((e=>e.id===t.id));e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(t,this.currentPointers.slice(),e)}onPointerEnd(t){t.buttons>0&&0!==t.button||(this.triggerPointerEnd(t,new us(t)),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur))}onTouchEnd(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerEnd(t,new us(e))}triggerPointerStart(t,e){return!!this.startCallback(e,t,this.currentPointers.slice())&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}triggerPointerEnd(t,e){const i=this.currentPointers.findIndex((t=>t.id===e.id));i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,ds),this.element.removeEventListener("touchstart",this.onTouchStart,ds),this.element.removeEventListener("touchmove",this.onMove,ds),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function fs(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function ms(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}const gs=t=>"object"==typeof t&&null!==t&&t.constructor===Object&&"[object Object]"===Object.prototype.toString.call(t),_s=(t,...e)=>{const i=e.length;for(let n=0;n<i;n++){const i=e[n]||{};Object.entries(i).forEach((([e,i])=>{const n=Array.isArray(i)?[]:{};t[e]||Object.assign(t,{[e]:n}),gs(i)?Object.assign(t[e],_s(n,i)):Array.isArray(i)?Object.assign(t,{[e]:[...i]}):Object.assign(t,{[e]:i})}))}return t},ys=function(t,e){return t.split(".").reduce(((t,e)=>"object"==typeof t?t[e]:void 0),e)};class vs{constructor(t={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?_s({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=ys(t,this.options);return i&&"function"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...n){let r=ys(e,t);var s;"string"!=typeof(s=r)||isNaN(s)||isNaN(parseFloat(s))||(r=parseFloat(r)),"true"===r&&(r=!0),"false"===r&&(r=!1),r&&"function"==typeof r&&(r=r.call(this,this,t,...n));let o=ys(e,this.options);return o&&"function"==typeof o?r=o.call(this,this,t,...n,r):void 0===r&&(r=o),void 0===r?i:r}cn(t){const e=this.options.classes;return e&&e[t]||""}localize(t,e=[]){t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,((t,e,i)=>{let n="";return i?n=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;i<e.length;i++)t=t.split(e[i][0]).join(e[i][1]);return t.replace(/\{\{(.*?)\}\}/g,((t,e)=>e))}on(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEach((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),"*"!==t&&this.emit("*",t,...e)}}Object.defineProperty(vs,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.34"}),Object.defineProperty(vs,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class bs extends vs{constructor(t={}){super(t),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(const[i,n]of Object.entries(t)){const t=this.option(i),r=this.plugins[i];r||!1===t?r&&!1===t&&(r.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach()}detachPlugins(t){t=t||Object.keys(this.plugins);for(const e of t){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit("detachPlugins"),this}}var xs;!function(t){t[t.Init=0]="Init",t[t.Error=1]="Error",t[t.Ready=2]="Ready",t[t.Panning=3]="Panning",t[t.Mousemove=4]="Mousemove",t[t.Destroy=5]="Destroy"}(xs||(xs={}));const ws=["a","b","c","d","e","f"],Es={PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"},Ss={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:Es},Ts='<circle cx="25" cy="25" r="20"></circle>',Ms='<div class="f-spinner"><svg viewBox="0 0 50 50">'+Ts+Ts+"</svg></div>",As=t=>t&&null!==t&&t instanceof Element&&"nodeType"in t,Cs=(t,e)=>{t&&cs(e).forEach((e=>{t.classList.remove(e)}))},ks=(t,e)=>{t&&cs(e).forEach((e=>{t.classList.add(e)}))},Ps={a:1,b:0,c:0,d:1,e:0,f:0},Is=1e4,Ds="mousemove",Os="drag",Ls="content",zs="auto";let Rs=null,Fs=null;class Bs extends bs{get fits(){return this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1}get isTouchDevice(){return null===Fs&&(Fs=window.matchMedia("(hover: none)").matches),Fs}get isMobile(){return null===Rs&&(Rs=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),Rs}get panMode(){return this.options.panMode!==Ds||this.isTouchDevice?Os:Ds}get panOnlyZoomed(){const t=this.options.panOnlyZoomed;return t===zs?this.isTouchDevice:t}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){const{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option("minScale")||1}get fullScale(){const{contentRect:t}=this;return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){const{containerRect:t,contentRect:e}=this,i=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,i)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const t=this.content;return!!(t&&t instanceof HTMLImageElement)&&!t.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const t of ws){const e="e"==t||"f"===t?1e-4:1e-5;if(Math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){var n;if(super(e),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:xs.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},Ps)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},Ps)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error("Container Element Not Found");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},Bs.Plugins),i)),this.emit("attachPlugins"),this.emit("init");const r=this.content;if(r.addEventListener("load",this.onLoad),r.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){t.classList.add(this.cn("isLoading"));const e=ls(Ms);!t.contains(r)||r.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null===(n=r.parentElement)||void 0===n?void 0:n.insertBefore(e,r))||null}this.emit("beforeLoad")}else queueMicrotask((()=>{this.enable()}))}initContent(){const{container:t}=this,e=this.cn(Ls);let i=this.option(Ls)||t.querySelector(`.${e}`);if(i||(i=t.querySelector("img,picture")||t.firstElementChild,i&&ks(i,e)),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),!i)throw new Error("No content found");this.content=i}onLoad(){const{spinner:t,container:e,state:i}=this;t&&(t.remove(),this.spinner=null),this.option("spinner")&&e.classList.remove(this.cn("isLoading")),this.emit("afterLoad"),i===xs.Init?this.enable():this.updateMetrics()}onError(){this.state!==xs.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=xs.Error,this.emit("error"))}getNextScale(t){const{fullScale:e,targetScale:i,coverScale:n,maxScale:r,minScale:s}=this;let o=s;switch(t){case"toggleMax":o=i-s<.5*(r-s)?r:s;break;case"toggleCover":o=i-s<.5*(n-s)?n:s;break;case"toggleZoom":o=i-s<.5*(e-s)?e:s;break;case"iterateZoom":let t=[1,e,r].sort(((t,e)=>t-e)),a=t.findIndex((t=>t>i+1e-5));o=t[a]||1}return o}attachObserver(){var t;const e=()=>{const{container:t,containerRect:e}=this;return Math.abs(e.width-t.getBoundingClientRect().width)>.1||Math.abs(e.height-t.getBoundingClientRect().height)>.1};this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout((()=>{e()&&this.onResize(),this.updateTimer=null}),500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))}))),null===(t=this.resizeObserver)||void 0===t||t.observe(this.container)}detachObserver(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}attachEvents(){const{container:t}=this;t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new ps(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(Ds,this.onMouseMove)}detachEvents(){var t;const{container:e}=this;e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("wheel",this.onWheel,{passive:!1}),null===(t=this.pointerTracker)||void 0===t||t.stop(),this.pointerTracker=null,document.removeEventListener(Ds,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){this.setTargetForce();const t=this.friction,e=this.option("maxVelocity");for(const i of ws)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame((()=>this.animate())):this.stop("current")}setTargetForce(){for(const t of ws)"e"===t&&this.isBouncingX||"f"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){const{current:i}=this,n=i.e+t,r=i.f+e,s=this.getBounds(),{x:o,y:a}=s,l=o.min,c=o.max,h=a.min,u=a.max;let d=0,p=0;return l!==1/0&&n<l?d=l-n:c!==1/0&&n>c&&(d=c-n),h!==1/0&&r<h?p=h-r:u!==1/0&&r>u&&(p=u-r),Math.abs(d)<1e-4&&(d=0),Math.abs(p)<1e-4&&(p=0),Object.assign(Object.assign({},s),{xDiff:d,yDiff:p,inBounds:!d&&!p})}clampTargetBounds(){const{target:t}=this,{x:e,y:i}=this.getBounds();e.min!==1/0&&(t.e=Math.max(t.e,e.min)),e.max!==1/0&&(t.e=Math.min(t.e,e.max)),i.min!==1/0&&(t.f=Math.max(t.f,i.min)),i.max!==1/0&&(t.f=Math.min(t.f,i.max))}calculateContentDim(t=this.current){const{content:e,contentRect:i}=this,{fitWidth:n,fitHeight:r,fullWidth:s,fullHeight:o}=i;let a=s,l=o;if(this.option("zoom")||0!==this.angle){const i=!(e instanceof HTMLImageElement||"none"!==window.getComputedStyle(e).maxWidth&&"none"!==window.getComputedStyle(e).maxHeight),c=i?s:n,h=i?o:r,u=this.getMatrix(t),d=new DOMPoint(0,0).matrixTransform(u),p=new DOMPoint(0+c,0).matrixTransform(u),f=new DOMPoint(0+c,0+h).matrixTransform(u),m=new DOMPoint(0,0+h).matrixTransform(u),g=Math.abs(f.x-d.x),_=Math.abs(f.y-d.y),y=Math.abs(m.x-p.x),v=Math.abs(m.y-p.y);a=Math.max(g,y),l=Math.max(_,v)}return{contentWidth:a,contentHeight:l}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===Ds||this.targetScale<this.scale)return this.isBouncingX=!1,void(this.isBouncingY=!1);const{target:t}=this,{x:e,y:i,xDiff:n,yDiff:r}=this.checkBounds(),s=this.option("maxVelocity");let o=this.velocity.e,a=this.velocity.f;0!==n?(this.isBouncingX=!0,n*o<=0?o+=.14*n:(o=.14*n,e.min!==1/0&&(this.target.e=Math.max(t.e,e.min)),e.max!==1/0&&(this.target.e=Math.min(t.e,e.max))),s&&(o=Math.max(Math.min(o,s),-1*s))):this.isBouncingX=!1,0!==r?(this.isBouncingY=!0,r*a<=0?a+=.14*r:(a=.14*r,i.min!==1/0&&(this.target.f=Math.max(t.f,i.min)),i.max!==1/0&&(this.target.f=Math.min(t.f,i.max))),s&&(a=Math.max(Math.min(a,s),-1*s))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=o),this.isBouncingY&&(this.velocity.f=a)}enable(){const{content:t}=this,e=new DOMMatrixReadOnly(window.getComputedStyle(t).transform);for(const t of ws)this.current[t]=this.target[t]=e[t];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=xs.Ready,this.emit("ready")}onClick(t){var e;"click"===t.type&&0===t.detail&&(this.dragOffset.x=0,this.dragOffset.y=0),this.isDragging&&(null===(e=this.pointerTracker)||void 0===e||e.clear(),this.trackingPoints=[],this.startDecelAnim());const i=t.target;if(!i||t.defaultPrevented)return;if(i.hasAttribute("disabled"))return t.preventDefault(),void t.stopPropagation();if((()=>{const t=window.getSelection();return t&&"Range"===t.type})()&&!i.closest("button"))return;const n=i.closest("[data-panzoom-action]"),r=i.closest("[data-panzoom-change]"),s=n||r,o=s&&As(s)?s.dataset:null;if(o){const e=o.panzoomChange,i=o.panzoomAction;if((e||i)&&t.preventDefault(),e){let i={};try{i=JSON.parse(e)}catch(t){console&&console.warn("The given data was not valid JSON")}return void this.applyChange(i)}if(i)return void(this[i]&&this[i]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return t.preventDefault(),void t.stopPropagation();if(i.closest("[data-fancybox]"))return;const a=this.content.getBoundingClientRect(),l=this.dragStart;if(l.time&&!this.canZoomOut()&&(Math.abs(a.x-l.x)>2||Math.abs(a.y-l.y)>2))return;this.dragStart.time=0;const c=e=>{this.option("zoom",t)&&e&&"string"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&"function"==typeof this[e]&&(t.preventDefault(),this[e]({event:t}))},h=this.option("click",t),u=this.option("dblClick",t);u?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout((()=>{1===this.clicks?(this.emit("click",t),!t.defaultPrevented&&h&&c(h)):(this.emit("dblClick",t),t.defaultPrevented||c(u)),this.clicks=0,this.clickTimer=null}),350))):(this.emit("click",t),!t.defaultPrevented&&h&&c(h))}addTrackingPoint(t){const e=this.trackingPoints.filter((t=>t.time>Date.now()-100));e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){var n;if(!1===this.option("touch",t))return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const r=this.content.getBoundingClientRect();if(this.dragStart={x:r.x,y:r.y,top:r.top,left:r.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===Ds&&this.targetScale>1)return t.preventDefault(),t.stopPropagation(),!1;const s=t.composedPath()[0];if(!i.length){if(["TEXTAREA","OPTION","INPUT","SELECT","VIDEO","IFRAME"].includes(s.nodeName)||s.closest("[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]"))return!1;null===(n=window.getSelection())||void 0===n||n.removeAllRanges()}if("mousedown"===t.type)["A","BUTTON"].includes(s.nodeName)||t.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(e),this.emit("touchStart",t)),!0}onPointerMove(t,e,i){if(!1===this.option("touch",t))return;if(!this.isDragging)return;if(e.length<2&&this.panOnlyZoomed&&ss(this.targetScale)<=ss(this.minScale))return;if(this.emit("touchMove",t),t.defaultPrevented)return;this.addTrackingPoint(e[0]);const{content:n}=this,r=ms(i[0],i[1]),s=ms(e[0],e[1]);let o=0,a=0;if(e.length>1){const t=n.getBoundingClientRect();o=r.clientX-t.left-.5*t.width,a=r.clientY-t.top-.5*t.height}const l=fs(i[0],i[1]),c=fs(e[0],e[1]);let h=l?c/l:1,u=s.clientX-r.clientX,d=s.clientY-r.clientY;this.dragOffset.x+=u,this.dragOffset.y+=d,this.dragOffset.time=Date.now()-this.dragStart.time;let p=ss(this.targetScale)===ss(this.minScale)&&this.option("lockAxis");if(p&&!this.lockedAxis)if("xy"===p||"y"===p||"touchmove"===t.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void t.preventDefault();const e=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=e>45&&e<135?"y":"x",this.dragOffset.x=0,this.dragOffset.y=0,u=0,d=0}else this.lockedAxis=p;if(as(t.target,this.content)&&(p="x",this.dragOffset.y=0),p&&"xy"!==p&&this.lockedAxis!==p&&ss(this.targetScale)===ss(this.minScale))return;t.cancelable&&t.preventDefault(),this.container.classList.add(this.cn("isDragging"));const f=this.checkBounds(u,d);this.option("rubberband")?("x"!==this.isInfinite&&(f.xDiff>0&&u<0||f.xDiff<0&&u>0)&&(u*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*f.xDiff))),"y"!==this.isInfinite&&(f.yDiff>0&&d<0||f.yDiff<0&&d>0)&&(d*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*f.yDiff)))):(f.xDiff&&(u=0),f.yDiff&&(d=0));const m=this.targetScale,g=this.minScale,_=this.maxScale;m<.5*g&&(h=Math.max(h,g)),m>1.5*_&&(h=Math.min(h,_)),"y"===this.lockedAxis&&ss(m)===ss(g)&&(u=0),"x"===this.lockedAxis&&ss(m)===ss(g)&&(d=0),this.applyChange({originX:o,originY:a,panX:u,panY:d,scale:h,friction:this.option("dragFriction"),ignoreBounds:!0})}onPointerUp(t,e,i){if(i.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn("isDragging")),this.isDragging&&(this.addTrackingPoint(e),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),as(t.target,this.content)&&"y"===this.lockedAxis&&(this.trackingPoints=[]),this.emit("touchEnd",t),this.isDragging=!1,this.lockedAxis=!1,this.state!==xs.Destroy&&(t.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){var t;const e=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const t of ws)this.velocity[t]=0;this.target.e=this.current.e,this.target.f=this.current.f,Cs(this.container,"is-scaling"),Cs(this.container,"is-animating"),this.isTicking=!1;const{trackingPoints:i}=this,n=i[0],r=i[i.length-1];let s=0,o=0,a=0;r&&n&&(s=r.clientX-n.clientX,o=r.clientY-n.clientY,a=r.time-n.time);const l=(null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1;1!==l&&(s*=l,o*=l);let c=0,h=0,u=0,d=0,p=this.option("decelFriction");const f=this.targetScale;if(a>0){u=Math.abs(s)>3?s/(a/30):0,d=Math.abs(o)>3?o/(a/30):0;const t=this.option("maxVelocity");t&&(u=Math.max(Math.min(u,t),-1*t),d=Math.max(Math.min(d,t),-1*t))}u&&(c=u/(1/(1-p)-1)),d&&(h=d/(1/(1-p)-1)),("y"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"y"===this.lockedAxis&&ss(f)===this.minScale)&&(c=u=0),("x"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"x"===this.lockedAxis&&ss(f)===this.minScale)&&(h=d=0);const m=this.dragOffset.x,g=this.dragOffset.y,_=this.option("dragMinThreshold")||0;Math.abs(m)<_&&Math.abs(g)<_&&(c=h=0,u=d=0),(this.option("zoom")&&(f<this.minScale-1e-5||f>this.maxScale+1e-5)||e&&!c&&!h)&&(p=.35),this.applyChange({panX:c,panY:h,friction:p}),this.emit("decel",u,d,m,g)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const i=Math.max(-1,Math.min(1,e));if(this.emit("wheel",t,i),this.panMode===Ds)return;if(t.defaultPrevented)return;const n=this.option("wheel");"pan"===n?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):"zoom"===n&&!1!==this.option("zoom")&&this.zoomWithWheel(t)}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){"Escape"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit("beforeTransform");const{current:t,target:e,content:i,contentRect:n}=this,r=Object.assign({},Ps);for(const i of ws){const n="e"==i||"f"===i?Is:1e5;r[i]=ss(t[i],n),Math.abs(e[i]-t[i])<("e"==i||"f"===i?.51:.001)&&(t[i]=e[i])}let{a:s,b:o,c:a,d:l,e:c,f:h}=r,u=`matrix(${s}, ${o}, ${a}, ${l}, ${c}, ${h})`,d=i.parentElement instanceof HTMLPictureElement?i.parentElement:i;if(this.option("transformParent")&&(d=d.parentElement||d),d.style.transform===u)return;d.style.transform=u;const{contentWidth:p,contentHeight:f}=this.calculateContentDim();n.width=p,n.height=f,this.emit("afterTransform")}updateMetrics(t=!1){var e;if(!this||this.state===xs.Destroy)return;if(this.isContentLoading)return;const i=Math.max(1,(null===(e=window.visualViewport)||void 0===e?void 0:e.scale)||1),{container:n,content:r}=this,s=r instanceof HTMLImageElement,o=n.getBoundingClientRect(),a=getComputedStyle(this.container);let l=o.width*i,c=o.height*i;const h=parseFloat(a.paddingTop)+parseFloat(a.paddingBottom),u=l-(parseFloat(a.paddingLeft)+parseFloat(a.paddingRight)),d=c-h;this.containerRect={width:l,height:c,innerWidth:u,innerHeight:d};const p=parseFloat(r.dataset.width||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalWidth:t instanceof SVGElement?t.width.baseVal.value:Math.max(t.offsetWidth,t.scrollWidth),e||0})(r),f=parseFloat(r.dataset.height||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalHeight:t instanceof SVGElement?t.height.baseVal.value:Math.max(t.offsetHeight,t.scrollHeight),e||0})(r);let m=this.option("width",p)||zs,g=this.option("height",f)||zs;const _=m===zs,y=g===zs;"number"!=typeof m&&(m=p),"number"!=typeof g&&(g=f),_&&(m=p*(g/f)),y&&(g=f/(p/m));let v=r.parentElement instanceof HTMLPictureElement?r.parentElement:r;this.option("transformParent")&&(v=v.parentElement||v);const b=v.getAttribute("style")||"";v.style.setProperty("transform","none","important"),s&&(v.style.width="",v.style.height=""),v.offsetHeight;const x=r.getBoundingClientRect();let w=x.width*i,E=x.height*i,S=w,T=E;w=Math.min(w,m),E=Math.min(E,g),s?({width:w,height:E}=((t,e,i,n)=>{const r=i/t,s=n/e,o=Math.min(r,s);return{width:t*=o,height:e*=o}})(m,g,w,E)):(w=Math.min(w,m),E=Math.min(E,g));let M=.5*(T-E),A=.5*(S-w);this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:x.top-o.top+M,bottom:o.bottom-x.bottom+M,left:x.left-o.left+A,right:o.right-x.right+A,fitWidth:w,fitHeight:E,width:w,height:E,fullWidth:m,fullHeight:g}),v.style.cssText=b,s&&(v.style.width=`${w}px`,v.style.height=`${E}px`),this.setTransform(),!0!==t&&this.emit("refresh"),this.ignoreBounds||(ss(this.targetScale)<ss(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===xs.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}calculateBounds(){const{contentWidth:t,contentHeight:e}=this.calculateContentDim(this.target),{targetScale:i,lockedAxis:n}=this,{fitWidth:r,fitHeight:s}=this.contentRect;let o=0,a=0,l=0,c=0;const h=this.option("infinite");if(!0===h||n&&h===n)o=-1/0,l=1/0,a=-1/0,c=1/0;else{let{containerRect:n,contentRect:h}=this,u=ss(r*i,Is),d=ss(s*i,Is),{innerWidth:p,innerHeight:f}=n;if(n.width===u&&(p=n.width),n.width===d&&(f=n.height),t>p){l=.5*(t-p),o=-1*l;let e=.5*(h.right-h.left);o+=e,l+=e}if(r>p&&t<p&&(o-=.5*(r-p),l-=.5*(r-p)),e>f){c=.5*(e-f),a=-1*c;let t=.5*(h.bottom-h.top);a+=t,c+=t}s>f&&e<f&&(o-=.5*(s-f),l-=.5*(s-f))}return{x:{min:o,max:l},y:{min:a,max:c}}}getBounds(){const t=this.option("bounds");return t!==zs?t:this.calculateBounds()}updateControls(){const t=this,e=t.container,{panMode:i,contentRect:n,targetScale:r,minScale:s}=t;let o=s,a=t.option("click")||!1;a&&(o=t.getNextScale(a));let l=t.canZoomIn(),c=t.canZoomOut(),h=i===Os&&!!this.option("touch"),u=c&&h;if(h&&(ss(r)<ss(s)&&!this.panOnlyZoomed&&(u=!0),(ss(n.width,1)>ss(n.fitWidth,1)||ss(n.height,1)>ss(n.fitHeight,1))&&(u=!0)),ss(n.width*r,1)<ss(n.fitWidth,1)&&(u=!1),i===Ds&&(u=!1),hs(e,this.cn("isDraggable"),u),!this.option("zoom"))return;let d=l&&ss(o)>ss(r),p=!d&&!u&&c&&ss(o)<ss(r);hs(e,this.cn("canZoomIn"),d),hs(e,this.cn("canZoomOut"),p);for(const t of e.querySelectorAll("[data-panzoom-action]")){let e=!1,i=!1;switch(t.dataset.panzoomAction){case"zoomIn":l?e=!0:i=!0;break;case"zoomOut":c?e=!0:i=!0;break;case"toggleZoom":case"iterateZoom":l||c?e=!0:i=!0;const n=t.querySelector("g");n&&(n.style.display=l?"":"none")}e?(t.removeAttribute("disabled"),t.removeAttribute("tabindex")):i&&(t.setAttribute("disabled",""),t.setAttribute("tabindex","-1"))}}panTo({x:t=this.target.e,y:e=this.target.f,scale:i=this.targetScale,friction:n=this.option("friction"),angle:r=0,originX:s=0,originY:o=0,flipX:a=!1,flipY:l=!1,ignoreBounds:c=!1}){this.state!==xs.Destroy&&this.applyChange({panX:t-this.target.e,panY:e-this.target.f,scale:i/this.targetScale,angle:r,originX:s,originY:o,friction:n,flipX:a,flipY:l,ignoreBounds:c})}applyChange({panX:t=0,panY:e=0,scale:i=1,angle:n=0,originX:r=-this.current.e,originY:s=-this.current.f,friction:o=this.option("friction"),flipX:a=!1,flipY:l=!1,ignoreBounds:c=!1,bounce:h=this.option("bounce")}){const u=this.state;if(u===xs.Destroy)return;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=o||0,this.ignoreBounds=c;const{current:d}=this,p=d.e,f=d.f,m=this.getMatrix(this.target);let g=(new DOMMatrix).translate(p,f).translate(r,s).translate(t,e);if(this.option("zoom")){if(!c){const t=this.targetScale,e=this.minScale,n=this.maxScale;t*i<e&&(i=e/t),t*i>n&&(i=n/t)}g=g.scale(i)}g=g.translate(-r,-s).translate(-p,-f).multiply(m),n&&(g=g.rotate(n)),a&&(g=g.scale(-1,1)),l&&(g=g.scale(1,-1));for(const t of ws)"e"!==t&&"f"!==t&&(g[t]>this.minScale+1e-5||g[t]<this.minScale-1e-5)?this.target[t]=g[t]:this.target[t]=ss(g[t],Is);(this.targetScale<this.scale||Math.abs(i-1)>.1||this.panMode===Ds||!1===h)&&!c&&this.clampTargetBounds(),u===xs.Init?this.animate():this.isResting||(this.state=xs.Panning,this.requestTick())}stop(t=!1){if(this.state===xs.Init||this.state===xs.Destroy)return;const e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const e of ws)this.velocity[e]=0,"current"===t?this.current[e]=this.target[e]:"target"===t&&(this.target[e]=this.current[e]);this.setTransform(),Cs(this.container,"is-scaling"),Cs(this.container,"is-animating"),this.isTicking=!1,this.state=xs.Ready,e&&(this.emit("endAnimation"),this.updateControls())}requestTick(){this.isTicking||(this.emit("startAnimation"),this.updateControls(),ks(this.container,"is-animating"),this.isScaling&&ks(this.container,"is-scaling")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame((()=>this.animate())))}panWithMouse(t,e=this.option("mouseMoveFriction")){if(this.pmme=t,this.panMode!==Ds||!t)return;if(ss(this.targetScale)<=ss(this.minScale))return;this.emit("mouseMove",t);const{container:i,containerRect:n,contentRect:r}=this,s=n.width,o=n.height,a=i.getBoundingClientRect(),l=(t.clientX||0)-a.left,c=(t.clientY||0)-a.top;let{contentWidth:h,contentHeight:u}=this.calculateContentDim(this.target);const d=this.option("mouseMoveFactor");d>1&&(h!==s&&(h*=d),u!==o&&(u*=d));let p=.5*(h-s)-l/s*100/100*(h-s);p+=.5*(r.right-r.left);let f=.5*(u-o)-c/o*100/100*(u-o);f+=.5*(r.bottom-r.top),this.applyChange({panX:p-this.target.e,panY:f-this.target.f,friction:e})}zoomWithWheel(t){if(this.state===xs.Destroy||this.state===xs.Init)return;const e=Date.now();if(e-this.pwt<45)return void t.preventDefault();this.pwt=e;var i=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const n=Math.max(-1,Math.min(1,i)),{targetScale:r,maxScale:s,minScale:o}=this;let a=r*(100+45*n)/100;ss(a)<ss(o)&&ss(r)<=ss(o)?(this.cwd+=Math.abs(n),a=o):ss(a)>ss(s)&&ss(r)>=ss(s)?(this.cwd+=Math.abs(n),a=s):(this.cwd=0,a=Math.max(Math.min(a,s),o)),this.cwd>this.option("wheelLimit")||(t.preventDefault(),ss(a)!==ss(r)&&this.zoomTo(a,{event:t}))}canZoomIn(){return this.option("zoom")&&(ss(this.contentRect.width,1)<ss(this.contentRect.fitWidth,1)||ss(this.targetScale)<ss(this.maxScale))}canZoomOut(){return this.option("zoom")&&ss(this.targetScale)>ss(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo("fit",t)}zoomToCover(t){this.zoomTo("cover",t)}zoomToFull(t){this.zoomTo("full",t)}zoomToMax(t){this.zoomTo("max",t)}toggleZoom(t){this.zoomTo(this.getNextScale("toggleZoom"),t)}toggleMax(t){this.zoomTo(this.getNextScale("toggleMax"),t)}toggleCover(t){this.zoomTo(this.getNextScale("toggleCover"),t)}iterateZoom(t){this.zoomTo("next",t)}zoomTo(t=1,{friction:e=zs,originX:i=zs,originY:n=zs,event:r}={}){if(this.isContentLoading||this.state===xs.Destroy)return;const{targetScale:s,fullScale:o,maxScale:a,coverScale:l}=this;if(this.stop(),this.panMode===Ds&&(r=this.pmme||r),r||i===zs||n===zs){const t=this.content.getBoundingClientRect(),e=this.container.getBoundingClientRect(),s=r?r.clientX:e.left+.5*e.width,o=r?r.clientY:e.top+.5*e.height;i=s-t.left-.5*t.width,n=o-t.top-.5*t.height}let c=1;"number"==typeof t?c=t:"full"===t?c=o:"cover"===t?c=l:"max"===t?c=a:"fit"===t?c=1:"next"===t&&(c=this.getNextScale("iterateZoom")),c=c/s||1,e=e===zs?c>1?.15:.25:e,this.applyChange({scale:c,originX:i,originY:n,friction:e}),r&&this.panMode===Ds&&this.panWithMouse(r,e)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.height-(e.top+.5*e.fitHeight)-i.f,scale:t.width/e.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.innerHeight-(e.top+.5*e.fitHeight)-i.f,scale:t.height/e.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:t}=this,e=this.cn("inFullscreen"),i=this.cn("htmlHasFullscreen");t.classList.toggle(e);const n=t.classList.contains(e);n?(document.documentElement.classList.add(i),document.addEventListener("keydown",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener("keydown",this.onKeydown,!0)),this.updateMetrics(),this.emit(n?"enterFS":"exitFS")}getMatrix(t=this.current){const{a:e,b:i,c:n,d:r,e:s,f:o}=t;return new DOMMatrix([e,i,n,r,s,o])}reset(t){if(this.state!==xs.Init&&this.state!==xs.Destroy){this.stop("current");for(const t of ws)this.target[t]=Ps[t];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===t?this.option("friction"):t,this.state=xs.Panning,this.requestTick())}}destroy(){this.stop(),this.state=xs.Destroy,this.detachEvents(),this.detachObserver();const{container:t,content:e}=this,i=this.option("classes")||{};for(const e of Object.values(i))t.classList.remove(e+"");e&&(e.removeEventListener("load",this.onLoad),e.removeEventListener("error",this.onError)),this.detachPlugins()}}Object.defineProperty(Bs,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Ss}),Object.defineProperty(Bs,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});const Ns=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),setTimeout((()=>{i=!0}),e))}},js=(t,e)=>{let i=[];return t.childNodes.forEach((t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)})),i};var Vs;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Destroy=2]="Destroy"}(Vs||(Vs={}));const Us=t=>{if("string"==typeof t||t instanceof HTMLElement)t={html:t};else{const e=t.thumb;void 0!==e&&("string"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb)}return Object.assign({html:"",el:null,isDom:!1,class:"",customClass:"",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},$s=(t={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},t);class Hs extends vs{constructor(t,e){super(e),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}class qs extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;if(!t){t=document.createElement("ul"),ks(t,this.cn("list")),t.setAttribute("role","tablist");const e=this.instance.container;e.appendChild(t),ks(e,this.cn("hasDots")),this.list=t}return t}refresh(){var t;const e=this.instance.pages.length,i=Math.min(2,this.option("minCount")),n=Math.max(2e3,this.option("maxCount")),r=this.option("dynamicFrom");if(e<i||e>n)return void this.cleanup();const s="number"==typeof r&&e>5&&e>=r,o=!this.list||this.isDynamic!==s||this.list.children.length!==e;o&&this.cleanup();const a=this.build();if(hs(a,this.cn("isDynamic"),!!s),o)for(let t=0;t<e;t++)a.append(this.createItem(t));let l,c=0;for(const e of[...a.children]){const i=c===this.instance.page;i&&(l=e),hs(e,this.cn("isCurrent"),i),null===(t=e.children[0])||void 0===t||t.setAttribute("aria-selected",i?"true":"false");for(const t of["isBeforePrev","isPrev","isNext","isAfterNext"])Cs(e,this.cn(t));c++}if(l=l||a.firstChild,s&&l){const t=l.previousElementSibling,e=t&&t.previousElementSibling;ks(t,this.cn("isPrev")),ks(e,this.cn("isBeforePrev"));const i=l.nextElementSibling,n=i&&i.nextElementSibling;ks(i,this.cn("isNext")),ks(n,this.cn("isAfterNext"))}this.isDynamic=s}createItem(t=0){var e;const i=document.createElement("li");i.setAttribute("role","presentation");const n=ls(this.instance.localize(this.option("dotTpl"),[["%d",t+1]]).replace(/\%i/g,t+""));return i.appendChild(n),null===(e=i.children[0])||void 0===e||e.setAttribute("role","tab"),i}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,Cs(this.instance.container,this.cn("hasDots"))}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(qs,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{list:"f-carousel__dots",isDynamic:"is-dynamic",hasDots:"has-dots",dot:"f-carousel__dot",isBeforePrev:"is-before-prev",isPrev:"is-prev",isCurrent:"is-current",isNext:"is-next",isAfterNext:"is-after-next"},dotTpl:'<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2}});const Ws="disabled",Gs="next",Zs="prev";class Ys extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isDom",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onRefresh(){const t=this.instance,e=t.pages.length,i=t.page;if(e<2)return void this.cleanup();this.build();let n=this.prev,r=this.next;n&&r&&(n.removeAttribute(Ws),r.removeAttribute(Ws),t.isInfinite||(i<=0&&n.setAttribute(Ws,""),i>=e-1&&r.setAttribute(Ws,"")))}addBtn(t){var e;const i=this.instance,n=document.createElement("button");n.setAttribute("tabindex","0"),n.setAttribute("title",i.localize(`{{${t.toUpperCase()}}}`)),ks(n,this.cn("button")+" "+this.cn(t===Gs?"isNext":"isPrev"));const r=i.isRTL?t===Gs?Zs:Gs:t;var s;return n.innerHTML=i.localize(this.option(`${r}Tpl`)),n.dataset[`carousel${s=t,s?s.match("^[a-z]")?s.charAt(0).toUpperCase()+s.substring(1):s:""}`]="true",null===(e=this.container)||void 0===e||e.appendChild(n),n}build(){const t=this.instance.container,e=this.cn("container");let{container:i,prev:n,next:r}=this;i||(i=t.querySelector("."+e),this.isDom=!!i),i||(i=document.createElement("div"),ks(i,e),t.appendChild(i)),this.container=i,r||(r=i.querySelector("[data-carousel-next]")),r||(r=this.addBtn(Gs)),this.next=r,n||(n=i.querySelector("[data-carousel-prev]")),n||(n=this.addBtn(Zs)),this.prev=n}cleanup(){this.isDom||(this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove()),this.prev=null,this.next=null,this.container=null,this.isDom=!1}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(Ys,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>',prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>'}});class Xs extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){const{nav:t,target:e}=this;t&&e&&(t.options.initialSlide=e.options.initialPage,t.state===Vs.Ready?this.onNavReady(t):t.on("ready",this.onNavReady),e.state===Vs.Ready?this.onTargetReady(e):e.on("ready",this.onTargetReady))}onNavReady(t){t.on("createSlide",this.onNavCreateSlide),t.on("Panzoom.click",this.onNavClick),t.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on("change",this.onTargetChange),t.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n,r;if(Math.abs(e.dragOffset.x)>3||Math.abs(e.dragOffset.y)>3)return;const s=i.target,{nav:o,target:a}=this;if(!o||!a||!s)return;const l=s.closest("[data-index]");if(i.stopPropagation(),i.preventDefault(),!l)return;const c=parseInt(l.dataset.index||"",10)||0,h=a.getPageForSlide(c),u=o.getPageForSlide(c);o.slideTo(u),a.slideTo(h,{friction:(null===(r=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===r?void 0:r.Sync.option("friction"))||0}),this.markSelectedSlide(c)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){var t,e;const{target:i,nav:n}=this;if(!i||!n)return;if(n.state!==Vs.Ready||i.state!==Vs.Ready)return;const r=null===(e=null===(t=i.pages[i.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index,s=n.getPageForSlide(r);this.markSelectedSlide(r),n.slideTo(s,null===n.prevPage&&null===i.prevPage?{friction:0}:void 0)}markSelectedSlide(t){const e=this.nav;e&&e.state===Vs.Ready&&(this.selectedIndex=t,[...e.slides].map((e=>{e.el&&e.el.classList[e.index===t?"add":"remove"]("is-nav-selected")})))}attach(){const t=this;let e=t.options.target,i=t.options.nav;e?t.addAsNavFor(e):i&&t.addAsTargetFor(i)}detach(){const t=this,e=t.nav,i=t.target;e&&(e.off("ready",t.onNavReady),e.off("createSlide",t.onNavCreateSlide),e.off("Panzoom.click",t.onNavClick),e.off("Panzoom.touchEnd",t.onNavTouch)),t.nav=null,i&&(i.off("ready",t.onTargetReady),i.off("refresh",t.onTargetChange),i.off("change",t.onTargetChange)),t.target=null}}Object.defineProperty(Xs,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const Ks={Navigation:Ys,Dots:qs,Sync:Xs},Qs="animationend",Js="isSelected",to="slide";class eo extends bs{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===Vs.Ready}get isInfinite(){let t=!1;const{contentDim:e,viewportDim:i,pages:n,slides:r}=this,s=r[0];return n.length>=2&&s&&e+s.dim>=i&&(t=this.option("infinite")),t}get isRTL(){return"rtl"===this.option("direction")}get isHorizontal(){return"x"===this.option("axis")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Vs.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),"string"==typeof t&&(t=document.querySelector(t)),!t||!As(t))throw new Error("No Element found");this.container=t,this.slideNext=Ns(this.slideNext.bind(this),150),this.slidePrev=Ns(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask((()=>{this.processOptions()}))}processOptions(){var t,e;const i=_s({},eo.defaults,this.userOptions);let n="";const r=i.breakpoints;if(r&&gs(r))for(const[t,e]of Object.entries(r))window.matchMedia(t).matches&&gs(e)&&(n+=t,_s(i,e));n===this.bp&&this.state!==Vs.Init||(this.bp=n,this.state===Vs.Ready&&(i.initialSlide=(null===(e=null===(t=this.pages[this.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index)||0),this.state!==Vs.Init&&this.destroy(),super.setOptions(i),!1===this.option("enabled")?this.attachEvents():setTimeout((()=>{this.init()}),0))}init(){this.state=Vs.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},eo.Plugins),this.userPlugins)),this.emit("attachPlugins"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=Vs.Ready,this.emit("ready")}initLayout(){const{container:t}=this,e=this.option("classes");ks(t,this.cn("container")),hs(t,e.isLTR,!this.isRTL),hs(t,e.isRTL,this.isRTL),hs(t,e.isVertical,!this.isHorizontal),hs(t,e.isHorizontal,this.isHorizontal);let i=this.option("viewport")||t.querySelector(`.${e.viewport}`);i||(i=document.createElement("div"),ks(i,e.viewport),i.append(...js(t,`.${e.slide}`)),t.prepend(i)),i.addEventListener("scroll",this.onScroll);let n=this.option("track")||t.querySelector(`.${e.track}`);n||(n=document.createElement("div"),ks(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute("aria-live","polite"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit("initLayout")}initSlides(){const{track:t}=this;if(!t)return;const e=[...this.slides],i=[];[...js(t,`.${this.cn(to)}`)].forEach((t=>{if(As(t)){const e=Us({el:t,isDom:!0,index:this.slides.length});i.push(e)}}));for(let t of[...this.option("slides",[])||[],...e])i.push(Us(t));this.slides=i;for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;for(const t of i)this.emit("beforeInitSlide",t,t.index),this.emit("initSlide",t,t.index);this.emit("initSlides")}setInitialPage(){const t=this.option("initialSlide");this.page="number"==typeof t?this.getPageForSlide(t):parseInt(this.option("initialPage",0)+"",10)||0}setInitialPosition(){const{track:t,pages:e,isHorizontal:i}=this;if(!t||!e.length)return;let n=this.page;e[n]||(this.page=n=0);const r=(e[n].pos||0)*(this.isRTL&&i?1:-1),s=i?`${r}px`:"0",o=i?"0":`${r}px`;t.style.transform=`translate3d(${s}, ${o}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option("Panzoom")||{};this.panzoom=new Bs(this.viewport,_s({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on("*",((t,e,...i)=>{this.emit(`Panzoom.${e}`,t,...i)})),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option("slidesPerPage");n=("auto"===n||e<=i)&&!1!==this.option("fill")?1/0:parseFloat(n+"");let r=0,s=0,o=0;for(const e of this.slides)(!t.length||s+e.dim-i>.05||o>=n)&&(t.push($s()),r=t.length-1,s=0,o=0),t[r].slides.push(e),s+=e.dim+e.gap,o++;return t}processPages(){const t=this.pages,{contentDim:e,viewportDim:i,isInfinite:n}=this,r=this.option("center"),s=this.option("fill"),o=s&&r&&e>i&&!n;if(t.forEach(((t,n)=>{var s;t.index=n,t.pos=(null===(s=t.slides[0])||void 0===s?void 0:s.pos)||0,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e<t.slides.length-1&&(t.dim+=i.gap);o&&t.pos+.5*t.dim<.5*i?t.pos=0:o&&t.pos+.5*t.dim>=e-.5*i?t.pos=e-i:r&&(t.pos+=-.5*(i-t.dim))})),t.forEach((t=>{s&&!n&&e>i&&(t.pos=Math.max(t.pos,0),t.pos=Math.min(t.pos,e-i)),t.pos=ss(t.pos,1e3),t.dim=ss(t.dim,1e3),Math.abs(t.pos)<=.1&&(t.pos=0)})),n)return t;const a=[];let l;return t.forEach((t=>{const e=Object.assign({},t);l&&e.pos===l.pos?(l.dim+=e.dim,l.slides=[...l.slides,...e.slides]):(e.index=a.length,l=e,a.push(e))})),a}getPageFromIndex(t=0){const e=this.pages.length;let i;return t=parseInt((t||0).toString())||0,i=this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0),i}getSlideMetrics(t){var e,i;const n=this.isHorizontal?"width":"height";let r=0,s=0,o=t.el;const a=!(!o||o.parentNode);if(o?r=parseFloat(o.dataset[n]||"")||0:(o=document.createElement("div"),o.style.visibility="hidden",(this.track||document.body).prepend(o)),ks(o,this.cn(to)+" "+t.class+" "+t.customClass),r)o.style[n]=`${r}px`,o.style["width"===n?"height":"width"]="";else{a&&(this.track||document.body).prepend(o),r=o.getBoundingClientRect()[n]*Math.max(1,(null===(e=window.visualViewport)||void 0===e?void 0:e.scale)||1);let t=o[this.isHorizontal?"offsetWidth":"offsetHeight"];t-1>r&&(r=t)}const l=getComputedStyle(o);return"content-box"===l.boxSizing&&(this.isHorizontal?(r+=parseFloat(l.paddingLeft)||0,r+=parseFloat(l.paddingRight)||0):(r+=parseFloat(l.paddingTop)||0,r+=parseFloat(l.paddingBottom)||0)),s=parseFloat(l[this.isHorizontal?"marginRight":"marginBottom"])||0,a?null===(i=o.parentElement)||void 0===i||i.removeChild(o):t.el||o.remove(),{dim:ss(r,1e3),gap:ss(s,1e3)}}getBounds(){const{isInfinite:t,isRTL:e,isHorizontal:i,pages:n}=this;let r={min:0,max:0};if(t)r={min:-1/0,max:1/0};else if(n.length){const t=n[0].pos,s=n[n.length-1].pos;r=e&&i?{min:t,max:s}:{min:-1*s,max:-1*t}}return{x:i?r:{min:0,max:0},y:i?{min:0,max:0}:r}}repositionSlides(){let t,{isHorizontal:e,isRTL:i,isInfinite:n,viewport:r,viewportDim:s,contentDim:o,page:a,pages:l,slides:c,panzoom:h}=this,u=0,d=0,p=0,f=0;h?f=-1*h.current[this.axis]:l[a]&&(f=l[a].pos||0),t=e?i?"right":"left":"top",i&&e&&(f*=-1);for(const e of c){const i=e.el;i?("top"===t?(i.style.right="",i.style.left=""):i.style.top="",e.index!==u?i.style[t]=0===d?"":`${ss(d,1e3)}px`:i.style[t]="",p+=e.dim+e.gap,u++):d+=e.dim+e.gap}if(n&&p&&r){let i=getComputedStyle(r),n="padding",a=e?"Right":"Bottom",l=parseFloat(i[n+(e?"Left":"Top")]);f-=l,s+=l,s+=parseFloat(i[n+a]);for(const e of c)e.el&&(ss(e.pos)<ss(s)&&ss(e.pos+e.dim+e.gap)<ss(f)&&ss(f)>ss(o-s)&&(e.el.style[t]=`${ss(d+p,1e3)}px`),ss(e.pos+e.gap)>=ss(o-s)&&ss(e.pos)>ss(f+s)&&ss(f)<ss(s)&&(e.el.style[t]=`-${ss(p,1e3)}px`))}let m,g,_=[...this.inTransition];if(_.length>1&&(m=l[_[0]],g=l[_[1]]),m&&g){let e=0;for(const i of c)i.el?this.inTransition.has(i.index)&&m.slides.indexOf(i)<0&&(i.el.style[t]=`${ss(e+(m.pos-g.pos),1e3)}px`):e+=i.dim+i.gap}}createSlideEl(t){const{track:e,slides:i}=this;if(!e||!t)return;if(t.el&&t.el.parentNode)return;const n=t.el||document.createElement("div");ks(n,this.cn(to)),ks(n,t.class),ks(n,t.customClass);const r=t.html;r&&(r instanceof HTMLElement?n.appendChild(r):n.innerHTML=t.html+"");const s=[];i.forEach(((t,e)=>{t.el&&s.push(e)}));const o=t.index;let a=null;s.length&&(a=i[s.reduce(((t,e)=>Math.abs(e-o)<Math.abs(t-o)?e:t))]);const l=a&&a.el&&a.el.parentNode?a.index<t.index?a.el.nextSibling:a.el:null;e.insertBefore(n,e.contains(l)?l:null),t.el=n,this.emit("createSlide",t)}removeSlideEl(t,e=!1){const i=null==t?void 0:t.el;if(!i||!i.parentNode)return;const n=this.cn(Js);if(i.classList.contains(n)&&(Cs(i,n),this.emit("unselectSlide",t)),t.isDom&&!e)return i.removeAttribute("aria-hidden"),i.removeAttribute("data-index"),void(i.style.left="");this.emit("removeSlide",t);const r=new CustomEvent(Qs);i.dispatchEvent(r),t.el&&(t.el.remove(),t.el=null)}transitionTo(t=0,e=this.option("transition")){var i,n,r,s;if(!e)return!1;const o=this.page,{pages:a,panzoom:l}=this;t=parseInt((t||0).toString())||0;const c=this.getPageFromIndex(t);if(!l||!a[c]||a.length<2||Math.abs(((null===(n=null===(i=a[o])||void 0===i?void 0:i.slides[0])||void 0===n?void 0:n.dim)||0)-this.viewportDim)>1)return!1;let h=t>o?1:-1;this.isInfinite&&(0===o&&t===a.length-1&&(h=-1),o===a.length-1&&0===t&&(h=1));const u=a[c].pos*(this.isRTL?1:-1);if(o===c&&Math.abs(u-l.target[this.axis])<1)return!1;this.clearTransitions();const d=l.isResting;ks(this.container,this.cn("inTransition"));const p=(null===(r=a[o])||void 0===r?void 0:r.slides[0])||null,f=(null===(s=a[c])||void 0===s?void 0:s.slides[0])||null;this.inTransition.add(f.index),this.createSlideEl(f);let m=p.el,g=f.el;d||e===to||(e="fadeFast",m=null);const _=this.isRTL?"next":"prev",y=this.isRTL?"prev":"next";return m&&(this.inTransition.add(p.index),p.transition=e,m.addEventListener(Qs,this.onAnimationEnd),m.classList.add(`f-${e}Out`,`to-${h>0?y:_}`)),g&&(f.transition=e,g.addEventListener(Qs,this.onAnimationEnd),g.classList.add(`f-${e}In`,`from-${h>0?_:y}`)),l.current[this.axis]=u,l.target[this.axis]=u,l.requestTick(),this.onChange(c),!0}manageSlideVisiblity(){const t=new Set,e=new Set,i=this.getVisibleSlides(parseFloat(this.option("preload",0)+"")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.inTransition)t.add(this.slides[e]);for(const e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(const i of e)t.has(i)||this.removeSlideEl(i);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t="aria-hidden";let e=this.cn(Js);if(e)for(const i of this.slides){const n=i.el;n&&(n.dataset.index=`${i.index}`,n.classList.contains("f-thumbs__slide")?this.getVisibleSlides(0).has(i)?n.removeAttribute(t):n.setAttribute(t,"true"):this.pages[this.page].slides.includes(i)?(n.classList.contains(e)||(ks(n,e),this.emit("selectSlide",i)),n.removeAttribute(t)):(n.classList.contains(e)&&(Cs(n,e),this.emit("unselectSlide",i)),n.setAttribute(t,"true")))}}flipInfiniteTrack(){const{axis:t,isHorizontal:e,isInfinite:i,isRTL:n,viewportDim:r,contentDim:s}=this,o=this.panzoom;if(!o||!i)return;let a=o.current[t],l=o.target[t]-a,c=0,h=.5*r;n&&e?(a<-h&&(c=-1,a+=s),a>s-h&&(c=1,a-=s)):(a>h&&(c=1,a-=s),a<-s+h&&(c=-1,a+=s)),c&&(o.current[t]=a,o.target[t]=a+l)}lazyLoadImg(t,e){const i=this,n="f-fadeIn",r="is-preloading";let s=!1,o=null;const a=()=>{s||(s=!0,o&&(o.remove(),o=null),Cs(e,r),e.complete&&(ks(e,n),setTimeout((()=>{Cs(e,n)}),350)),this.option("adaptiveHeight")&&t.el&&this.pages[this.page].slides.indexOf(t)>-1&&(i.updateMetrics(),i.setViewportHeight()),this.emit("load",t))};ks(e,r),e.src=e.dataset.lazySrcset||e.dataset.lazySrc||"",delete e.dataset.lazySrc,delete e.dataset.lazySrcset,e.addEventListener("error",(()=>{a()})),e.addEventListener("load",(()=>{a()})),setTimeout((()=>{const i=e.parentNode;i&&t.el&&(e.complete?a():s||(o=ls(Ms),i.insertBefore(o,e)))}),300)}lazyLoadSlide(t){const e=t&&t.el;if(!e)return;const i=new Set;let n=Array.from(e.querySelectorAll("[data-lazy-src],[data-lazy-srcset]"));e.dataset.lazySrc&&n.push(e),n.map((t=>{t instanceof HTMLImageElement?i.add(t):t instanceof HTMLElement&&t.dataset.lazySrc&&(t.style.backgroundImage=`url('${t.dataset.lazySrc}')`,delete t.dataset.lazySrc)}));for(const e of i)this.lazyLoadImg(t,e)}onAnimationEnd(t){var e;const i=t.target,n=i?parseInt(i.dataset.index||"",10)||0:-1,r=this.slides[n],s=t.animationName;if(!i||!r||!s)return;const o=!!this.inTransition.has(n)&&r.transition;o&&s.substring(0,o.length+2)===`f-${o}`&&this.inTransition.delete(n),this.inTransition.size||this.clearTransitions(),n===this.page&&(null===(e=this.panzoom)||void 0===e?void 0:e.isResting)&&this.emit("settle")}onDecel(t,e=0,i=0,n=0,r=0){if(this.option("dragFree"))return void this.setPageFromPosition();const{isRTL:s,isHorizontal:o,axis:a,pages:l}=this,c=l.length,h=Math.abs(Math.atan2(i,e)/(Math.PI/180));let u=0;if(u=h>45&&h<135?o?0:i:o?e:0,!c)return;let d=this.page,p=s&&o?1:-1;const f=t.current[a]*p;let{pageIndex:m}=this.getPageFromPosition(f);Math.abs(u)>5?(l[d].dim<document.documentElement["client"+(this.isHorizontal?"Width":"Height")]-1&&(d=m),d=s&&o?u<0?d-1:d+1:u<0?d+1:d-1):d=0===n&&0===r?d:m,this.slideTo(d,{transition:!1,friction:t.option("decelFriction")})}onClick(t){const e=t.target,i=e&&As(e)?e.dataset:null;let n,r;i&&(void 0!==i.carouselPage?(r="slideTo",n=i.carouselPage):void 0!==i.carouselNext?r="slideNext":void 0!==i.carouselPrev&&(r="slidePrev")),r?(t.preventDefault(),t.stopPropagation(),e&&!e.hasAttribute("disabled")&&this[r](n)):this.emit("click",t)}onSlideTo(t){const e=t.detail||0;this.slideTo(this.getPageForSlide(e),{friction:0})}onChange(t,e=0){const i=this.page;this.prevPage=i,this.page=t,this.option("adaptiveHeight")&&this.setViewportHeight(),t!==i&&(this.markSelectedSlides(),this.emit("change",t,i,e))}onRefresh(){let t=this.contentDim,e=this.viewportDim;this.updateMetrics(),this.contentDim===t&&this.viewportDim===e||this.slideTo(this.page,{friction:0,transition:!1})}onScroll(){var t;null===(t=this.viewport)||void 0===t||t.scroll(0,0)}onResize(){this.option("breakpoints")&&this.processOptions()}onBeforeTransform(t){this.lp!==t.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=t.current.e}onEndAnimation(){this.inTransition.size||this.emit("settle")}reInit(t=null,e=null){this.destroy(),this.state=Vs.Init,this.prevPage=null,this.userOptions=t||this.userOptions,this.userPlugins=e||this.userPlugins,this.processOptions()}slideTo(t=0,{friction:e=this.option("friction"),transition:i=this.option("transition")}={}){if(this.state===Vs.Destroy)return;t=parseInt((t||0).toString())||0;const n=this.getPageFromIndex(t),{axis:r,isHorizontal:s,isRTL:o,pages:a,panzoom:l}=this,c=a.length,h=o&&s?1:-1;if(!l||!c)return;if(this.page!==n){const e=new Event("beforeChange",{bubbles:!0,cancelable:!0});if(this.emit("beforeChange",e,t),e.defaultPrevented)return}if(this.transitionTo(t,i))return;let u=a[n].pos;if(this.isInfinite){const e=this.contentDim,i=l.target[r]*h;2===c?u+=e*Math.floor(parseFloat(t+"")/2):u=[u,u-e,u+e].reduce((function(t,e){return Math.abs(e-i)<Math.abs(t-i)?e:t}))}u*=h,Math.abs(l.target[r]-u)<1||(l.panTo({x:s?u:0,y:s?0:u,friction:e}),this.onChange(n))}slideToClosest(t){if(this.panzoom){const{pageIndex:e}=this.getPageFromPosition();this.slideTo(e,t)}}slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),Cs(this.container,this.cn("inTransition"));const t=["to-prev","to-next","from-prev","from-next"];for(const e of this.slides){const i=e.el;if(i){i.removeEventListener(Qs,this.onAnimationEnd),i.classList.remove(...t);const n=e.transition;n&&i.classList.remove(`f-${n}Out`,`f-${n}In`)}}this.manageSlideVisiblity()}addSlide(t,e){var i,n,r,s;const o=this.panzoom,a=(null===(i=this.pages[this.page])||void 0===i?void 0:i.pos)||0,l=(null===(n=this.pages[this.page])||void 0===n?void 0:n.dim)||0,c=this.contentDim<this.viewportDim;let h=Array.isArray(e)?e:[e];const u=[];for(const t of h)u.push(Us(t));this.slides.splice(t,0,...u);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;for(const t of u)this.emit("beforeInitSlide",t,t.index);if(this.page>=t&&(this.page+=u.length),this.updateMetrics(),o){const e=(null===(r=this.pages[this.page])||void 0===r?void 0:r.pos)||0,i=(null===(s=this.pages[this.page])||void 0===s?void 0:s.dim)||0,n=this.pages.length||1,h=this.isRTL?l-i:i-l,u=this.isRTL?a-e:e-a;c&&1===n?(t<=this.page&&(o.current[this.axis]-=h,o.target[this.axis]-=h),o.panTo({[this.isHorizontal?"x":"y"]:-1*e})):u&&t<=this.page&&(o.target[this.axis]-=u,o.current[this.axis]-=u,o.requestTick())}for(const t of u)this.emit("initSlide",t,t.index)}prependSlide(t){this.addSlide(0,t)}appendSlide(t){this.addSlide(this.slides.length,t)}removeSlide(t){const e=this.slides.length;t=(t%e+e)%e;const i=this.slides[t];if(i){this.removeSlideEl(i,!0),this.slides.splice(t,1);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1}),this.emit("destroySlide",i)}}updateMetrics(){const{panzoom:t,viewport:e,track:i,slides:n,isHorizontal:r,isInfinite:s}=this;if(!i)return;const o=r?"width":"height",a=r?"offsetWidth":"offsetHeight";if(e){let t=Math.max(e[a],ss(e.getBoundingClientRect()[o],1e3)),i=getComputedStyle(e),n="padding",s=r?"Right":"Bottom";t-=parseFloat(i[n+(r?"Left":"Top")])+parseFloat(i[n+s]),this.viewportDim=t}let l,c=0;for(const[t,e]of n.entries()){let i=0,r=0;!e.el&&l?(i=l.dim,r=l.gap):(({dim:i,gap:r}=this.getSlideMetrics(e)),l=e),i=ss(i,1e3),r=ss(r,1e3),e.dim=i,e.gap=r,e.pos=c,c+=i,(s||t<n.length-1)&&(c+=r)}c=ss(c,1e3),this.contentDim=c,t&&(t.contentRect[o]=c,t.contentRect[r?"fullWidth":"fullHeight"]=c),this.pages=this.createPages(),this.pages=this.processPages(),this.state===Vs.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),this.manageSlideVisiblity(),this.emit("refresh")}getProgress(t,e=!1,i=!1){void 0===t&&(t=this.page);const n=this,r=n.panzoom,s=n.contentDim,o=n.pages[t]||0;if(!o||!r)return t>this.page?-1:1;let a=-1*r.current.e,l=ss((a-o.pos)/(1*o.dim),1e3),c=l,h=l;this.isInfinite&&!0!==i&&(c=ss((a-o.pos+s)/(1*o.dim),1e3),h=ss((a-o.pos-s)/(1*o.dim),1e3));let u=[l,c,h].reduce((function(t,e){return Math.abs(e)<Math.abs(t)?e:t}));return e?u:u>1?1:u<-1?-1:u}setViewportHeight(){const{page:t,pages:e,viewport:i,isHorizontal:n}=this;if(!i||!e[t])return;let r=0;n&&this.track&&(this.track.style.height="auto",e[t].slides.forEach((t=>{t.el&&(r=Math.max(r,t.el.offsetHeight))}))),i.style.height=r?`${r}px`:""}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{panzoom:n,contentDim:r,viewportDim:s,pages:o,page:a}=this;if(s){r=r+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let l=0;l=n&&n.state!==xs.Init&&n.state!==xs.Destroy?-1*n.current[this.axis]:o[a]&&o[a].pos||0,this.isInfinite&&(l-=Math.floor(l/r)*r),this.isRTL&&this.isHorizontal&&(l*=-1);const c=l-s*t,h=l+s*(t+1),u=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of u){const n=t.pos+e*r,s=n+t.dim+t.gap;n<h&&s>c&&i.add(t)}}return i}getPageFromPosition(t){const{viewportDim:e,contentDim:i,slides:n,pages:r,panzoom:s}=this,o=r.length,a=n.length,l=n[0],c=n[a-1],h=this.option("center");let u=0,d=0,p=0,f=void 0===t?-1*((null==s?void 0:s.target[this.axis])||0):t;h&&(f+=.5*e),this.isInfinite?(f<l.pos-.5*c.gap&&(f-=i,p=-1),f>c.pos+c.dim+.5*c.gap&&(f-=i,p=1)):f=Math.max(l.pos||0,Math.min(f,c.pos));let m=c,g=n.find((t=>{const e=t.pos-.5*m.gap,i=t.pos+t.dim+.5*t.gap;return m=t,f>=e&&f<i}));return g||(g=c),d=this.getPageForSlide(g.index),u=d+p*o,{page:u,pageIndex:d}}setPageFromPosition(){const{pageIndex:t}=this.getPageFromPosition();this.onChange(t)}destroy(){if([Vs.Destroy].includes(this.state))return;this.state=Vs.Destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:r}=this,s=this.option("classes");t.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),t.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),r&&(r.destroy(),this.panzoom=null),n&&n.forEach((t=>{this.removeSlideEl(t)})),this.detachPlugins(),e&&(e.removeEventListener("scroll",this.onScroll),e.offsetParent&&i&&i.offsetParent&&e.replaceWith(...i.childNodes));for(const[e,i]of Object.entries(s))"container"!==e&&i&&t.classList.remove(i);this.track=null,this.viewport=null,this.page=0,this.slides=[];const o=this.events.get("ready");this.events=new Map,o&&this.events.set("ready",o)}}Object.defineProperty(eo,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:Bs}),Object.defineProperty(eo,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}}}),Object.defineProperty(eo,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:Ks});const io=function(t){if(!As(t))return 0;const e=window.scrollY,i=window.innerHeight,n=e+i,r=t.getBoundingClientRect(),s=r.y+e,o=r.height,a=s+o;if(e>a||n<s)return 0;if(e<s&&n>a)return 100;if(s<e&&a>n)return 100;let l=o;s<e&&(l-=e-s),a>n&&(l-=a-n);const c=l/i*100;return Math.round(c)},no=!("undefined"==typeof window||!window.document||!window.document.createElement);let ro;const so=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"]):not([disabled]):not([aria-hidden])'].join(","),oo=t=>{if(t&&no){void 0===ro&&document.createElement("div").focus({get preventScroll(){return ro=!0,!1}});try{if(ro)t.focus({preventScroll:!0});else{const e=window.scrollY||document.body.scrollTop,i=window.scrollX||document.body.scrollLeft;t.focus(),document.body.scrollTo({top:e,left:i,behavior:"auto"})}}catch(t){}}},ao=()=>{const t=document;let e,i="",n="",r="";return t.fullscreenEnabled?(i="requestFullscreen",n="exitFullscreen",r="fullscreenElement"):t.webkitFullscreenEnabled&&(i="webkitRequestFullscreen",n="webkitExitFullscreen",r="webkitFullscreenElement"),i&&(e={request:function(e=t.documentElement){return"webkitRequestFullscreen"===i?e[i](Element.ALLOW_KEYBOARD_INPUT):e[i]()},exit:function(){return t[r]&&t[n]()},isFullscreen:function(){return t[r]}}),e},lo={dragToClose:!0,hideScrollbar:!0,Carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},contentClick:"toggleZoom",contentDblClick:!1,backdropClick:"close",animated:!0,idle:3500,showClass:"f-zoomInUp",hideClass:"f-fadeOut",commonCaption:!1,parentEl:null,startIndex:0,l10n:Object.assign(Object.assign({},Es),{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}),tpl:{closeButton:'<button data-fancybox-close class="f-button is-close-btn" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"/></svg></button>',main:'<div class="fancybox__container" role="dialog" aria-modal="true" aria-label="{{MODAL}}" tabindex="-1">\n <div class="fancybox__backdrop"></div>\n <div class="fancybox__carousel"></div>\n <div class="fancybox__footer"></div>\n </div>'},groupAll:!1,groupAttr:"data-fancybox",defaultType:"image",defaultDisplay:"block",autoFocus:!0,trapFocus:!0,placeFocusBack:!0,closeButton:"auto",keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"prev",ArrowDown:"next",ArrowRight:"next",ArrowLeft:"prev"},Fullscreen:{autoStart:!1},compact:()=>window.matchMedia("(max-width: 578px), (max-height: 578px)").matches,wheel:"zoom"};var co,ho;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Closing=2]="Closing",t[t.CustomClosing=3]="CustomClosing",t[t.Destroy=4]="Destroy"}(co||(co={})),function(t){t[t.Loading=0]="Loading",t[t.Opening=1]="Opening",t[t.Ready=2]="Ready",t[t.Closing=3]="Closing"}(ho||(ho={}));let uo="",po=!1,fo=!1,mo=null;const go=()=>{let t="",e="";const i=Aa.getInstance();if(i){const n=i.carousel,r=i.getSlide();if(n&&r){let s=r.slug||void 0,o=r.triggerEl||void 0;e=s||i.option("slug")||"",!e&&o&&o.dataset&&(e=o.dataset.fancybox||""),e&&"true"!==e&&(t="#"+e+(!s&&n.slides.length>1?"-"+(r.index+1):""))}}return{hash:t,slug:e,index:1}},_o=()=>{const t=new URL(document.URL).hash,e=t.slice(1).split("-"),i=e[e.length-1],n=i&&/^\+?\d+$/.test(i)&&parseInt(e.pop()||"1",10)||1;return{hash:t,slug:e.join("-"),index:n}},yo=()=>{const{slug:t,index:e}=_o();if(!t)return;let i=document.querySelector(`[data-slug="${t}"]`);if(i&&i.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),Aa.getInstance())return;const n=document.querySelectorAll(`[data-fancybox="${t}"]`);n.length&&(i=n[e-1],i&&i.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))},vo=()=>{if(!1===Aa.defaults.Hash)return;const t=Aa.getInstance();if(!1===(null==t?void 0:t.options.Hash))return;const{slug:e,index:i}=_o(),{slug:n}=go();t&&(e===n?t.jumpTo(i-1):(po=!0,t.close())),yo()},bo=()=>{mo&&clearTimeout(mo),queueMicrotask((()=>{vo()}))},xo=()=>{window.addEventListener("hashchange",bo,!1),setTimeout((()=>{vo()}),500)};no&&(/complete|interactive|loaded/.test(document.readyState)?xo():document.addEventListener("DOMContentLoaded",xo));const wo="is-zooming-in";class Eo extends Hs{onCreateSlide(t,e,i){const n=this.instance.optionFor(i,"src")||"";i.el&&"image"===i.type&&"string"==typeof n&&this.setImage(i,n)}onRemoveSlide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(t,e,i,n){Cs(this.instance.container,wo);for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onClose(){var t;const e=this.instance,i=e.container,n=e.getSlide();if(!i||!i.parentElement||!n)return;const{el:r,contentEl:s,panzoom:o,thumbElSrc:a}=n;if(!r||!a||!s||!o||o.isContentLoading||o.state===xs.Init||o.state===xs.Destroy)return;o.updateMetrics();let l=this.getZoomInfo(n);if(!l)return;this.instance.state=co.CustomClosing,i.classList.remove(wo),i.classList.add("is-zooming-out"),s.style.backgroundImage=`url('${a}')`;const c=i.getBoundingClientRect();1===((null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1)&&Object.assign(i.style,{position:"absolute",top:`${i.offsetTop+window.scrollY}px`,left:`${i.offsetLeft+window.scrollX}px`,bottom:"auto",right:"auto",width:`${c.width}px`,height:`${c.height}px`,overflow:"hidden"});const{x:h,y:u,scale:d,opacity:p}=l;if(p){const t=((t,e,i,n)=>{const r=e-t;return e=>1+((e-t)/r*-1||0)})(o.scale,d);o.on("afterTransform",(()=>{s.style.opacity=t(o.scale)+""}))}o.on("endAnimation",(()=>{e.destroy()})),o.target.a=d,o.target.b=0,o.target.c=0,o.target.d=d,o.panTo({x:h,y:u,scale:d,friction:p?.2:.33,ignoreBounds:!0}),o.isResting&&e.destroy()}setImage(t,e){const i=this.instance;t.src=e,this.process(t,e).then((e=>{const{contentEl:n,imageEl:r,thumbElSrc:s,el:o}=t;if(i.isClosing()||!n||!r)return;n.offsetHeight;const a=!!i.isOpeningSlide(t)&&this.getZoomInfo(t);if(this.option("protected")&&o){o.addEventListener("contextmenu",(t=>{t.preventDefault()}));const t=document.createElement("div");ks(t,"fancybox-protected"),n.appendChild(t)}if(s&&a){const r=e.contentRect,o=Math.max(r.fullWidth,r.fullHeight);let c=null;!a.opacity&&o>1200&&(c=document.createElement("img"),ks(c,"fancybox-ghost"),c.src=s,n.appendChild(c));const h=()=>{c&&(ks(c,"f-fadeFastOut"),setTimeout((()=>{c&&(c.remove(),c=null)}),200))};(l=s,new Promise(((t,e)=>{const i=new Image;i.onload=t,i.onerror=e,i.src=l}))).then((()=>{i.hideLoading(t),t.state=ho.Opening,this.instance.emit("reveal",t),this.zoomIn(t).then((()=>{h(),this.instance.done(t)}),(()=>{})),c&&setTimeout((()=>{h()}),o>2500?800:200)}),(()=>{i.hideLoading(t),i.revealContent(t)}))}else{const n=this.optionFor(t,"initialSize"),r=this.optionFor(t,"zoom"),s={event:i.prevMouseMoveEvent||i.options.event,friction:r?.12:0};let o=i.optionFor(t,"showClass")||void 0,a=!0;i.isOpeningSlide(t)&&("full"===n?e.zoomToFull(s):"cover"===n?e.zoomToCover(s):"max"===n?e.zoomToMax(s):a=!1,e.stop("current")),a&&o&&(o=e.isDragging?"f-fadeIn":""),i.hideLoading(t),i.revealContent(t,o)}var l}),(()=>{i.setError(t,"{{IMAGE_ERROR}}")}))}process(t,e){return new Promise(((i,n)=>{var r;const s=this.instance,o=t.el;s.clearContent(t),s.showLoading(t);let a=this.optionFor(t,"content");if("string"==typeof a&&(a=ls(a)),!a||!As(a)){if(a=document.createElement("img"),a instanceof HTMLImageElement){let i="",n=t.caption;i="string"==typeof n&&n?n.replace(/<[^>]+>/gi,"").substring(0,1e3):`Image ${t.index+1} of ${(null===(r=s.carousel)||void 0===r?void 0:r.pages.length)||1}`,a.src=e||"",a.alt=i,a.draggable=!1,t.srcset&&a.setAttribute("srcset",t.srcset),this.instance.isOpeningSlide(t)&&(a.fetchPriority="high")}t.sizes&&a.setAttribute("sizes",t.sizes)}ks(a,"fancybox-image"),t.imageEl=a,s.setContent(t,a,!1),t.panzoom=new Bs(o,_s({transformParent:!0},this.option("Panzoom")||{},{content:a,width:(e,i)=>s.optionFor(t,"width","auto",i)||"auto",height:(e,i)=>s.optionFor(t,"height","auto",i)||"auto",wheel:()=>{const t=s.option("wheel");return("zoom"===t||"pan"==t)&&t},click:(e,i)=>{var n,r;if(s.isCompact||s.isClosing())return!1;if(t.index!==(null===(n=s.getSlide())||void 0===n?void 0:n.index))return!1;if(i){const t=i.composedPath()[0];if(["A","BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].includes(t.nodeName))return!1}let o=!i||i.target&&(null===(r=t.contentEl)||void 0===r?void 0:r.contains(i.target));return s.option(o?"contentClick":"backdropClick")||!1},dblClick:()=>s.isCompact?"toggleZoom":s.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:t=>{i(t)},error:()=>{n()},destroy:()=>{n()}}}))}))}zoomIn(t){return new Promise(((e,i)=>{const n=this.instance,r=n.container,{panzoom:s,contentEl:o,el:a}=t;s&&s.updateMetrics();const l=this.getZoomInfo(t);if(!(l&&a&&o&&s&&r))return void i();const{x:c,y:h,scale:u,opacity:d}=l,p=()=>{t.state!==ho.Closing&&(d&&(o.style.opacity=Math.max(Math.min(1,1-(1-s.scale)/(1-u)),0)+""),s.scale>=1&&s.scale>s.targetScale-.1&&e(s))},f=t=>{(t.scale<.99||t.scale>1.01)&&!t.isDragging||(Cs(r,wo),o.style.opacity="",t.off("endAnimation",f),t.off("touchStart",f),t.off("afterTransform",p),e(t))};s.on("endAnimation",f),s.on("touchStart",f),s.on("afterTransform",p),s.on(["error","destroy"],(()=>{i()})),s.panTo({x:c,y:h,scale:u,friction:0,ignoreBounds:!0}),s.stop("current");const m={event:"mousemove"===s.panMode?n.prevMouseMoveEvent||n.options.event:void 0},g=this.optionFor(t,"initialSize");ks(r,wo),n.hideLoading(t),"full"===g?s.zoomToFull(m):"cover"===g?s.zoomToCover(m):"max"===g?s.zoomToMax(m):s.reset(.172)}))}getZoomInfo(t){const{el:e,imageEl:i,thumbEl:n,panzoom:r}=t,s=this.instance,o=s.container;if(!e||!i||!n||!r||io(n)<3||!this.optionFor(t,"zoom")||!o||s.state===co.Destroy)return!1;if("0"===getComputedStyle(o).getPropertyValue("--f-images-zoom"))return!1;const a=window.visualViewport||null;if(1!==(a?a.scale:1))return!1;let{top:l,left:c,width:h,height:u}=n.getBoundingClientRect(),{top:d,left:p,fitWidth:f,fitHeight:m}=r.contentRect;if(!(h&&u&&f&&m))return!1;const g=r.container.getBoundingClientRect();p+=g.left,d+=g.top;const _=-1*(p+.5*f-(c+.5*h)),y=-1*(d+.5*m-(l+.5*u)),v=h/f;let b=this.option("zoomOpacity")||!1;return"auto"===b&&(b=Math.abs(h/u-f/m)>.1),{x:_,y:y,scale:v,opacity:b}}attach(){const t=this,e=t.instance;e.on("Carousel.change",t.onChange),e.on("Carousel.createSlide",t.onCreateSlide),e.on("Carousel.removeSlide",t.onRemoveSlide),e.on("close",t.onClose)}detach(){const t=this,e=t.instance;e.off("Carousel.change",t.onChange),e.off("Carousel.createSlide",t.onCreateSlide),e.off("Carousel.removeSlide",t.onRemoveSlide),e.off("close",t.onClose)}}Object.defineProperty(Eo,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:"fit",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:"auto"}}),"function"==typeof SuppressedError&&SuppressedError;const So="html",To="image",Mo="map",Ao="youtube",Co="vimeo",ko="html5video",Po=(t,e={})=>{const i=new URL(t),n=new URLSearchParams(i.search),r=new URLSearchParams;for(const[t,i]of[...n,...Object.entries(e)]){let e=i+"";if("t"===t){let t=e.match(/((\d*)m)?(\d*)s?/);t&&r.set("start",60*parseInt(t[2]||"0")+parseInt(t[3]||"0")+"")}else r.set(t,e)}let s=r+"",o=t.match(/#t=((.*)?\d+s)/);return o&&(s+=`#t=${o[1]}`),s},Io=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class Do extends Hs{onBeforeInitSlide(t,e,i){this.processType(i)}onCreateSlide(t,e,i){this.setContent(i)}onClearContent(t,e){e.xhr&&(e.xhr.abort(),e.xhr=null);const i=e.iframeEl;i&&(i.onload=i.onerror=null,i.src="//about:blank",e.iframeEl=null);const n=e.contentEl,r=e.placeholderEl;if("inline"===e.type&&n&&r)n.classList.remove("fancybox__content"),"none"!==n.style.display&&(n.style.display="none"),r.parentNode&&r.parentNode.insertBefore(n,r),r.remove(),e.contentEl=void 0,e.placeholderEl=void 0;else for(;e.el&&e.el.firstChild;)e.el.removeChild(e.el.firstChild)}onSelectSlide(t,e,i){i.state===ho.Ready&&this.playVideo()}onUnselectSlide(t,e,i){var n,r;if(i.type===ko){try{null===(r=null===(n=i.el)||void 0===n?void 0:n.querySelector("video"))||void 0===r||r.pause()}catch(t){}return}let s;i.type===Co?s={method:"pause",value:"true"}:i.type===Ao&&(s={event:"command",func:"pauseVideo"}),s&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(s),"*"),i.poller&&clearTimeout(i.poller)}onDone(t,e){t.isCurrentSlide(e)&&!t.isClosing()&&this.playVideo()}onRefresh(t,e){e.slides.forEach((t=>{t.el&&(this.resizeIframe(t),this.setAspectRatio(t))}))}onMessage(t){try{let e=JSON.parse(t.data);if("https://player.vimeo.com"===t.origin){if("ready"===e.event)for(let e of Array.from(document.getElementsByClassName("fancybox__iframe")))e instanceof HTMLIFrameElement&&e.contentWindow===t.source&&(e.dataset.ready="true")}else if(t.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&"onReady"===e.event){const t=document.getElementById(e.id);t&&(t.dataset.ready="true")}}catch(t){}}loadAjaxContent(t){const e=this.instance.optionFor(t,"src")||"";this.instance.showLoading(t);const i=this.instance,n=new XMLHttpRequest;i.showLoading(t),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===co.Ready&&(i.hideLoading(t),200===n.status?i.setContent(t,n.responseText):i.setError(t,404===n.status?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const r=t.ajax||null;n.open(r?"POST":"GET",e+""),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(r),t.xhr=n}setInlineContent(t){let e=null;if(As(t.src))e=t.src;else if("string"==typeof t.src){const i=t.src.split("#",2).pop();e=i?document.getElementById(i):null}if(e){if("clone"===t.type||e.closest(".fancybox__slide")){e=e.cloneNode(!0);const i=e.dataset.animationName;i&&(e.classList.remove(i),delete e.dataset.animationName);let n=e.getAttribute("id");n=n?`${n}--clone`:`clone-${this.instance.id}-${t.index}`,e.setAttribute("id",n)}else if(e.parentNode){const i=document.createElement("div");i.classList.add("fancybox-placeholder"),e.parentNode.insertBefore(i,e),t.placeholderEl=i}this.instance.setContent(t,e)}else this.instance.setError(t,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(t){const{src:e,el:i}=t;if(!e||"string"!=typeof e||!i)return;i.classList.add("is-loading");const n=this.instance,r=document.createElement("iframe");r.className="fancybox__iframe",r.setAttribute("id",`fancybox__iframe_${n.id}_${t.index}`);for(const[e,i]of Object.entries(this.optionFor(t,"iframeAttr")||{}))r.setAttribute(e,i);r.onerror=()=>{n.setError(t,"{{IFRAME_ERROR}}")},t.iframeEl=r;const s=this.optionFor(t,"preload");if("iframe"!==t.type||!1===s)return r.setAttribute("src",t.src+""),n.setContent(t,r,!1),this.resizeIframe(t),void n.revealContent(t);n.showLoading(t),r.onload=()=>{if(!r.src.length)return;const e="true"!==r.dataset.ready;r.dataset.ready="true",this.resizeIframe(t),e?n.revealContent(t):n.hideLoading(t)},r.setAttribute("src",e),n.setContent(t,r,!1)}resizeIframe(t){const{type:e,iframeEl:i}=t;if(e===Ao||e===Co)return;const n=null==i?void 0:i.parentElement;if(!i||!n)return;let r=t.autoSize;void 0===r&&(r=this.optionFor(t,"autoSize"));let s=t.width||0,o=t.height||0;s&&o&&(r=!1);const a=n&&n.style;if(!1!==t.preload&&!1!==r&&a)try{const t=window.getComputedStyle(n),e=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),r=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=i.contentWindow;if(l){const t=l.document,i=t.getElementsByTagName(So)[0],n=t.body;a.width="",n.style.overflow="hidden",s=s||i.scrollWidth+e,a.width=`${s}px`,n.style.overflow="",a.flex="0 0 auto",a.height=`${n.scrollHeight}px`,o=i.scrollHeight+r}}catch(t){}if(s||o){const t={flex:"0 1 auto",width:"",height:""};s&&"auto"!==s&&(t.width=`${s}px`),o&&"auto"!==o&&(t.height=`${o}px`),Object.assign(a,t)}}playVideo(){const t=this.instance.getSlide();if(!t)return;const{el:e}=t;if(!e||!e.offsetParent)return;if(!this.optionFor(t,"videoAutoplay"))return;if(t.type===ko)try{const t=e.querySelector("video");if(t){const e=t.play();void 0!==e&&e.then((()=>{})).catch((e=>{t.muted=!0,t.play()}))}}catch(t){}if(t.type!==Ao&&t.type!==Co)return;const i=()=>{if(t.iframeEl&&t.iframeEl.contentWindow){let e;if("true"===t.iframeEl.dataset.ready)return e=t.type===Ao?{event:"command",func:"playVideo"}:{method:"play",value:"true"},e&&t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"),void(t.poller=void 0);t.type===Ao&&(e={event:"listening",id:t.iframeEl.getAttribute("id")},t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"))}t.poller=setTimeout(i,250)};i()}processType(t){if(t.html)return t.type=So,t.src=t.html,void(t.html="");const e=this.instance.optionFor(t,"src","");if(!e||"string"!=typeof e)return;let i=t.type,n=null;if(n=e.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const r=this.optionFor(t,Ao),{nocookie:s}=r,o=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(r,["nocookie"]),a=`www.youtube${s?"-nocookie":""}.com`,l=Po(e,o),c=encodeURIComponent(n[2]);t.videoId=c,t.src=`https://${a}/embed/${c}?${l}`,t.thumbSrc=t.thumbSrc||`https://i.ytimg.com/vi/${c}/mqdefault.jpg`,i=Ao}else if(n=e.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/)){const r=Po(e,this.optionFor(t,Co)),s=encodeURIComponent(n[1]),o=n[4]||"";t.videoId=s,t.src=`https://player.vimeo.com/video/${s}?${o?`h=${o}${r?"&":""}`:""}${r}`,i=Co}if(!i&&t.triggerEl){const e=t.triggerEl.dataset.type;Io.includes(e)&&(i=e)}i||"string"==typeof e&&("#"===e.charAt(0)?i="inline":(n=e.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(i=ko,t.videoFormat=t.videoFormat||"video/"+("ogv"===n[1]?"ogg":n[1])):e.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?i=To:e.match(/\.(pdf)((\?|#).*)?$/i)&&(i="pdf")),(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(t.src=`https://maps.google.${n[1]}/?ll=${(n[2]?n[2]+"&z="+Math.floor(parseFloat(n[3]))+(n[4]?n[4].replace(/^\//,"&"):""):n[4]+"").replace(/\?/,"&")}&output=${n[4]&&n[4].indexOf("layer=c")>0?"svembed":"embed"}`,i=Mo):(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(t.src=`https://maps.google.${n[1]}/maps?q=${n[2].replace("query=","q=").replace("api=1","")}&output=embed`,i=Mo),i=i||this.instance.option("defaultType"),t.type=i,i===To&&(t.thumbSrc=t.thumbSrc||t.src)}setContent(t){const e=this.instance.optionFor(t,"src")||"";if(t&&t.type&&e){switch(t.type){case So:this.instance.setContent(t,e);break;case ko:const i=this.option("videoTpl");i&&this.instance.setContent(t,i.replace(/\{\{src\}\}/gi,e+"").replace(/\{\{format\}\}/gi,this.optionFor(t,"videoFormat")||"").replace(/\{\{poster\}\}/gi,t.poster||t.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(t);break;case"ajax":this.loadAjaxContent(t);break;case"pdf":case Mo:case Ao:case Co:t.preload=!1;case"iframe":this.setIframeContent(t)}this.setAspectRatio(t)}}setAspectRatio(t){const e=t.contentEl;if(!(t.el&&e&&t.type&&[Ao,Co,ko].includes(t.type)))return;let i,n=t.width||"auto",r=t.height||"auto";if("auto"===n||"auto"===r){i=this.optionFor(t,"videoRatio");const e=(i+"").match(/(\d+)\s*\/\s?(\d+)/);i=e&&e.length>2?parseFloat(e[1])/parseFloat(e[2]):parseFloat(i+"")}else n&&r&&(i=n/r);if(!i)return;e.style.aspectRatio="",e.style.width="",e.style.height="",e.offsetHeight;const s=e.getBoundingClientRect(),o=s.width||1,a=s.height||1;e.style.aspectRatio=i+"",i<o/a?(r="auto"===r?a:Math.min(a,r),e.style.width="auto",e.style.height=`${r}px`):(n="auto"===n?o:Math.min(o,n),e.style.width=`${n}px`,e.style.height="auto")}attach(){const t=this,e=t.instance;e.on("Carousel.beforeInitSlide",t.onBeforeInitSlide),e.on("Carousel.createSlide",t.onCreateSlide),e.on("Carousel.selectSlide",t.onSelectSlide),e.on("Carousel.unselectSlide",t.onUnselectSlide),e.on("Carousel.Panzoom.refresh",t.onRefresh),e.on("done",t.onDone),e.on("clearContent",t.onClearContent),window.addEventListener("message",t.onMessage)}detach(){const t=this,e=t.instance;e.off("Carousel.beforeInitSlide",t.onBeforeInitSlide),e.off("Carousel.createSlide",t.onCreateSlide),e.off("Carousel.selectSlide",t.onSelectSlide),e.off("Carousel.unselectSlide",t.onUnselectSlide),e.off("Carousel.Panzoom.refresh",t.onRefresh),e.off("done",t.onDone),e.off("clearContent",t.onClearContent),window.removeEventListener("message",t.onMessage)}}Object.defineProperty(Do,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{ajax:null,autoSize:!0,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">\n <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos.</video>',videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}}});const Oo="play",Lo="pause",zo="ready";class Ro extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:zo}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==zo}onReady(t){this.option("autoStart")&&(t.isInfinite||t.page<t.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){"visible"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var t;this.inHover=!1,(null===(t=this.instance.panzoom)||void 0===t?void 0:t.isResting)&&this.resume()}onTimerEnd(){const t=this.instance;"play"===this.state&&(t.isInfinite||t.page!==t.pages.length-1?t.slideNext():t.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var t;if(!this.option("showProgress"))return null;this.removeProgressBar();const e=this.instance,i=(null===(t=e.pages[e.page])||void 0===t?void 0:t.slides)||[];let n=this.option("progressParentEl");if(n||(n=(1===i.length?i[0].el:null)||e.viewport),!n)return null;const r=document.createElement("div");return ks(r,"f-progress"),n.prepend(r),this.progressBar=r,r.offsetHeight,r}set(){const t=this,e=t.instance;if(e.pages.length<2)return;if(t.timer)return;const i=t.option("timeout");t.state=Oo,ks(e.container,"has-autoplay");let n=t.createProgressBar();n&&(n.style.transitionDuration=`${i}ms`,n.style.transform="scaleX(1)"),t.timer=setTimeout((()=>{t.timer=null,t.inHover||t.onTimerEnd()}),i),t.emit("set")}clear(){const t=this;t.timer&&(clearTimeout(t.timer),t.timer=null),t.removeProgressBar()}start(){const t=this;if(t.set(),t.state!==zo){if(t.option("pauseOnHover")){const e=t.instance.container;e.addEventListener("mouseenter",t.onMouseEnter,!1),e.addEventListener("mouseleave",t.onMouseLeave,!1)}document.addEventListener("visibilitychange",t.onVisibilityChange,!1),t.emit("start")}}stop(){const t=this,e=t.state,i=t.instance.container;t.clear(),t.state=zo,i.removeEventListener("mouseenter",t.onMouseEnter,!1),i.removeEventListener("mouseleave",t.onMouseLeave,!1),document.removeEventListener("visibilitychange",t.onVisibilityChange,!1),Cs(i,"has-autoplay"),e!==zo&&t.emit("stop")}pause(){const t=this;t.state===Oo&&(t.state=Lo,t.clear(),t.emit(Lo))}resume(){const t=this,e=t.instance;if(e.isInfinite||e.page!==e.pages.length-1)if(t.state!==Oo){if(t.state===Lo&&!t.inHover){const e=new Event("resume",{bubbles:!0,cancelable:!0});t.emit("resume",e),e.defaultPrevented||t.set()}}else t.set();else t.stop()}toggle(){this.state===Oo||this.state===Lo?this.stop():this.start()}attach(){const t=this,e=t.instance;e.on("ready",t.onReady),e.on("Panzoom.startAnimation",t.onChange),e.on("Panzoom.endAnimation",t.onSettle),e.on("Panzoom.touchMove",t.onChange)}detach(){const t=this,e=t.instance;e.off("ready",t.onReady),e.off("Panzoom.startAnimation",t.onChange),e.off("Panzoom.endAnimation",t.onSettle),e.off("Panzoom.touchMove",t.onChange),t.stop()}}Object.defineProperty(Ro,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class Fo extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(t){const e=t.carousel;if(!e)return;const i=t.container;i&&(e.options.Autoplay=_s({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{t.emit("startSlideshow")},set:e=>{var n;i.classList.add("has-slideshow"),(null===(n=t.getSlide())||void 0===n?void 0:n.state)!==ho.Ready&&e.pause()},stop:()=>{i.classList.remove("has-slideshow"),t.isCompact||t.endIdle(),t.emit("endSlideshow")},resume:(e,i)=>{var n,r,s;!i||!i.cancelable||(null===(n=t.getSlide())||void 0===n?void 0:n.state)===ho.Ready&&(null===(s=null===(r=t.carousel)||void 0===r?void 0:r.panzoom)||void 0===s?void 0:s.isResting)||i.preventDefault()}}}),e.attachPlugins({Autoplay:Ro}),this.ref=e.plugins.Autoplay)}onReady(t){const e=t.carousel,i=this.ref;i&&e&&this.option("playOnStart")&&(e.isInfinite||e.page<e.pages.length-1)&&i.start()}onDone(t,e){const i=this.ref,n=t.carousel;if(!i||!n)return;const r=e.panzoom;r&&r.on("startAnimation",(()=>{t.isCurrentSlide(e)&&i.stop()})),t.isCurrentSlide(e)&&i.resume()}onKeydown(t,e){var i;const n=this.ref;n&&e===this.option("key")&&"BUTTON"!==(null===(i=document.activeElement)||void 0===i?void 0:i.nodeName)&&n.toggle()}attach(){const t=this,e=t.instance;e.on("Carousel.init",t.onPrepare),e.on("Carousel.ready",t.onReady),e.on("done",t.onDone),e.on("keydown",t.onKeydown)}detach(){const t=this,e=t.instance;e.off("Carousel.init",t.onPrepare),e.off("Carousel.ready",t.onReady),e.off("done",t.onDone),e.off("keydown",t.onKeydown)}}Object.defineProperty(Fo,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:t=>{var e;return(null===(e=t.instance.container)||void 0===e?void 0:e.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||t.instance.container},timeout:3e3}});const Bo={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};var No;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden"}(No||(No={}));const jo="isResting",Vo="thumbWidth",Uo="thumbHeight",$o="thumbClipWidth";let Ho=class extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:No.Init})}get isModern(){return"modern"===this.type}onInitSlide(t,e){const i=e.el?e.el.dataset:void 0;i&&(e.thumbSrc=i.thumbSrc||e.thumbSrc||"",e[$o]=parseFloat(i[$o]||"")||e[$o]||0,e[Uo]=parseFloat(i.thumbHeight||"")||e[Uo]||0),this.addSlide(e)}onInitSlides(){this.build()}onChange(){var t;if(!this.isModern)return;const e=this.container,i=this.instance,n=i.panzoom,r=this.carousel,s=r?r.panzoom:null,o=i.page;if(n&&r&&s){if(n.isDragging){Cs(e,this.cn(jo));let n=(null===(t=r.pages[o])||void 0===t?void 0:t.pos)||0;n+=i.getProgress(o)*(this[$o]+this.thumbGap);let a=s.getBounds();-1*n>a.x.min&&-1*n<a.x.max&&s.panTo({x:-1*n,friction:.12})}else hs(e,this.cn(jo),n.isResting);this.shiftModern()}}onRefresh(){this.updateProps();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.shiftModern()}isDisabled(){const t=this.option("minCount")||0;if(t){const e=this.instance;let i=0;for(const t of e.slides||[])t.thumbSrc&&i++;if(i<t)return!0}const e=this.option("type");return["modern","classic"].indexOf(e)<0}getThumb(t){const e=this.option("thumbTpl")||"";return{html:this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(t){const e=this.carousel;e&&e.addSlide(t.index,this.getThumb(t))}getSlides(){const t=[];for(const e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(t){this.isModern&&(t[Vo]=t[$o]&&t[Uo]?Math.round(this[Uo]*(t[$o]/t[Uo])):this[Vo])}updateProps(){const t=this.container;if(!t)return;const e=e=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+e))||0;this.thumbGap=e("gap"),this.thumbExtraGap=e("extra-gap"),this[Vo]=e("width")||40,this[$o]=e("clip-width")||40,this[Uo]=e("height")||40}build(){const t=this;if(t.state!==No.Init)return;if(t.isDisabled())return void t.emit("disabled");const e=t.instance,i=e.container,n=t.getSlides(),r=t.option("type");t.type=r;const s=t.option("parentEl"),o=t.cn("container"),a=t.cn("track");let l=null==s?void 0:s.querySelector("."+o);l||(l=document.createElement("div"),ks(l,o),s?s.appendChild(l):i.after(l)),ks(l,`is-${r}`),ks(i,t.cn("hasThumbs")),t.container=l,t.updateProps();let c=l.querySelector("."+a);c||(c=document.createElement("div"),ks(c,t.cn("track")),l.appendChild(c)),t.track=c;const h=_s({},{track:c,infinite:!1,center:!0,fill:"classic"===r,dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},t.option("Carousel")||{},{Sync:{target:e},slides:n}),u=new e.constructor(l,h);u.on("createSlide",((e,i)=>{t.setProps(i.index),t.emit("createSlide",i,i.el)})),u.on("ready",(()=>{t.shiftModern(),t.emit("ready")})),u.on("refresh",(()=>{t.shiftModern()})),u.on("Panzoom.click",((e,i,n)=>{t.onClick(n)})),t.carousel=u,t.state=No.Ready}onClick(t){t.preventDefault(),t.stopPropagation();const e=this.instance,{pages:i,page:n}=e,r=t=>{if(t){const e=t.closest("[data-carousel-index]");if(e)return[parseInt(e.dataset.carouselIndex||"",10)||0,e]}return[-1,void 0]},s=(t,e)=>{const i=document.elementFromPoint(t,e);return i?r(i):[-1,void 0]};let[o,a]=r(t.target);if(o>-1)return;const l=this[$o],c=t.clientX,h=t.clientY;let[u,d]=s(c-l,h),[p,f]=s(c+l,h);d&&f?(o=Math.abs(c-d.getBoundingClientRect().right)<Math.abs(c-f.getBoundingClientRect().left)?u:p,o===n&&(o=o===u?p:u)):d?o=u:f&&(o=p),o>-1&&i[o]&&e.slideTo(o)}getShift(t){var e;const i=this,{instance:n}=i,r=i.carousel;if(!n||!r)return 0;const s=i[Vo],o=i[$o],a=i.thumbGap,l=i.thumbExtraGap;if(!(null===(e=r.slides[t])||void 0===e?void 0:e.el))return 0;const c=.5*(s-o),h=n.pages.length-1;let u=n.getProgress(0),d=n.getProgress(h),p=n.getProgress(t,!1,!0),f=0,m=c+l+a;const g=u<0&&u>-1,_=d>0&&d<1;return 0===t?(f=m*Math.abs(u),_&&1===u&&(f-=m*Math.abs(d))):t===h?(f=m*Math.abs(d)*-1,g&&-1===d&&(f+=m*Math.abs(u))):g||_?(f=-1*m,f+=m*Math.abs(u),f+=m*(1-Math.abs(d))):f=m*p,f}setProps(t){var e;const i=this;if(!i.isModern)return;const{instance:n}=i,r=i.carousel;if(n&&r){const s=null===(e=r.slides[t])||void 0===e?void 0:e.el;if(s&&s.childNodes.length){let e=ss(1-Math.abs(n.getProgress(t))),r=ss(i.getShift(t));s.style.setProperty("--progress",e?e+"":""),s.style.setProperty("--shift",r+"")}}}shiftModern(){const t=this;if(!t.isModern)return;const{instance:e,track:i}=t,n=e.panzoom,r=t.carousel;if(!(e&&i&&n&&r))return;if(n.state===xs.Init||n.state===xs.Destroy)return;for(const i of e.slides)t.setProps(i.index);let s=(t[$o]+t.thumbGap)*(r.slides.length||0);i.style.setProperty("--width",s+"")}cleanup(){const t=this;t.carousel&&t.carousel.destroy(),t.carousel=null,t.container&&t.container.remove(),t.container=null,t.track&&t.track.remove(),t.track=null,t.state=No.Init,Cs(t.instance.container,t.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===Vs.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on(["change","Panzoom.afterTransform"],t.onChange),e.on("Panzoom.refresh",t.onRefresh)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off(["change","Panzoom.afterTransform"],t.onChange),e.off("Panzoom.refresh",t.onRefresh),t.cleanup()}};Object.defineProperty(Ho,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Bo});const qo=Object.assign(Object.assign({},Bo),{key:"t",showOnStart:!0,parentEl:null}),Wo="is-masked",Go="aria-hidden";class Zo extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const t=this.ref;return t&&!t.isDisabled()}get isHidden(){return this.hidden}onClick(t,e){e.stopPropagation()}onCreateSlide(t,e){var i,n,r;const s=(null===(r=null===(n=null===(i=this.instance)||void 0===i?void 0:i.carousel)||void 0===n?void 0:n.slides[e.index])||void 0===r?void 0:r.type)||"",o=e.el;if(o&&s){let t=`for-${s}`;["video","youtube","vimeo","html5video"].includes(s)&&(t+=" for-video"),ks(o,t)}}onInit(){var t;const e=this,i=e.instance,n=i.carousel;if(e.ref||!n)return;const r=e.option("parentEl")||i.footer||i.container;if(!r)return;const s=_s({},e.options,{parentEl:r,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:i.option("Carousel.friction")||0}},on:{ready:t=>{const i=t.container;i&&this.hidden&&(e.refresh(),i.style.transition="none",e.hide(),i.offsetHeight,queueMicrotask((()=>{i.style.transition="",e.show()})))}}});s.Carousel=s.Carousel||{},s.Carousel.on=_s((null===(t=e.options.Carousel)||void 0===t?void 0:t.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),n.options.Thumbs=s,n.attachPlugins({Thumbs:Ho}),e.ref=n.plugins.Thumbs,e.option("showOnStart")||(e.ref.state=No.Hidden,e.hidden=!0)}onResize(){var t;const e=null===(t=this.ref)||void 0===t?void 0:t.container;e&&(e.style.maxHeight="")}onKeydown(t,e){const i=this.option("key");i&&i===e&&this.toggle()}toggle(){const t=this.ref;if(t&&!t.isDisabled())return t.state===No.Hidden?(t.state=No.Init,void t.build()):void(this.hidden?this.show():this.hide())}show(){const t=this.ref;if(!t||t.isDisabled())return;const e=t.container;e&&(this.refresh(),e.offsetHeight,e.removeAttribute(Go),e.classList.remove(Wo),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetHeight,e.classList.add(Wo),e.setAttribute(Go,"true")),this.hidden=!0}refresh(){const t=this.ref;if(!t||!t.state)return;const e=t.container,i=(null==e?void 0:e.firstChild)||null;e&&i&&i.childNodes.length&&(e.style.maxHeight=`${i.getBoundingClientRect().height}px`)}attach(){const t=this,e=t.instance;e.state===co.Init?e.on("Carousel.init",t.onInit):t.onInit(),e.on("resize",t.onResize),e.on("keydown",t.onKeydown)}detach(){var t;const e=this,i=e.instance;i.off("Carousel.init",e.onInit),i.off("resize",e.onResize),i.off("keydown",e.onKeydown),null===(t=i.carousel)||void 0===t||t.detachPlugins(["Thumbs"]),e.ref=null}}Object.defineProperty(Zo,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:qo});const Yo={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}};var Xo;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Disabled=2]="Disabled"}(Xo||(Xo={}));const Ko={tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Qo="has-toolbar",Jo="fancybox__toolbar";class ta extends Hs{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Xo.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(t){var e;if(!t.carousel)return;let i=this.option("display"),n=this.option("absolute"),r=this.option("enabled");if("auto"===r){const t=this.instance.carousel;let e=0;if(t)for(const i of t.slides)(i.panzoom||"image"===i.type)&&e++;e||(r=!1)}r||(i=void 0);let s=0;const o={left:[],middle:[],right:[]};if(i)for(const t of["left","middle","right"])for(const n of i[t]){const i=this.createEl(n);i&&(null===(e=o[t])||void 0===e||e.push(i),s++)}let a=null;if(s&&(a=this.createContainer()),a){for(const[t,e]of Object.entries(o)){const i=document.createElement("div");ks(i,Jo+"__column is-"+t);for(const t of e)i.appendChild(t);"auto"!==n||"middle"!==t||e.length||(n=!0),a.appendChild(i)}!0===n&&ks(a,"is-absolute"),this.state=Xo.Ready,this.onRefresh()}else this.state=Xo.Disabled}onClick(t){var e,i;const n=this.instance,r=n.getSlide(),s=null==r?void 0:r.panzoom,o=t.target,a=o&&As(o)?o.dataset:null;if(!a)return;if(void 0!==a.fancyboxToggleThumbs)return t.preventDefault(),t.stopPropagation(),void(null===(e=n.plugins.Thumbs)||void 0===e||e.toggle());if(void 0!==a.fancyboxToggleFullscreen)return t.preventDefault(),t.stopPropagation(),void this.instance.toggleFullscreen();if(void 0!==a.fancyboxToggleSlideshow){t.preventDefault(),t.stopPropagation();const e=null===(i=n.carousel)||void 0===i?void 0:i.plugins.Autoplay;let r=e.isActive;return s&&"mousemove"===s.panMode&&!r&&s.reset(),void(r?e.stop():e.start())}const l=a.panzoomAction,c=a.panzoomChange;if((c||l)&&(t.preventDefault(),t.stopPropagation()),c){let e={};try{e=JSON.parse(c)}catch(t){}s&&s.applyChange(e)}else l&&s&&s[l]&&s[l]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const t=this.container;if(!t)return;const e=this.instance.getSlide();if(!e||e.state!==ho.Ready)return;const i=e&&!e.error&&e.panzoom;for(const e of t.querySelectorAll("[data-panzoom-action]"))i?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));let n=i&&i.canZoomIn(),r=i&&i.canZoomOut();for(const e of t.querySelectorAll('[data-panzoom-action="zoomIn"]'))n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(const e of t.querySelectorAll('[data-panzoom-action="zoomOut"]'))r?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(const e of t.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){r||n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));const t=e.querySelector("g");t&&(t.style.display=n?"":"none")}}onDone(t,e){var i;null===(i=e.panzoom)||void 0===i||i.on("afterTransform",(()=>{this.instance.isCurrentSlide(e)&&this.onRefresh()})),this.instance.isCurrentSlide(e)&&this.onRefresh()}createContainer(){const t=this.instance.container;if(!t)return null;const e=this.option("parentEl")||t;let i=e.querySelector("."+Jo);return i||(i=document.createElement("div"),ks(i,Jo),e.prepend(i)),i.addEventListener("click",this.onClick,{passive:!1,capture:!0}),t&&ks(t,Qo),this.container=i,i}createEl(t){const e=this.instance,i=e.carousel;if(!i)return null;if("toggleFS"===t)return null;if("fullscreen"===t&&!ao())return null;let n=null;const r=i.slides.length||0;let s=0,o=0;for(const t of i.slides)(t.panzoom||"image"===t.type)&&s++,("image"===t.type||t.downloadSrc)&&o++;if(r<2&&["infobar","prev","next"].includes(t))return n;if(void 0!==Yo[t]&&!s)return null;if("download"===t&&!o)return null;if("thumbs"===t){const t=e.plugins.Thumbs;if(!t||!t.isEnabled)return null}if("slideshow"===t&&(!i.plugins.Autoplay||r<2))return null;if(void 0!==Yo[t]){const e=Yo[t];n=document.createElement("button"),n.setAttribute("title",this.instance.localize(`{{${t.toUpperCase()}}}`)),ks(n,"f-button"),e.action&&(n.dataset.panzoomAction=e.action),e.change&&(n.dataset.panzoomChange=JSON.stringify(e.change)),n.appendChild(ls(this.instance.localize(e.icon)))}else{const e=(this.option("items")||[])[t];e&&(n=ls(this.instance.localize(e.tpl)),"function"==typeof e.click&&n.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof e.click&&e.click.call(this,this,t)})))}const a=null==n?void 0:n.querySelector("svg");if(a)for(const[t,e]of Object.entries(Ko))a.getAttribute(t)||a.setAttribute(t,String(e));return n}removeContainer(){const t=this.container;t&&t.remove(),this.container=null,this.state=Xo.Disabled;const e=this.instance.container;e&&Cs(e,Qo)}attach(){const t=this,e=t.instance;e.on("Carousel.initSlides",t.onReady),e.on("done",t.onDone),e.on(["reveal","Carousel.change"],t.onChange),t.onReady(t.instance)}detach(){const t=this,e=t.instance;e.off("Carousel.initSlides",t.onReady),e.off("done",t.onDone),e.off(["reveal","Carousel.change"],t.onChange),t.removeContainer()}}Object.defineProperty(ta,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null}});const ea={Hash:class extends Hs{onReady(){po=!1}onChange(t){mo&&clearTimeout(mo);const{hash:e}=go(),{hash:i}=_o(),n=t.isOpeningSlide(t.getSlide());n&&(uo=i===e?"":i),e&&e!==i&&(mo=setTimeout((()=>{try{if(t.state===co.Ready){let t="replaceState";n&&!fo&&(t="pushState",fo=!0),window.history[t]({},document.title,window.location.pathname+window.location.search+e)}}catch(t){}}),300))}onClose(t){if(mo&&clearTimeout(mo),!po&&fo)return fo=!1,po=!1,void window.history.back();if(!po)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(uo||""))}catch(t){}}attach(){const t=this.instance;t.on("ready",this.onReady),t.on(["Carousel.ready","Carousel.change"],this.onChange),t.on("close",this.onClose)}detach(){const t=this.instance;t.off("ready",this.onReady),t.off(["Carousel.ready","Carousel.change"],this.onChange),t.off("close",this.onClose)}static parseURL(){return _o()}static startFromUrl(){yo()}static destroy(){window.removeEventListener("hashchange",bo,!1)}},Html:Do,Images:Eo,Slideshow:Fo,Thumbs:Zo,Toolbar:ta},ia="with-fancybox",na="hide-scrollbar",ra="--fancybox-scrollbar-compensate",sa="--fancybox-body-margin",oa="aria-hidden",aa="is-using-tab",la="is-animated",ca="is-compact",ha="is-loading",ua="is-opening",da="has-caption",pa="disabled",fa="tabindex",ma="download",ga="href",_a="src",ya=t=>"string"==typeof t,va=function(){var t=window.getSelection();return!!t&&"Range"===t.type};let ba,xa=null,wa=null,Ea=0,Sa=0;const Ta=new Map;let Ma=0;class Aa extends bs{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(t=[],e={},i={}){super(e),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:co.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),ba||(ba=ao()),this.id=e.id||++Ma,Ta.set(this.id,this),this.userSlides=t,this.userPlugins=i,queueMicrotask((()=>{this.init()}))}init(){if(this.state===co.Destroy)return;this.state=co.Init,this.attachPlugins(Object.assign(Object.assign({},Aa.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),!0===this.option("hideScrollbar")&&(()=>{if(!no)return;const t=document,e=t.body,i=t.documentElement;if(e.classList.contains(na))return;let n=window.innerWidth-i.getBoundingClientRect().width;const r=parseFloat(window.getComputedStyle(e).marginRight);n<0&&(n=0),i.style.setProperty(ra,`${n}px`),r&&e.style.setProperty(sa,`${r}px`),e.classList.add(na)})(),this.initLayout(),this.scale();const t=()=>{this.initCarousel(this.userSlides),this.state=co.Ready,this.attachEvents(),this.emit("ready"),setTimeout((()=>{this.container&&this.container.setAttribute(oa,"false")}),16)};this.option("Fullscreen.autoStart")&&ba&&!ba.isFullscreen()?ba.request().then((()=>{this.startedFs=!0,t()})).catch((()=>t())):t()}initLayout(){var t,e;const i=this.option("parentEl")||document.body,n=ls(this.localize(this.option("tpl.main")||""));n&&(n.setAttribute("id",`fancybox-${this.id}`),n.setAttribute("aria-label",this.localize("{{MODAL}}")),n.classList.toggle(ca,this.isCompact),ks(n,this.option("mainClass")||""),ks(n,ua),this.container=n,this.footer=n.querySelector(".fancybox__footer"),i.appendChild(n),ks(document.documentElement,ia),xa&&wa||(xa=document.createElement("span"),ks(xa,"fancybox-focus-guard"),xa.setAttribute(fa,"0"),xa.setAttribute(oa,"true"),xa.setAttribute("aria-label","Focus guard"),wa=xa.cloneNode(),null===(t=n.parentElement)||void 0===t||t.insertBefore(xa,n),null===(e=n.parentElement)||void 0===e||e.append(wa)),n.addEventListener("mousedown",(t=>{Ea=t.pageX,Sa=t.pageY,Cs(n,aa)})),this.option("animated")&&(ks(n,la),setTimeout((()=>{this.isClosing()||Cs(n,la)}),350)),this.emit("initLayout"))}initCarousel(t){const e=this.container;if(!e)return;const i=e.querySelector(".fancybox__carousel");if(!i)return;const n=this.carousel=new eo(i,_s({},{slides:t,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));n.on("*",((t,e,...i)=>{this.emit(`Carousel.${e}`,t,...i)})),n.on(["ready","change"],(()=>{this.manageCaption()})),this.on("Carousel.removeSlide",((t,e,i)=>{this.clearContent(i),i.state=void 0})),n.on("Panzoom.touchStart",(()=>{var t,e;this.isCompact||this.endIdle(),(null===(t=document.activeElement)||void 0===t?void 0:t.closest(".f-thumbs"))&&(null===(e=this.container)||void 0===e||e.focus())})),n.on("settle",(()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()})),this.option("dragToClose")&&(n.on("Panzoom.afterTransform",((t,e)=>{const i=this.getSlide();if(i&&os(i.el))return;const n=this.container;if(n){const t=Math.abs(e.current.f),i=t<1?"":Math.max(.5,Math.min(1,1-t/e.contentRect.fitHeight*1.5));n.style.setProperty("--fancybox-ts",i?"0s":""),n.style.setProperty("--fancybox-opacity",i+"")}})),n.on("Panzoom.touchEnd",((t,e,i)=>{var n;const r=this.getSlide();if(r&&os(r.el))return;if(e.isMobile&&document.activeElement&&-1!==["TEXTAREA","INPUT"].indexOf(null===(n=document.activeElement)||void 0===n?void 0:n.nodeName))return;const s=Math.abs(e.dragOffset.y);"y"===e.lockedAxis&&(s>=200||s>=50&&e.dragOffset.time<300)&&(i&&i.cancelable&&i.preventDefault(),this.close(i,"f-throwOut"+(e.current.f<0?"Up":"Down")))}))),n.on("change",(t=>{var e;let i=null===(e=this.getSlide())||void 0===e?void 0:e.triggerEl;if(i){const e=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}})),n.on(["refresh","change"],(t=>{const e=this.container;if(!e)return;for(const i of e.querySelectorAll("[data-fancybox-current-index]"))i.innerHTML=t.page+1;for(const i of e.querySelectorAll("[data-fancybox-count]"))i.innerHTML=t.pages.length;if(!t.isInfinite){for(const i of e.querySelectorAll("[data-fancybox-next]"))t.page<t.pages.length-1?(i.removeAttribute(pa),i.removeAttribute(fa)):(i.setAttribute(pa,""),i.setAttribute(fa,"-1"));for(const i of e.querySelectorAll("[data-fancybox-prev]"))t.page>0?(i.removeAttribute(pa),i.removeAttribute(fa)):(i.setAttribute(pa,""),i.setAttribute(fa,"-1"))}const i=this.getSlide();if(!i)return;let n=i.downloadSrc||"";n||"image"!==i.type||i.error||!ya(i[_a])||(n=i[_a]);for(const t of e.querySelectorAll("[data-fancybox-download]")){const e=i.downloadFilename;n?(t.removeAttribute(pa),t.removeAttribute(fa),t.setAttribute(ga,n),t.setAttribute(ma,e||n),t.setAttribute("target","_blank")):(t.setAttribute(pa,""),t.setAttribute(fa,"-1"),t.removeAttribute(ga),t.removeAttribute(ma))}})),this.emit("initCarousel")}attachEvents(){const t=this,e=t.container;if(!e)return;e.addEventListener("click",t.onClick,{passive:!1,capture:!1}),e.addEventListener("wheel",t.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",t.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",t.onVisibilityChange,!1),document.addEventListener("mousemove",t.onMousemove),t.option("trapFocus")&&document.addEventListener("focus",t.onFocus,!0),window.addEventListener("resize",t.onResize);const i=window.visualViewport;i&&(i.addEventListener("scroll",t.onResize),i.addEventListener("resize",t.onResize))}detachEvents(){const t=this,e=t.container;if(!e)return;document.removeEventListener("keydown",t.onKeydown,{passive:!1,capture:!0}),e.removeEventListener("wheel",t.onWheel,{passive:!1,capture:!1}),e.removeEventListener("click",t.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",t.onMousemove),window.removeEventListener("resize",t.onResize);const i=window.visualViewport;i&&(i.removeEventListener("resize",t.onResize),i.removeEventListener("scroll",t.onResize)),document.removeEventListener("visibilitychange",t.onVisibilityChange,!1),document.removeEventListener("focus",t.onFocus,!0)}scale(){const t=this.container;if(!t)return;const e=window.visualViewport,i=Math.max(1,(null==e?void 0:e.scale)||1);let n="",r="",s="";if(e&&i>1){let t=`${e.offsetLeft}px`,o=`${e.offsetTop}px`;n=e.width*i+"px",r=e.height*i+"px",s=`translate3d(${t}, ${o}, 0) scale(${1/i})`}t.style.transform=s,t.style.width=n,t.style.height=r}onClick(t){var e;const{container:i,isCompact:n}=this;if(!i||this.isClosing())return;!n&&this.option("idle")&&this.resetIdle();const r=t.composedPath()[0];if(r.closest(".fancybox-spinner")||r.closest("[data-fancybox-close]"))return t.preventDefault(),void this.close(t);if(r.closest("[data-fancybox-prev]"))return t.preventDefault(),void this.prev();if(r.closest("[data-fancybox-next]"))return t.preventDefault(),void this.next();if("click"===t.type&&0===t.detail)return;if(Math.abs(t.pageX-Ea)>30||Math.abs(t.pageY-Sa)>30)return;const s=document.activeElement;if(va()&&s&&i.contains(s))return;if(n&&"image"===(null===(e=this.getSlide())||void 0===e?void 0:e.type))return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout((()=>{this.toggleIdle(),this.clickTimer=null}),350));if(this.emit("click",t),t.defaultPrevented)return;let o=!1;if(r.closest(".fancybox__content")){if(s){if(s.closest("[contenteditable]"))return;r.matches(so)||s.blur()}if(va())return;o=this.option("contentClick")}else r.closest(".fancybox__carousel")&&!r.matches(so)&&(o=this.option("backdropClick"));"close"===o?(t.preventDefault(),this.close(t)):"next"===o?(t.preventDefault(),this.next()):"prev"===o&&(t.preventDefault(),this.prev())}onWheel(t){const e=t.target;let i=this.option("wheel",t);e.closest(".fancybox__thumbs")&&(i="slide");const n="slide"===i,r=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t})),s=Math.max(-1,Math.min(1,r)),o=Date.now();this.pwt&&o-this.pwt<300?n&&t.preventDefault():(this.pwt=o,this.emit("wheel",t,s),t.defaultPrevented||("close"===i?(t.preventDefault(),this.close(t)):"slide"===i&&(as(e)||(t.preventDefault(),this[s>0?"prev":"next"]()))))}onKeydown(t){if(!this.isTopmost())return;this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle();const e=t.key,i=this.option("keyboard");if(!i)return;const n=t.composedPath()[0],r=document.activeElement&&document.activeElement.classList,s=r&&r.contains("f-button")||n.dataset.carouselPage||n.dataset.carouselIndex;if("Escape"!==e&&!s&&As(n)&&(n.isContentEditable||-1!==["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(n.nodeName)))return;if("Tab"===t.key?ks(this.container,aa):Cs(this.container,aa),t.ctrlKey||t.altKey||t.shiftKey)return;this.emit("keydown",e,t);const o=i[e];o&&"function"==typeof this[o]&&(t.preventDefault(),this[o]())}onResize(){const t=this.container;if(!t)return;const e=this.isCompact;t.classList.toggle(ca,e),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize")}onFocus(t){this.isTopmost()&&this.checkFocus(t)}onMousemove(t){this.prevMouseMoveEvent=t,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){"visible"===document.visibilityState?this.checkFocus():this.endIdle()}manageCloseBtn(t){const e=this.optionFor(t,"closeButton")||!1;if("auto"===e){const t=this.plugins.Toolbar;if(t&&t.state===Xo.Ready)return}if(!e)return;if(!t.contentEl||t.closeBtnEl)return;const i=this.option("tpl.closeButton");if(i){const e=ls(this.localize(i));t.closeBtnEl=t.contentEl.appendChild(e),t.el&&ks(t.el,"has-close-btn")}}manageCaption(t=void 0){var e,i;const n="fancybox__caption",r=this.container;if(!r)return;Cs(r,da);const s=this.isCompact||this.option("commonCaption"),o=!s;if(this.caption&&this.stop(this.caption),o&&this.caption&&(this.caption.remove(),this.caption=null),s&&!this.caption)for(const t of(null===(e=this.carousel)||void 0===e?void 0:e.slides)||[])t.captionEl&&(t.captionEl.remove(),t.captionEl=void 0,Cs(t.el,da),null===(i=t.el)||void 0===i||i.removeAttribute("aria-labelledby"));if(t||(t=this.getSlide()),!t||s&&!this.isCurrentSlide(t))return;const a=t.el;let l=this.optionFor(t,"caption","");if(!l)return void(s&&this.caption&&this.animate(this.caption,"f-fadeOut",(()=>{this.caption&&(this.caption.innerHTML="")})));let c=null;if(o){if(c=t.captionEl||null,a&&!c){const e=n+`_${this.id}_${t.index}`;c=document.createElement("div"),ks(c,n),c.setAttribute("id",e),t.captionEl=a.appendChild(c),ks(a,da),a.setAttribute("aria-labelledby",e)}}else c=this.caption,c||(c=r.querySelector("."+n)),c||(c=document.createElement("div"),c.dataset.fancyboxCaption="",ks(c,n),(this.footer||r).prepend(c)),ks(r,da),this.caption=c;c&&(c.innerHTML="",ya(l)||"number"==typeof l?c.innerHTML=l+"":l instanceof HTMLElement&&c.appendChild(l))}checkFocus(t){this.focus(t)}focus(t){var e;if(this.ignoreFocusChange)return;const i=document.activeElement||null,n=(null==t?void 0:t.target)||null,r=this.container,s=null===(e=this.carousel)||void 0===e?void 0:e.viewport;if(!r||!s)return;if(!t&&i&&r.contains(i))return;const o=this.getSlide(),a=o&&o.state===ho.Ready?o.el:null;if(!a||a.contains(i)||r===i)return;t&&t.cancelable&&t.preventDefault(),this.ignoreFocusChange=!0;const l=Array.from(r.querySelectorAll(so));let c=[],h=null;for(let t of l){const e=!t.offsetParent||!!t.closest('[aria-hidden="true"]'),i=a&&a.contains(t),n=!s.contains(t);if(t===r||(i||n)&&!e){c.push(t);const e=t.dataset.origTabindex;void 0!==e&&e&&(t.tabIndex=parseFloat(e)),t.removeAttribute("data-orig-tabindex"),!t.hasAttribute("autoFocus")&&h||(h=t)}else{const e=void 0===t.dataset.origTabindex?t.getAttribute("tabindex")||"":t.dataset.origTabindex;e&&(t.dataset.origTabindex=e),t.tabIndex=-1}}let u=null;t?(!n||c.indexOf(n)<0)&&(u=h||r,c.length&&(i===wa?u=c[0]:this.lastFocus!==r&&i!==xa||(u=c[c.length-1]))):u=o&&"image"===o.type?r:h||r,u&&oo(u),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const t=this.carousel;t&&t.pages.length>1&&t.slideNext()}prev(){const t=this.carousel;t&&t.pages.length>1&&t.slidePrev()}jumpTo(...t){this.carousel&&this.carousel.slideTo(...t)}isTopmost(){var t;return(null===(t=Aa.getInstance())||void 0===t?void 0:t.id)==this.id}animate(t=null,e="",i){if(!t||!e)return void(i&&i());this.stop(t);const n=r=>{r.target===t&&t.dataset.animationName&&(t.removeEventListener("animationend",n),delete t.dataset.animationName,i&&i(),Cs(t,e))};t.dataset.animationName=e,t.addEventListener("animationend",n),ks(t,e)}stop(t){t&&t.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:t}))}setContent(t,e="",i=!0){if(this.isClosing())return;const n=t.el;if(!n)return;let r=null;if(As(e)?r=e:(r=ls(e+""),As(r)||(r=document.createElement("div"),r.innerHTML=e+"")),["img","picture","iframe","video","audio"].includes(r.nodeName.toLowerCase())){const t=document.createElement("div");t.appendChild(r),r=t}As(r)&&t.filter&&!t.error&&(r=r.querySelector(t.filter)),r&&As(r)?(ks(r,"fancybox__content"),t.id&&r.setAttribute("id",t.id),"none"!==r.style.display&&"none"!==getComputedStyle(r).getPropertyValue("display")||(r.style.display=t.display||this.option("defaultDisplay")||"flex"),n.classList.add(`has-${t.error?"error":t.type||"unknown"}`),n.prepend(r),t.contentEl=r,i&&this.revealContent(t),this.manageCloseBtn(t),this.manageCaption(t)):this.setError(t,"{{ELEMENT_NOT_FOUND}}")}revealContent(t,e){const i=t.el,n=t.contentEl;i&&n&&(this.emit("reveal",t),this.hideLoading(t),t.state=ho.Opening,(e=this.isOpeningSlide(t)?void 0===e?this.optionFor(t,"showClass"):e:"f-fadeIn")?this.animate(n,e,(()=>{this.done(t)})):this.done(t))}done(t){this.isClosing()||(t.state=ho.Ready,this.emit("done",t),ks(t.el,"is-done"),this.isCurrentSlide(t)&&this.option("autoFocus")&&queueMicrotask((()=>{var e;null===(e=t.panzoom)||void 0===e||e.updateControls(),this.option("autoFocus")&&this.focus()})),this.isOpeningSlide(t)&&(Cs(this.container,ua),!this.isCompact&&this.option("idle")&&this.setIdle()))}isCurrentSlide(t){const e=this.getSlide();return!(!t||!e)&&e.index===t.index}isOpeningSlide(t){var e,i;return null===(null===(e=this.carousel)||void 0===e?void 0:e.prevPage)&&t&&t.index===(null===(i=this.getSlide())||void 0===i?void 0:i.index)}showLoading(t){t.state=ho.Loading;const e=t.el;e&&(ks(e,ha),this.emit("loading",t),t.spinnerEl||setTimeout((()=>{if(!this.isClosing()&&!t.spinnerEl&&t.state===ho.Loading){let i=ls(Ms);ks(i,"fancybox-spinner"),t.spinnerEl=i,e.prepend(i),this.animate(i,"f-fadeIn")}}),250))}hideLoading(t){const e=t.el;if(!e)return;const i=t.spinnerEl;this.isClosing()?null==i||i.remove():(Cs(e,ha),i&&this.animate(i,"f-fadeOut",(()=>{i.remove()})),t.state===ho.Loading&&(this.emit("loaded",t),t.state=ho.Ready))}setError(t,e){if(this.isClosing())return;const i=new Event("error",{bubbles:!0,cancelable:!0});if(this.emit("error",i,t),i.defaultPrevented)return;t.error=e,this.hideLoading(t),this.clearContent(t);const n=document.createElement("div");n.classList.add("fancybox-error"),n.innerHTML=this.localize(e||"<p>{{ERROR}}</p>"),this.setContent(t,n)}clearContent(t){if(void 0===t.state)return;this.emit("clearContent",t),t.contentEl&&(t.contentEl.remove(),t.contentEl=void 0);const e=t.el;e&&(Cs(e,"has-error"),Cs(e,"has-unknown"),Cs(e,`has-${t.type||"unknown"}`)),t.closeBtnEl&&t.closeBtnEl.remove(),t.closeBtnEl=void 0,t.captionEl&&t.captionEl.remove(),t.captionEl=void 0,t.spinnerEl&&t.spinnerEl.remove(),t.spinnerEl=void 0}getSlide(){var t;const e=this.carousel;return(null===(t=null==e?void 0:e.pages[null==e?void 0:e.page])||void 0===t?void 0:t.slides[0])||void 0}close(t,e){if(this.isClosing())return;const i=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",i,t),i.defaultPrevented)return;t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());const n=()=>{this.proceedClose(t,e)};this.startedFs&&ba&&ba.isFullscreen()?Promise.resolve(ba.exit()).then((()=>n())):n()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(t=!1){const e=()=>{this.clearIdle(),this.idle=!0,ks(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(t)e();else{const t=this.option("idle");t&&(this.idleTimer=setTimeout(e,t))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,Cs(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){ba&&(ba.isFullscreen()?ba.exit():ba.request().then((()=>{this.startedFs=!0})))}isClosing(){return[co.Closing,co.CustomClosing,co.Destroy].includes(this.state)}proceedClose(t,e){var i,n;this.state=co.Closing,this.clearIdle(),this.detachEvents();const r=this.container,s=this.carousel,o=this.getSlide(),a=o&&this.option("placeFocusBack")?o.triggerEl||this.option("triggerEl"):null;if(a&&(io(a)?oo(a):a.focus()),r&&(Cs(r,ua),ks(r,"is-closing"),r.setAttribute(oa,"true"),this.option("animated")&&ks(r,la),r.style.pointerEvents="none"),s){s.clearTransitions(),null===(i=s.panzoom)||void 0===i||i.destroy(),null===(n=s.plugins.Navigation)||void 0===n||n.detach();for(const t of s.slides){t.state=ho.Closing,this.hideLoading(t);const e=t.contentEl;e&&this.stop(e);const i=null==t?void 0:t.panzoom;i&&(i.stop(),i.detachEvents(),i.detachObserver()),this.isCurrentSlide(t)||s.emit("removeSlide",t)}}this.emit("close",t),this.state!==co.CustomClosing?(void 0===e&&o&&(e=this.optionFor(o,"hideClass")),e&&o?(this.animate(o.contentEl,e,(()=>{s&&s.emit("removeSlide",o)})),setTimeout((()=>{this.destroy()}),500)):this.destroy()):setTimeout((()=>{this.destroy()}),500)}destroy(){var t;if(this.state===co.Destroy)return;this.state=co.Destroy,null===(t=this.carousel)||void 0===t||t.destroy();const e=this.container;e&&e.remove(),Ta.delete(this.id);const i=Aa.getInstance();i?i.focus():(xa&&(xa.remove(),xa=null),wa&&(wa.remove(),wa=null),Cs(document.documentElement,ia),(()=>{if(!no)return;const t=document,e=t.body;e.classList.remove(na),e.style.setProperty(sa,""),t.documentElement.style.setProperty(ra,"")})(),this.emit("destroy"))}static bind(t,e,i){if(!no)return;let n,r="",s={};if(void 0===t?n=document.body:ya(t)?(n=document.body,r=t,"object"==typeof e&&(s=e||{})):(n=t,ya(e)&&(r=e),"object"==typeof i&&(s=i||{})),!n||!As(n))return;r=r||"[data-fancybox]";const o=Aa.openers.get(n)||new Map;o.set(r,s),Aa.openers.set(n,o),1===o.size&&n.addEventListener("click",Aa.fromEvent)}static unbind(t,e){let i,n="";if(ya(t)?(i=document.body,n=t):(i=t,ya(e)&&(n=e)),!i)return;const r=Aa.openers.get(i);r&&n&&r.delete(n),n&&r||(Aa.openers.delete(i),i.removeEventListener("click",Aa.fromEvent))}static destroy(){let t;for(;t=Aa.getInstance();)t.destroy();for(const t of Aa.openers.keys())t.removeEventListener("click",Aa.fromEvent);Aa.openers=new Map}static fromEvent(t){if(t.defaultPrevented)return;if(t.button&&0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey)return;let e=t.composedPath()[0];const i=e.closest("[data-fancybox-trigger]");if(i){const t=i.dataset.fancyboxTrigger||"",n=document.querySelectorAll(`[data-fancybox="${t}"]`),r=parseInt(i.dataset.fancyboxIndex||"",10)||0;e=n[r]||e}if(!(e&&e instanceof Element))return;let n,r,s,o;if([...Aa.openers].reverse().find((([t,i])=>!(!t.contains(e)||![...i].reverse().find((([i,a])=>{let l=e.closest(i);return!!l&&(n=t,r=i,s=l,o=a,!0)}))))),!n||!r||!s)return;o=o||{},t.preventDefault(),e=s;let a=[],l=_s({},lo,o);l.event=t,l.triggerEl=e,l.delegate=i;const c=l.groupAll,h=l.groupAttr,u=h&&e?e.getAttribute(`${h}`):"";if((!e||u||c)&&(a=[].slice.call(n.querySelectorAll(r))),e&&!c&&(a=u?a.filter((t=>t.getAttribute(`${h}`)===u)):[e]),!a.length)return;const d=Aa.getInstance();return d&&d.options.triggerEl&&a.indexOf(d.options.triggerEl)>-1?void 0:(e&&(l.startIndex=a.indexOf(e)),Aa.fromNodes(a,l))}static fromSelector(t,e,i){let n=null,r="",s={};if(ya(t)?(n=document.body,r=t,"object"==typeof e&&(s=e||{})):t instanceof HTMLElement&&ya(e)&&(n=t,r=e,"object"==typeof i&&(s=i||{})),!n||!r)return!1;const o=Aa.openers.get(n);return!!o&&(s=_s({},o.get(r)||{},s),!!s&&Aa.fromNodes(Array.from(n.querySelectorAll(r)),s))}static fromNodes(t,e){e=_s({},lo,e||{});const i=[];for(const n of t){const t=n.dataset||{},r=t[_a]||n.getAttribute(ga)||n.getAttribute("currentSrc")||n.getAttribute(_a)||void 0;let s;const o=e.delegate;let a;o&&i.length===e.startIndex&&(s=o instanceof HTMLImageElement?o:o.querySelector("img:not([aria-hidden])")),s||(s=n instanceof HTMLImageElement?n:n.querySelector("img:not([aria-hidden])")),s&&(a=s.currentSrc||s[_a]||void 0,!a&&s.dataset&&(a=s.dataset.lazySrc||s.dataset[_a]||void 0));const l={src:r,triggerEl:n,thumbEl:s,thumbElSrc:a,thumbSrc:a};for(const e in t){let i=t[e]+"";i="false"!==i&&("true"===i||i),l[e]=i}i.push(l)}return new Aa(i,e)}static getInstance(t){return t?Ta.get(t):Array.from(Ta.values()).reverse().find((t=>!t.isClosing()&&t))||null}static getSlide(){var t;return(null===(t=Aa.getInstance())||void 0===t?void 0:t.getSlide())||null}static show(t=[],e={}){return new Aa(t,e)}static next(){const t=Aa.getInstance();t&&t.next()}static prev(){const t=Aa.getInstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of Ta.values())t.close(...e);else{const t=Aa.getInstance();t&&t.close(...e)}}}Object.defineProperty(Aa,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.34"}),Object.defineProperty(Aa,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:lo}),Object.defineProperty(Aa,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:ea}),Object.defineProperty(Aa,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map});__webpack_require__(9313);var Ca=t=>{Aa.bind("[data-fancybox]",{dragToClose:!1,autoFocus:!1,on:{init:()=>{t.plugins.lenis.stop()},close:()=>{t.plugins.lenis.start()}}})},ka=__webpack_require__(9766),Pa=__webpack_require__.n(ka),Ia=[C,qi,Qi,nn,on,Qr,rs,Ca,()=>{var t=new(Pa());return APP.plugins.lazyload=t,t}];class Da extends E{constructor(t,e){super(),this.$element=t,this.ctx=e}init(){}destroy(){}}var Oa=class extends Da{constructor(t,e){super(t,e),s(this,"openSearchPopupBtn",void 0),s(this,"closeSearchPopupBtn",void 0),s(this,"searchPopup",void 0),s(this,"isSearchPopupOpen",!1),s(this,"closeSearchPopup",(()=>{this.isSearchPopupOpen=!1,this.searchPopup.classList.remove("_opened"),document.documentElement.classList.remove("_open-search-popup"),document.documentElement.classList.contains("_menu-opened")||this.ctx.plugins.lenis.start()})),s(this,"openSearchPopup",(()=>{this.isSearchPopupOpen=!0,this.searchPopup.classList.add("_opened"),document.documentElement.classList.add("_open-search-popup"),this.ctx.plugins.lenis.stop()})),this.togglePopup=this.toggleSearchPopup.bind(this),this.resizeHandler=this.onResize.bind(this)}init(){this.onResize(),window.addEventListener("resize",this.resizeHandler),window.SearchPopup=this,this.searchPopup=document.querySelector(".js-search-popup"),this.closeSearchPopupBtn=this.searchPopup.querySelector(".js-search-popup-close"),this.openSearchPopupBtn=this.$element.querySelector(".js-search-popup-toggle"),this.openSearchPopupBtn.addEventListener("click",(()=>{this.togglePopup(),this.searchPopup.classList.contains("_opened")&&document.addEventListener("click",(t=>{t.target.closest(".search-popup__owerlay")&&this.closeSearchPopup()}))})),this.$element.classList.contains("_contrast")&&document.documentElement.classList.add("_contrast"),this.closeSearchPopupBtn.addEventListener("click",(()=>{this.closeSearchPopup()}))}destroy(){window.removeEventListener("resize",this.resizeHandler),this.openSearchPopupBtn.removeEventListener("click",(()=>{this.togglePopup(),this.searchPopup.classList.contains("_opened")&&document.removeEventListener("click",(t=>{t.target.closest(".search-popup__owerlay")&&this.closeSearchPopup()}))})),this.closeSearchPopupBtn.removeEventListener("click",(()=>{this.closeSearchPopup()}))}toggleSearchPopup(){var t;null===(t=window)||void 0===t||null===(t=t.SitesMenu)||void 0===t||t.closeMenu(),this.isSearchPopupOpen?this.closeSearchPopup():this.openSearchPopup()}onResize(){var t=document.documentElement;t.style.setProperty("--header-height","".concat(this.$element.offsetHeight,"px")),t.style.setProperty("--header-top-height","".concat(this.$element.querySelector(".header__row._top").offsetHeight,"px"))}};function La(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function za(t,e){return function(t,e){return e.get?e.get.call(t):e.value}(t,La(t,e,"get"))}function Ra(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,La(t,e,"set"),i),i}function Fa(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Ba=new WeakMap;var Na=class extends Da{constructor(t,e){super(t,e),Fa(this,Ba,{writable:!0,value:void 0}),Ra(this,Ba,this.onClick.bind(this))}init(){this.$element.addEventListener("click",za(this,Ba))}destroy(){this.$element.removeEventListener("click",za(this,Ba))}onClick(){this.ctx.plugins.lenis.scrollTo(0)}};function ja(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Va="open",Ua=new WeakMap;var $a=class extends Da{constructor(t,e){super(t,e),s(this,"$trigger",void 0),s(this,"$content",void 0),s(this,"state",void 0),ja(this,Ua,{writable:!0,value:void 0}),this.$trigger=this.$element.querySelector(".js-useful-links__trigger"),this.$content=this.$element.querySelector(".js-useful-links__content"),Ra(this,Ua,this.onClick.bind(this))}init(){this.$trigger.addEventListener("click",za(this,Ua))}destroy(){this.$trigger.removeEventListener("change",za(this,Ua))}onClick(){this.state=!this.state,this.state?this.open():this.close()}open(){this.$element.classList.add(Va),k.gsap.to(this.$content,{height:"auto"})}close(){this.$element.classList.remove(Va),k.gsap.to(this.$content,{height:0})}};function Ha(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var qa="open",Wa=".js-folder-card__trigger",Ga=".js-folder-card__tooltip",Za=".js-folder-card__share",Ya=new WeakMap,Xa=new WeakMap,Ka=new WeakMap;var Qa=class extends Da{constructor(t,e){super(t,e),s(this,"$trigger",void 0),s(this,"$tooltip",void 0),s(this,"$share",void 0),s(this,"state",!1),s(this,"shareData",{}),Ha(this,Ya,{writable:!0,value:void 0}),Ha(this,Xa,{writable:!0,value:void 0}),Ha(this,Ka,{writable:!0,value:void 0}),this.$trigger=this.$element.querySelector(Wa),this.$tooltip=this.$element.querySelector(Ga),this.$share=this.$element.querySelector(Za),Ra(this,Ya,this.onTriggerClick.bind(this)),Ra(this,Xa,this.onBodyClick.bind(this)),Ra(this,Ka,this.onShareClick.bind(this))}init(){this.$trigger.addEventListener("click",za(this,Ya)),this.$share&&this.$share.addEventListener("click",za(this,Ka))}destroy(){this.$trigger.removeEventListener("click",za(this,Ya)),this.$share.removeEventListener("click",za(this,Ka))}onTriggerClick(){this.state?this.hide():this.show()}onBodyClick(t){t.target.closest(Wa)||t.target.closest(Ga)||this.hide()}onShareClick(){var t=this;return i((function*(){var e=t.$share.dataset.shareUrl||window.location.href;try{yield navigator.clipboard.writeText(e),t.ctx.plugins.toasts.success("Скопировано в буфер обмена")}catch(e){t.ctx.plugins.toasts.error(e.message)}}))()}show(){this.state=!0,this.$tooltip.classList.add(qa),document.body.addEventListener("click",za(this,Xa))}hide(){this.state=!1,this.$tooltip.classList.remove(qa),document.body.removeEventListener("click",za(this,Xa))}};function Ja(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||console.error("Element is null"),t.style.transition="height 0.5s ease",t.style.overflow="hidden";e?i?t.style.height="auto":(()=>{var{width:e}=getComputedStyle(t);t.style.width=e,t.style.position="absolute",t.style.visibility="hidden",t.style.height="auto";var{height:i}=getComputedStyle(t);t.style.width=null,t.style.position=null,t.style.visibility=null,t.style.height=0,getComputedStyle(t).height,requestAnimationFrame((()=>{t.style.height=i}))})():i?t.style.height="0px":(()=>{var{height:e}=getComputedStyle(t);t.style.height=e,getComputedStyle(t).height,requestAnimationFrame((()=>{t.style.height=0}))})(),t._onCssAnimateEnd&&t.removeEventListener("transitionend",t._onCssAnimateEnd),t._onCssAnimateEnd=()=>{e&&(t.style.height="auto",t.style.pointerEvents="",t.style.overflow="visible")},t.addEventListener("transitionend",t._onCssAnimateEnd,{once:!0})}var tl="_opened",el="_active";class il extends Da{constructor(t,e){super(t,e),s(this,"state",!1),s(this,"toggle",null),s(this,"content",null),this.toggleHandler=this.onToggle.bind(this)}init(){this.toggle=this.$element.querySelector(".js-accordion-toggle"),this.content=this.$element.querySelector(".js-accordion-content"),this.close(!0),this.toggle.addEventListener("click",this.toggleHandler),this.$element.classList.contains("_active")&&(this.state=!0,this.open())}destroy(){this.toggle.removeEventListener("click",this.toggleHandler),this.$element.accordionInstance=null}onToggle(){this.state?this.close():this.open(),this.$element.classList.contains("_active")&&(this.close(),this.$element.classList.remove("_active"))}open(t){Ja(this.content,!0,t),this.$element.classList.add(tl),this.toggle.classList.add(el),this.state=!0,this.emit("open")}close(t){Ja(this.content,!1,t),this.$element.classList.remove(tl),this.toggle.classList.remove(el),this.state=!1,this.emit("close")}}var nl="object"==typeof global&&global&&global.Object===Object&&global,rl="object"==typeof self&&self&&self.Object===Object&&self,sl=nl||rl||Function("return this")(),ol=sl.Symbol;var al=function(t,e){for(var i=-1,n=null==t?0:t.length,r=Array(n);++i<n;)r[i]=e(t[i],i,t);return r},ll=Array.isArray,cl=Object.prototype,hl=cl.hasOwnProperty,ul=cl.toString,dl=ol?ol.toStringTag:void 0;var pl=function(t){var e=hl.call(t,dl),i=t[dl];try{t[dl]=void 0;var n=!0}catch(t){}var r=ul.call(t);return n&&(e?t[dl]=i:delete t[dl]),r},fl=Object.prototype.toString;var ml=function(t){return fl.call(t)},gl=ol?ol.toStringTag:void 0;var _l=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":gl&&gl in Object(t)?pl(t):ml(t)};var yl=function(t){return null!=t&&"object"==typeof t};var vl=function(t){return"symbol"==typeof t||yl(t)&&"[object Symbol]"==_l(t)},bl=ol?ol.prototype:void 0,xl=bl?bl.toString:void 0;var wl=function t(e){if("string"==typeof e)return e;if(ll(e))return al(e,t)+"";if(vl(e))return xl?xl.call(e):"";var i=e+"";return"0"==i&&1/e==-Infinity?"-0":i};var El=function(t){return null==t?"":wl(t)},Sl=0;var Tl=function(t){var e=++Sl;return El(t)+e},Ml="_active";function Al(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Cl="_open",kl="_fixed",Pl=new WeakMap,Il=new WeakMap,Dl=new WeakMap,Ol=new WeakMap;var Ll=class extends Da{constructor(t,e){super(t,e),s(this,"$trigger",void 0),s(this,"$content",void 0),s(this,"$footer",void 0),s(this,"state",void 0),s(this,"scrollValue",void 0),s(this,"needsAutoClose",!0),Al(this,Pl,{writable:!0,value:void 0}),Al(this,Il,{writable:!0,value:void 0}),Al(this,Dl,{writable:!0,value:void 0}),Al(this,Ol,{writable:!0,value:void 0}),this.$trigger=this.$element.querySelector(".js-sidebar__trigger"),this.$content=this.$element.querySelector(".js-sidebar__content"),this.$contentInner=this.$element.querySelector(".sidebar__content-inner"),this.$footer=document.querySelector(".js-useful-links, .footer"),this.$sidebarInner=this.$element.querySelector(".sidebar__inner"),Ra(this,Ol,this.$element.querySelectorAll(".sidebar__content-inner a")),Ra(this,Pl,this.onScroll.bind(this)),Ra(this,Il,this.onResize.bind(this)),Ra(this,Dl,this.onClick.bind(this)),this.$trigger.classList.contains(Cl)&&(this.state=!0)}init(){window.addEventListener("scroll",za(this,Pl),{passive:!0}),window.addEventListener("resize",za(this,Il)),this.$trigger.addEventListener("click",za(this,Dl)),this.onResize(),this.ctx.plugins.responsive.tablet&&(this.needsAutoClose=!1),za(this,Ol).forEach((t=>{if(-1!==t.href.search(new RegExp("/#block"))||t.href===/^#/g){var e=t.getAttribute("href"),i=e.indexOf("#"),n=e.slice(i),r=document.querySelector(n);t.href=n,t.addEventListener("click",(t=>{t.preventDefault(),r&&r.scrollIntoView({behavior:"smooth"})}))}}))}onScroll(){this.state&&this.setContentHeight();var t=this.$footer.getBoundingClientRect().top+window.scrollY;this.$trigger.getBoundingClientRect().bottom+window.scrollY>=t?(this.close(),k.gsap.to(this.$sidebarInner,{autoAlpha:0})):k.gsap.to(this.$sidebarInner,{autoAlpha:1}),this.scrollValue-20<=window.scrollY?(this.$element.classList.add(kl),this.needsAutoClose&&(this.needsAutoClose=!1,this.close())):this.$element.classList.remove(kl)}onResize(){this.state&&this.setContentHeight(),this.scrollValue=this.$element.getBoundingClientRect().top+window.scrollY}onClick(){this.state?this.close():this.open()}setContentHeight(){var t=this.$content.getBoundingClientRect().top+window.scrollY,e=this.$footer.getBoundingClientRect().top+window.scrollY,i=t+this.$contentInner.offsetHeight>e?e-t+"px":"auto";k.gsap.to(this.$content,{height:i,duration:.3})}open(){this.state=!0,this.$trigger.classList.add(Cl),this.setContentHeight()}close(){this.state=!1,this.$trigger.classList.remove(Cl),k.gsap.to(this.$content,{height:0,duration:.3})}};function zl(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function Rl(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(e).forEach((i=>{void 0===t[i]?t[i]=e[i]:zl(e[i])&&zl(t[i])&&Object.keys(e[i]).length>0&&Rl(t[i],e[i])}))}const Fl={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Bl(){const t="undefined"!=typeof document?document:{};return Rl(t,Fl),t}const Nl={document:Fl,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function jl(){const t="undefined"!=typeof window?window:{};return Rl(t,Nl),t}function Vl(t,e){return void 0===e&&(e=0),setTimeout(t,e)}function Ul(){return Date.now()}function $l(t,e){void 0===e&&(e="x");const i=jl();let n,r,s;const o=function(t){const e=jl();let i;return e.getComputedStyle&&(i=e.getComputedStyle(t,null)),!i&&t.currentStyle&&(i=t.currentStyle),i||(i=t.style),i}(t);return i.WebKitCSSMatrix?(r=o.transform||o.webkitTransform,r.split(",").length>6&&(r=r.split(", ").map((t=>t.replace(",","."))).join(", ")),s=new i.WebKitCSSMatrix("none"===r?"":r)):(s=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=s.toString().split(",")),"x"===e&&(r=i.WebKitCSSMatrix?s.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===e&&(r=i.WebKitCSSMatrix?s.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),r||0}function Hl(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function ql(){const t=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let n=1;n<arguments.length;n+=1){const r=n<0||arguments.length<=n?void 0:arguments[n];if(null!=r&&(i=r,!("undefined"!=typeof window&&void 0!==window.HTMLElement?i instanceof HTMLElement:i&&(1===i.nodeType||11===i.nodeType)))){const i=Object.keys(Object(r)).filter((t=>e.indexOf(t)<0));for(let e=0,n=i.length;e<n;e+=1){const n=i[e],s=Object.getOwnPropertyDescriptor(r,n);void 0!==s&&s.enumerable&&(Hl(t[n])&&Hl(r[n])?r[n].__swiper__?t[n]=r[n]:ql(t[n],r[n]):!Hl(t[n])&&Hl(r[n])?(t[n]={},r[n].__swiper__?t[n]=r[n]:ql(t[n],r[n])):t[n]=r[n])}}}var i;return t}function Wl(t,e,i){t.style.setProperty(e,i)}function Gl(t){let{swiper:e,targetPosition:i,side:n}=t;const r=jl(),s=-e.translate;let o,a=null;const l=e.params.speed;e.wrapperEl.style.scrollSnapType="none",r.cancelAnimationFrame(e.cssModeFrameID);const c=i>s?"next":"prev",h=(t,e)=>"next"===c&&t>=e||"prev"===c&&t<=e,u=()=>{o=(new Date).getTime(),null===a&&(a=o);const t=Math.max(Math.min((o-a)/l,1),0),c=.5-Math.cos(t*Math.PI)/2;let d=s+c*(i-s);if(h(d,i)&&(d=i),e.wrapperEl.scrollTo({[n]:d}),h(d,i))return e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout((()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[n]:d})})),void r.cancelAnimationFrame(e.cssModeFrameID);e.cssModeFrameID=r.requestAnimationFrame(u)};u()}function Zl(t){return t.querySelector(".swiper-slide-transform")||t.shadowRoot&&t.shadowRoot.querySelector(".swiper-slide-transform")||t}function Yl(t,e){return void 0===e&&(e=""),[...t.children].filter((t=>t.matches(e)))}function Xl(t){try{return void console.warn(t)}catch(t){}}function Kl(t,e){void 0===e&&(e=[]);const i=document.createElement(t);return i.classList.add(...Array.isArray(e)?e:function(t){return void 0===t&&(t=""),t.trim().split(" ").filter((t=>!!t.trim()))}(e)),i}function Ql(t,e){return jl().getComputedStyle(t,null).getPropertyValue(e)}function Jl(t){let e,i=t;if(i){for(e=0;null!==(i=i.previousSibling);)1===i.nodeType&&(e+=1);return e}}function tc(t,e){const i=[];let n=t.parentElement;for(;n;)e?n.matches(e)&&i.push(n):i.push(n),n=n.parentElement;return i}function ec(t,e,i){const n=jl();return i?t["width"===e?"offsetWidth":"offsetHeight"]+parseFloat(n.getComputedStyle(t,null).getPropertyValue("width"===e?"margin-right":"margin-top"))+parseFloat(n.getComputedStyle(t,null).getPropertyValue("width"===e?"margin-left":"margin-bottom")):t.offsetWidth}let ic,nc,rc;function sc(){return ic||(ic=function(){const t=jl(),e=Bl();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in t||t.DocumentTouch&&e instanceof t.DocumentTouch)}}()),ic}function oc(t){return void 0===t&&(t={}),nc||(nc=function(t){let{userAgent:e}=void 0===t?{}:t;const i=sc(),n=jl(),r=n.navigator.platform,s=e||n.navigator.userAgent,o={ios:!1,android:!1},a=n.screen.width,l=n.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/);let h=s.match(/(iPad).*OS\s([\d_]+)/);const u=s.match(/(iPod)(.*OS\s([\d_]+))?/),d=!h&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===r;let f="MacIntel"===r;return!h&&f&&i.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${a}x${l}`)>=0&&(h=s.match(/(Version)\/([\d.]+)/),h||(h=[0,1,"13_0_0"]),f=!1),c&&!p&&(o.os="android",o.android=!0),(h||d||u)&&(o.os="ios",o.ios=!0),o}(t)),nc}function ac(){return rc||(rc=function(){const t=jl();let e=!1;function i(){const e=t.navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}if(i()){const i=String(t.navigator.userAgent);if(i.includes("Version/")){const[t,n]=i.split("Version/")[1].split(" ")[0].split(".").map((t=>Number(t)));e=t<16||16===t&&n<2}}return{isSafari:e||i(),needPerspectiveFix:e,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent)}}()),rc}var lc={on(t,e,i){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!=typeof e)return n;const r=i?"unshift":"push";return t.split(" ").forEach((t=>{n.eventsListeners[t]||(n.eventsListeners[t]=[]),n.eventsListeners[t][r](e)})),n},once(t,e,i){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!=typeof e)return n;function r(){n.off(t,r),r.__emitterProxy&&delete r.__emitterProxy;for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];e.apply(n,s)}return r.__emitterProxy=e,n.on(t,r,i)},onAny(t,e){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;const n=e?"unshift":"push";return i.eventsAnyListeners.indexOf(t)<0&&i.eventsAnyListeners[n](t),i},offAny(t){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsAnyListeners)return e;const i=e.eventsAnyListeners.indexOf(t);return i>=0&&e.eventsAnyListeners.splice(i,1),e},off(t,e){const i=this;return!i.eventsListeners||i.destroyed?i:i.eventsListeners?(t.split(" ").forEach((t=>{void 0===e?i.eventsListeners[t]=[]:i.eventsListeners[t]&&i.eventsListeners[t].forEach(((n,r)=>{(n===e||n.__emitterProxy&&n.__emitterProxy===e)&&i.eventsListeners[t].splice(r,1)}))})),i):i},emit(){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsListeners)return t;let e,i,n;for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];"string"==typeof s[0]||Array.isArray(s[0])?(e=s[0],i=s.slice(1,s.length),n=t):(e=s[0].events,i=s[0].data,n=s[0].context||t),i.unshift(n);return(Array.isArray(e)?e:e.split(" ")).forEach((e=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach((t=>{t.apply(n,[e,...i])})),t.eventsListeners&&t.eventsListeners[e]&&t.eventsListeners[e].forEach((t=>{t.apply(n,i)}))})),t}};const cc=(t,e)=>{if(!t||t.destroyed||!t.params)return;const i=e.closest(t.isElement?"swiper-slide":`.${t.params.slideClass}`);if(i){let e=i.querySelector(`.${t.params.lazyPreloaderClass}`);!e&&t.isElement&&(i.shadowRoot?e=i.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`):requestAnimationFrame((()=>{i.shadowRoot&&(e=i.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`),e&&e.remove())}))),e&&e.remove()}},hc=(t,e)=>{if(!t.slides[e])return;const i=t.slides[e].querySelector('[loading="lazy"]');i&&i.removeAttribute("loading")},uc=t=>{if(!t||t.destroyed||!t.params)return;let e=t.params.lazyPreloadPrevNext;const i=t.slides.length;if(!i||!e||e<0)return;e=Math.min(e,i);const n="auto"===t.params.slidesPerView?t.slidesPerViewDynamic():Math.ceil(t.params.slidesPerView),r=t.activeIndex;if(t.params.grid&&t.params.grid.rows>1){const i=r,s=[i-e];return s.push(...Array.from({length:e}).map(((t,e)=>i+n+e))),void t.slides.forEach(((e,i)=>{s.includes(e.column)&&hc(t,i)}))}const s=r+n-1;if(t.params.rewind||t.params.loop)for(let n=r-e;n<=s+e;n+=1){const e=(n%i+i)%i;(e<r||e>s)&&hc(t,e)}else for(let n=Math.max(r-e,0);n<=Math.min(s+e,i-1);n+=1)n!==r&&(n>s||n<r)&&hc(t,n)};var dc={updateSize:function(){const t=this;let e,i;const n=t.el;e=void 0!==t.params.width&&null!==t.params.width?t.params.width:n.clientWidth,i=void 0!==t.params.height&&null!==t.params.height?t.params.height:n.clientHeight,0===e&&t.isHorizontal()||0===i&&t.isVertical()||(e=e-parseInt(Ql(n,"padding-left")||0,10)-parseInt(Ql(n,"padding-right")||0,10),i=i-parseInt(Ql(n,"padding-top")||0,10)-parseInt(Ql(n,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(i)&&(i=0),Object.assign(t,{width:e,height:i,size:t.isHorizontal()?e:i}))},updateSlides:function(){const t=this;function e(e,i){return parseFloat(e.getPropertyValue(t.getDirectionLabel(i))||0)}const i=t.params,{wrapperEl:n,slidesEl:r,size:s,rtlTranslate:o,wrongRTL:a}=t,l=t.virtual&&i.virtual.enabled,c=l?t.virtual.slides.length:t.slides.length,h=Yl(r,`.${t.params.slideClass}, swiper-slide`),u=l?t.virtual.slides.length:h.length;let d=[];const p=[],f=[];let m=i.slidesOffsetBefore;"function"==typeof m&&(m=i.slidesOffsetBefore.call(t));let g=i.slidesOffsetAfter;"function"==typeof g&&(g=i.slidesOffsetAfter.call(t));const _=t.snapGrid.length,y=t.slidesGrid.length;let v=i.spaceBetween,b=-m,x=0,w=0;if(void 0===s)return;"string"==typeof v&&v.indexOf("%")>=0?v=parseFloat(v.replace("%",""))/100*s:"string"==typeof v&&(v=parseFloat(v)),t.virtualSize=-v,h.forEach((t=>{o?t.style.marginLeft="":t.style.marginRight="",t.style.marginBottom="",t.style.marginTop=""})),i.centeredSlides&&i.cssMode&&(Wl(n,"--swiper-centered-offset-before",""),Wl(n,"--swiper-centered-offset-after",""));const E=i.grid&&i.grid.rows>1&&t.grid;let S;E?t.grid.initSlides(h):t.grid&&t.grid.unsetSlides();const T="auto"===i.slidesPerView&&i.breakpoints&&Object.keys(i.breakpoints).filter((t=>void 0!==i.breakpoints[t].slidesPerView)).length>0;for(let n=0;n<u;n+=1){let r;if(S=0,h[n]&&(r=h[n]),E&&t.grid.updateSlide(n,r,h),!h[n]||"none"!==Ql(r,"display")){if("auto"===i.slidesPerView){T&&(h[n].style[t.getDirectionLabel("width")]="");const s=getComputedStyle(r),o=r.style.transform,a=r.style.webkitTransform;if(o&&(r.style.transform="none"),a&&(r.style.webkitTransform="none"),i.roundLengths)S=t.isHorizontal()?ec(r,"width",!0):ec(r,"height",!0);else{const t=e(s,"width"),i=e(s,"padding-left"),n=e(s,"padding-right"),o=e(s,"margin-left"),a=e(s,"margin-right"),l=s.getPropertyValue("box-sizing");if(l&&"border-box"===l)S=t+o+a;else{const{clientWidth:e,offsetWidth:s}=r;S=t+i+n+o+a+(s-e)}}o&&(r.style.transform=o),a&&(r.style.webkitTransform=a),i.roundLengths&&(S=Math.floor(S))}else S=(s-(i.slidesPerView-1)*v)/i.slidesPerView,i.roundLengths&&(S=Math.floor(S)),h[n]&&(h[n].style[t.getDirectionLabel("width")]=`${S}px`);h[n]&&(h[n].swiperSlideSize=S),f.push(S),i.centeredSlides?(b=b+S/2+x/2+v,0===x&&0!==n&&(b=b-s/2-v),0===n&&(b=b-s/2-v),Math.abs(b)<.001&&(b=0),i.roundLengths&&(b=Math.floor(b)),w%i.slidesPerGroup==0&&d.push(b),p.push(b)):(i.roundLengths&&(b=Math.floor(b)),(w-Math.min(t.params.slidesPerGroupSkip,w))%t.params.slidesPerGroup==0&&d.push(b),p.push(b),b=b+S+v),t.virtualSize+=S+v,x=S,w+=1}}if(t.virtualSize=Math.max(t.virtualSize,s)+g,o&&a&&("slide"===i.effect||"coverflow"===i.effect)&&(n.style.width=`${t.virtualSize+v}px`),i.setWrapperSize&&(n.style[t.getDirectionLabel("width")]=`${t.virtualSize+v}px`),E&&t.grid.updateWrapperSize(S,d),!i.centeredSlides){const e=[];for(let n=0;n<d.length;n+=1){let r=d[n];i.roundLengths&&(r=Math.floor(r)),d[n]<=t.virtualSize-s&&e.push(r)}d=e,Math.floor(t.virtualSize-s)-Math.floor(d[d.length-1])>1&&d.push(t.virtualSize-s)}if(l&&i.loop){const e=f[0]+v;if(i.slidesPerGroup>1){const n=Math.ceil((t.virtual.slidesBefore+t.virtual.slidesAfter)/i.slidesPerGroup),r=e*i.slidesPerGroup;for(let t=0;t<n;t+=1)d.push(d[d.length-1]+r)}for(let n=0;n<t.virtual.slidesBefore+t.virtual.slidesAfter;n+=1)1===i.slidesPerGroup&&d.push(d[d.length-1]+e),p.push(p[p.length-1]+e),t.virtualSize+=e}if(0===d.length&&(d=[0]),0!==v){const e=t.isHorizontal()&&o?"marginLeft":t.getDirectionLabel("marginRight");h.filter(((t,e)=>!(i.cssMode&&!i.loop)||e!==h.length-1)).forEach((t=>{t.style[e]=`${v}px`}))}if(i.centeredSlides&&i.centeredSlidesBounds){let t=0;f.forEach((e=>{t+=e+(v||0)})),t-=v;const e=t-s;d=d.map((t=>t<=0?-m:t>e?e+g:t))}if(i.centerInsufficientSlides){let t=0;if(f.forEach((e=>{t+=e+(v||0)})),t-=v,t<s){const e=(s-t)/2;d.forEach(((t,i)=>{d[i]=t-e})),p.forEach(((t,i)=>{p[i]=t+e}))}}if(Object.assign(t,{slides:h,snapGrid:d,slidesGrid:p,slidesSizesGrid:f}),i.centeredSlides&&i.cssMode&&!i.centeredSlidesBounds){Wl(n,"--swiper-centered-offset-before",-d[0]+"px"),Wl(n,"--swiper-centered-offset-after",t.size/2-f[f.length-1]/2+"px");const e=-t.snapGrid[0],i=-t.slidesGrid[0];t.snapGrid=t.snapGrid.map((t=>t+e)),t.slidesGrid=t.slidesGrid.map((t=>t+i))}if(u!==c&&t.emit("slidesLengthChange"),d.length!==_&&(t.params.watchOverflow&&t.checkOverflow(),t.emit("snapGridLengthChange")),p.length!==y&&t.emit("slidesGridLengthChange"),i.watchSlidesProgress&&t.updateSlidesOffset(),t.emit("slidesUpdated"),!(l||i.cssMode||"slide"!==i.effect&&"fade"!==i.effect)){const e=`${i.containerModifierClass}backface-hidden`,n=t.el.classList.contains(e);u<=i.maxBackfaceHiddenSlides?n||t.el.classList.add(e):n&&t.el.classList.remove(e)}},updateAutoHeight:function(t){const e=this,i=[],n=e.virtual&&e.params.virtual.enabled;let r,s=0;"number"==typeof t?e.setTransition(t):!0===t&&e.setTransition(e.params.speed);const o=t=>n?e.slides[e.getSlideIndexByData(t)]:e.slides[t];if("auto"!==e.params.slidesPerView&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach((t=>{i.push(t)}));else for(r=0;r<Math.ceil(e.params.slidesPerView);r+=1){const t=e.activeIndex+r;if(t>e.slides.length&&!n)break;i.push(o(t))}else i.push(o(e.activeIndex));for(r=0;r<i.length;r+=1)if(void 0!==i[r]){const t=i[r].offsetHeight;s=t>s?t:s}(s||0===s)&&(e.wrapperEl.style.height=`${s}px`)},updateSlidesOffset:function(){const t=this,e=t.slides,i=t.isElement?t.isHorizontal()?t.wrapperEl.offsetLeft:t.wrapperEl.offsetTop:0;for(let n=0;n<e.length;n+=1)e[n].swiperSlideOffset=(t.isHorizontal()?e[n].offsetLeft:e[n].offsetTop)-i-t.cssOverflowAdjustment()},updateSlidesProgress:function(t){void 0===t&&(t=this&&this.translate||0);const e=this,i=e.params,{slides:n,rtlTranslate:r,snapGrid:s}=e;if(0===n.length)return;void 0===n[0].swiperSlideOffset&&e.updateSlidesOffset();let o=-t;r&&(o=t),n.forEach((t=>{t.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass)})),e.visibleSlidesIndexes=[],e.visibleSlides=[];let a=i.spaceBetween;"string"==typeof a&&a.indexOf("%")>=0?a=parseFloat(a.replace("%",""))/100*e.size:"string"==typeof a&&(a=parseFloat(a));for(let t=0;t<n.length;t+=1){const l=n[t];let c=l.swiperSlideOffset;i.cssMode&&i.centeredSlides&&(c-=n[0].swiperSlideOffset);const h=(o+(i.centeredSlides?e.minTranslate():0)-c)/(l.swiperSlideSize+a),u=(o-s[0]+(i.centeredSlides?e.minTranslate():0)-c)/(l.swiperSlideSize+a),d=-(o-c),p=d+e.slidesSizesGrid[t],f=d>=0&&d<=e.size-e.slidesSizesGrid[t];(d>=0&&d<e.size-1||p>1&&p<=e.size||d<=0&&p>=e.size)&&(e.visibleSlides.push(l),e.visibleSlidesIndexes.push(t),n[t].classList.add(i.slideVisibleClass)),f&&n[t].classList.add(i.slideFullyVisibleClass),l.progress=r?-h:h,l.originalProgress=r?-u:u}},updateProgress:function(t){const e=this;if(void 0===t){const i=e.rtlTranslate?-1:1;t=e&&e.translate&&e.translate*i||0}const i=e.params,n=e.maxTranslate()-e.minTranslate();let{progress:r,isBeginning:s,isEnd:o,progressLoop:a}=e;const l=s,c=o;if(0===n)r=0,s=!0,o=!0;else{r=(t-e.minTranslate())/n;const i=Math.abs(t-e.minTranslate())<1,a=Math.abs(t-e.maxTranslate())<1;s=i||r<=0,o=a||r>=1,i&&(r=0),a&&(r=1)}if(i.loop){const i=e.getSlideIndexByData(0),n=e.getSlideIndexByData(e.slides.length-1),r=e.slidesGrid[i],s=e.slidesGrid[n],o=e.slidesGrid[e.slidesGrid.length-1],l=Math.abs(t);a=l>=r?(l-r)/o:(l+o-s)/o,a>1&&(a-=1)}Object.assign(e,{progress:r,progressLoop:a,isBeginning:s,isEnd:o}),(i.watchSlidesProgress||i.centeredSlides&&i.autoHeight)&&e.updateSlidesProgress(t),s&&!l&&e.emit("reachBeginning toEdge"),o&&!c&&e.emit("reachEnd toEdge"),(l&&!s||c&&!o)&&e.emit("fromEdge"),e.emit("progress",r)},updateSlidesClasses:function(){const t=this,{slides:e,params:i,slidesEl:n,activeIndex:r}=t,s=t.virtual&&i.virtual.enabled,o=t.grid&&i.grid&&i.grid.rows>1,a=t=>Yl(n,`.${i.slideClass}${t}, swiper-slide${t}`)[0];let l,c,h;if(e.forEach((t=>{t.classList.remove(i.slideActiveClass,i.slideNextClass,i.slidePrevClass)})),s)if(i.loop){let e=r-t.virtual.slidesBefore;e<0&&(e=t.virtual.slides.length+e),e>=t.virtual.slides.length&&(e-=t.virtual.slides.length),l=a(`[data-swiper-slide-index="${e}"]`)}else l=a(`[data-swiper-slide-index="${r}"]`);else o?(l=e.filter((t=>t.column===r))[0],h=e.filter((t=>t.column===r+1))[0],c=e.filter((t=>t.column===r-1))[0]):l=e[r];l&&(l.classList.add(i.slideActiveClass),o?(h&&h.classList.add(i.slideNextClass),c&&c.classList.add(i.slidePrevClass)):(h=function(t,e){const i=[];for(;t.nextElementSibling;){const n=t.nextElementSibling;e?n.matches(e)&&i.push(n):i.push(n),t=n}return i}(l,`.${i.slideClass}, swiper-slide`)[0],i.loop&&!h&&(h=e[0]),h&&h.classList.add(i.slideNextClass),c=function(t,e){const i=[];for(;t.previousElementSibling;){const n=t.previousElementSibling;e?n.matches(e)&&i.push(n):i.push(n),t=n}return i}(l,`.${i.slideClass}, swiper-slide`)[0],i.loop&&0===!c&&(c=e[e.length-1]),c&&c.classList.add(i.slidePrevClass))),t.emitSlidesClasses()},updateActiveIndex:function(t){const e=this,i=e.rtlTranslate?e.translate:-e.translate,{snapGrid:n,params:r,activeIndex:s,realIndex:o,snapIndex:a}=e;let l,c=t;const h=t=>{let i=t-e.virtual.slidesBefore;return i<0&&(i=e.virtual.slides.length+i),i>=e.virtual.slides.length&&(i-=e.virtual.slides.length),i};if(void 0===c&&(c=function(t){const{slidesGrid:e,params:i}=t,n=t.rtlTranslate?t.translate:-t.translate;let r;for(let t=0;t<e.length;t+=1)void 0!==e[t+1]?n>=e[t]&&n<e[t+1]-(e[t+1]-e[t])/2?r=t:n>=e[t]&&n<e[t+1]&&(r=t+1):n>=e[t]&&(r=t);return i.normalizeSlideIndex&&(r<0||void 0===r)&&(r=0),r}(e)),n.indexOf(i)>=0)l=n.indexOf(i);else{const t=Math.min(r.slidesPerGroupSkip,c);l=t+Math.floor((c-t)/r.slidesPerGroup)}if(l>=n.length&&(l=n.length-1),c===s&&!e.params.loop)return void(l!==a&&(e.snapIndex=l,e.emit("snapIndexChange")));if(c===s&&e.params.loop&&e.virtual&&e.params.virtual.enabled)return void(e.realIndex=h(c));const u=e.grid&&r.grid&&r.grid.rows>1;let d;if(e.virtual&&r.virtual.enabled&&r.loop)d=h(c);else if(u){const t=e.slides.filter((t=>t.column===c))[0];let i=parseInt(t.getAttribute("data-swiper-slide-index"),10);Number.isNaN(i)&&(i=Math.max(e.slides.indexOf(t),0)),d=Math.floor(i/r.grid.rows)}else if(e.slides[c]){const t=e.slides[c].getAttribute("data-swiper-slide-index");d=t?parseInt(t,10):c}else d=c;Object.assign(e,{previousSnapIndex:a,snapIndex:l,previousRealIndex:o,realIndex:d,previousIndex:s,activeIndex:c}),e.initialized&&uc(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&(o!==d&&e.emit("realIndexChange"),e.emit("slideChange"))},updateClickedSlide:function(t,e){const i=this,n=i.params;let r=t.closest(`.${n.slideClass}, swiper-slide`);!r&&i.isElement&&e&&e.length>1&&e.includes(t)&&[...e.slice(e.indexOf(t)+1,e.length)].forEach((t=>{!r&&t.matches&&t.matches(`.${n.slideClass}, swiper-slide`)&&(r=t)}));let s,o=!1;if(r)for(let t=0;t<i.slides.length;t+=1)if(i.slides[t]===r){o=!0,s=t;break}if(!r||!o)return i.clickedSlide=void 0,void(i.clickedIndex=void 0);i.clickedSlide=r,i.virtual&&i.params.virtual.enabled?i.clickedIndex=parseInt(r.getAttribute("data-swiper-slide-index"),10):i.clickedIndex=s,n.slideToClickedSlide&&void 0!==i.clickedIndex&&i.clickedIndex!==i.activeIndex&&i.slideToClickedSlide()}};var pc={getTranslate:function(t){void 0===t&&(t=this.isHorizontal()?"x":"y");const{params:e,rtlTranslate:i,translate:n,wrapperEl:r}=this;if(e.virtualTranslate)return i?-n:n;if(e.cssMode)return n;let s=$l(r,t);return s+=this.cssOverflowAdjustment(),i&&(s=-s),s||0},setTranslate:function(t,e){const i=this,{rtlTranslate:n,params:r,wrapperEl:s,progress:o}=i;let a,l=0,c=0;i.isHorizontal()?l=n?-t:t:c=t,r.roundLengths&&(l=Math.floor(l),c=Math.floor(c)),i.previousTranslate=i.translate,i.translate=i.isHorizontal()?l:c,r.cssMode?s[i.isHorizontal()?"scrollLeft":"scrollTop"]=i.isHorizontal()?-l:-c:r.virtualTranslate||(i.isHorizontal()?l-=i.cssOverflowAdjustment():c-=i.cssOverflowAdjustment(),s.style.transform=`translate3d(${l}px, ${c}px, 0px)`);const h=i.maxTranslate()-i.minTranslate();a=0===h?0:(t-i.minTranslate())/h,a!==o&&i.updateProgress(t),i.emit("setTranslate",i.translate,e)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(t,e,i,n,r){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===i&&(i=!0),void 0===n&&(n=!0);const s=this,{params:o,wrapperEl:a}=s;if(s.animating&&o.preventInteractionOnTransition)return!1;const l=s.minTranslate(),c=s.maxTranslate();let h;if(h=n&&t>l?l:n&&t<c?c:t,s.updateProgress(h),o.cssMode){const t=s.isHorizontal();if(0===e)a[t?"scrollLeft":"scrollTop"]=-h;else{if(!s.support.smoothScroll)return Gl({swiper:s,targetPosition:-h,side:t?"left":"top"}),!0;a.scrollTo({[t?"left":"top"]:-h,behavior:"smooth"})}return!0}return 0===e?(s.setTransition(0),s.setTranslate(h),i&&(s.emit("beforeTransitionStart",e,r),s.emit("transitionEnd"))):(s.setTransition(e),s.setTranslate(h),i&&(s.emit("beforeTransitionStart",e,r),s.emit("transitionStart")),s.animating||(s.animating=!0,s.onTranslateToWrapperTransitionEnd||(s.onTranslateToWrapperTransitionEnd=function(t){s&&!s.destroyed&&t.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onTranslateToWrapperTransitionEnd),s.onTranslateToWrapperTransitionEnd=null,delete s.onTranslateToWrapperTransitionEnd,i&&s.emit("transitionEnd"))}),s.wrapperEl.addEventListener("transitionend",s.onTranslateToWrapperTransitionEnd))),!0}};function fc(t){let{swiper:e,runCallbacks:i,direction:n,step:r}=t;const{activeIndex:s,previousIndex:o}=e;let a=n;if(a||(a=s>o?"next":s<o?"prev":"reset"),e.emit(`transition${r}`),i&&s!==o){if("reset"===a)return void e.emit(`slideResetTransition${r}`);e.emit(`slideChangeTransition${r}`),"next"===a?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`)}}var mc={setTransition:function(t,e){const i=this;i.params.cssMode||(i.wrapperEl.style.transitionDuration=`${t}ms`,i.wrapperEl.style.transitionDelay=0===t?"0ms":""),i.emit("setTransition",t,e)},transitionStart:function(t,e){void 0===t&&(t=!0);const i=this,{params:n}=i;n.cssMode||(n.autoHeight&&i.updateAutoHeight(),fc({swiper:i,runCallbacks:t,direction:e,step:"Start"}))},transitionEnd:function(t,e){void 0===t&&(t=!0);const i=this,{params:n}=i;i.animating=!1,n.cssMode||(i.setTransition(0),fc({swiper:i,runCallbacks:t,direction:e,step:"End"}))}};var gc={slideTo:function(t,e,i,n,r){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===i&&(i=!0),"string"==typeof t&&(t=parseInt(t,10));const s=this;let o=t;o<0&&(o=0);const{params:a,snapGrid:l,slidesGrid:c,previousIndex:h,activeIndex:u,rtlTranslate:d,wrapperEl:p,enabled:f}=s;if(s.animating&&a.preventInteractionOnTransition||!f&&!n&&!r)return!1;const m=Math.min(s.params.slidesPerGroupSkip,o);let g=m+Math.floor((o-m)/s.params.slidesPerGroup);g>=l.length&&(g=l.length-1);const _=-l[g];if(a.normalizeSlideIndex)for(let t=0;t<c.length;t+=1){const e=-Math.floor(100*_),i=Math.floor(100*c[t]),n=Math.floor(100*c[t+1]);void 0!==c[t+1]?e>=i&&e<n-(n-i)/2?o=t:e>=i&&e<n&&(o=t+1):e>=i&&(o=t)}if(s.initialized&&o!==u){if(!s.allowSlideNext&&(d?_>s.translate&&_>s.minTranslate():_<s.translate&&_<s.minTranslate()))return!1;if(!s.allowSlidePrev&&_>s.translate&&_>s.maxTranslate()&&(u||0)!==o)return!1}let y;if(o!==(h||0)&&i&&s.emit("beforeSlideChangeStart"),s.updateProgress(_),y=o>u?"next":o<u?"prev":"reset",d&&-_===s.translate||!d&&_===s.translate)return s.updateActiveIndex(o),a.autoHeight&&s.updateAutoHeight(),s.updateSlidesClasses(),"slide"!==a.effect&&s.setTranslate(_),"reset"!==y&&(s.transitionStart(i,y),s.transitionEnd(i,y)),!1;if(a.cssMode){const t=s.isHorizontal(),i=d?_:-_;if(0===e){const e=s.virtual&&s.params.virtual.enabled;e&&(s.wrapperEl.style.scrollSnapType="none",s._immediateVirtual=!0),e&&!s._cssModeVirtualInitialSet&&s.params.initialSlide>0?(s._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{p[t?"scrollLeft":"scrollTop"]=i}))):p[t?"scrollLeft":"scrollTop"]=i,e&&requestAnimationFrame((()=>{s.wrapperEl.style.scrollSnapType="",s._immediateVirtual=!1}))}else{if(!s.support.smoothScroll)return Gl({swiper:s,targetPosition:i,side:t?"left":"top"}),!0;p.scrollTo({[t?"left":"top"]:i,behavior:"smooth"})}return!0}return s.setTransition(e),s.setTranslate(_),s.updateActiveIndex(o),s.updateSlidesClasses(),s.emit("beforeTransitionStart",e,n),s.transitionStart(i,y),0===e?s.transitionEnd(i,y):s.animating||(s.animating=!0,s.onSlideToWrapperTransitionEnd||(s.onSlideToWrapperTransitionEnd=function(t){s&&!s.destroyed&&t.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.onSlideToWrapperTransitionEnd=null,delete s.onSlideToWrapperTransitionEnd,s.transitionEnd(i,y))}),s.wrapperEl.addEventListener("transitionend",s.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(t,e,i,n){if(void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===i&&(i=!0),"string"==typeof t){t=parseInt(t,10)}const r=this,s=r.grid&&r.params.grid&&r.params.grid.rows>1;let o=t;if(r.params.loop)if(r.virtual&&r.params.virtual.enabled)o+=r.virtual.slidesBefore;else{let t;if(s){const e=o*r.params.grid.rows;t=r.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0].column}else t=r.getSlideIndexByData(o);const e=s?Math.ceil(r.slides.length/r.params.grid.rows):r.slides.length,{centeredSlides:i}=r.params;let n=r.params.slidesPerView;"auto"===n?n=r.slidesPerViewDynamic():(n=Math.ceil(parseFloat(r.params.slidesPerView,10)),i&&n%2==0&&(n+=1));let a=e-t<n;if(i&&(a=a||t<Math.ceil(n/2)),a){const n=i?t<r.activeIndex?"prev":"next":t-r.activeIndex-1<r.params.slidesPerView?"next":"prev";r.loopFix({direction:n,slideTo:!0,activeSlideIndex:"next"===n?t+1:t-e+1,slideRealIndex:"next"===n?r.realIndex:void 0})}if(s){const t=o*r.params.grid.rows;o=r.slides.filter((e=>1*e.getAttribute("data-swiper-slide-index")===t))[0].column}else o=r.getSlideIndexByData(o)}return requestAnimationFrame((()=>{r.slideTo(o,e,i,n)})),r},slideNext:function(t,e,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0);const n=this,{enabled:r,params:s,animating:o}=n;if(!r)return n;let a=s.slidesPerGroup;"auto"===s.slidesPerView&&1===s.slidesPerGroup&&s.slidesPerGroupAuto&&(a=Math.max(n.slidesPerViewDynamic("current",!0),1));const l=n.activeIndex<s.slidesPerGroupSkip?1:a,c=n.virtual&&s.virtual.enabled;if(s.loop){if(o&&!c&&s.loopPreventsSliding)return!1;if(n.loopFix({direction:"next"}),n._clientLeft=n.wrapperEl.clientLeft,n.activeIndex===n.slides.length-1&&s.cssMode)return requestAnimationFrame((()=>{n.slideTo(n.activeIndex+l,t,e,i)})),!0}return s.rewind&&n.isEnd?n.slideTo(0,t,e,i):n.slideTo(n.activeIndex+l,t,e,i)},slidePrev:function(t,e,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0);const n=this,{params:r,snapGrid:s,slidesGrid:o,rtlTranslate:a,enabled:l,animating:c}=n;if(!l)return n;const h=n.virtual&&r.virtual.enabled;if(r.loop){if(c&&!h&&r.loopPreventsSliding)return!1;n.loopFix({direction:"prev"}),n._clientLeft=n.wrapperEl.clientLeft}function u(t){return t<0?-Math.floor(Math.abs(t)):Math.floor(t)}const d=u(a?n.translate:-n.translate),p=s.map((t=>u(t)));let f=s[p.indexOf(d)-1];if(void 0===f&&r.cssMode){let t;s.forEach(((e,i)=>{d>=e&&(t=i)})),void 0!==t&&(f=s[t>0?t-1:t])}let m=0;if(void 0!==f&&(m=o.indexOf(f),m<0&&(m=n.activeIndex-1),"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(m=m-n.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),r.rewind&&n.isBeginning){const r=n.params.virtual&&n.params.virtual.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(r,t,e,i)}return r.loop&&0===n.activeIndex&&r.cssMode?(requestAnimationFrame((()=>{n.slideTo(m,t,e,i)})),!0):n.slideTo(m,t,e,i)},slideReset:function(t,e,i){return void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),this.slideTo(this.activeIndex,t,e,i)},slideToClosest:function(t,e,i,n){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),void 0===n&&(n=.5);const r=this;let s=r.activeIndex;const o=Math.min(r.params.slidesPerGroupSkip,s),a=o+Math.floor((s-o)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[a]){const t=r.snapGrid[a];l-t>(r.snapGrid[a+1]-t)*n&&(s+=r.params.slidesPerGroup)}else{const t=r.snapGrid[a-1];l-t<=(r.snapGrid[a]-t)*n&&(s-=r.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,r.slidesGrid.length-1),r.slideTo(s,t,e,i)},slideToClickedSlide:function(){const t=this,{params:e,slidesEl:i}=t,n="auto"===e.slidesPerView?t.slidesPerViewDynamic():e.slidesPerView;let r,s=t.clickedIndex;const o=t.isElement?"swiper-slide":`.${e.slideClass}`;if(e.loop){if(t.animating)return;r=parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?s<t.loopedSlides-n/2||s>t.slides.length-t.loopedSlides+n/2?(t.loopFix(),s=t.getSlideIndex(Yl(i,`${o}[data-swiper-slide-index="${r}"]`)[0]),Vl((()=>{t.slideTo(s)}))):t.slideTo(s):s>t.slides.length-n?(t.loopFix(),s=t.getSlideIndex(Yl(i,`${o}[data-swiper-slide-index="${r}"]`)[0]),Vl((()=>{t.slideTo(s)}))):t.slideTo(s)}else t.slideTo(s)}};var _c={loopCreate:function(t){const e=this,{params:i,slidesEl:n}=e;if(!i.loop||e.virtual&&e.params.virtual.enabled)return;const r=()=>{Yl(n,`.${i.slideClass}, swiper-slide`).forEach(((t,e)=>{t.setAttribute("data-swiper-slide-index",e)}))},s=e.grid&&i.grid&&i.grid.rows>1,o=i.slidesPerGroup*(s?i.grid.rows:1),a=e.slides.length%o!=0,l=s&&e.slides.length%i.grid.rows!=0,c=t=>{for(let n=0;n<t;n+=1){const t=e.isElement?Kl("swiper-slide",[i.slideBlankClass]):Kl("div",[i.slideClass,i.slideBlankClass]);e.slidesEl.append(t)}};if(a){if(i.loopAddBlankSlides){c(o-e.slides.length%o),e.recalcSlides(),e.updateSlides()}else Xl("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");r()}else if(l){if(i.loopAddBlankSlides){c(i.grid.rows-e.slides.length%i.grid.rows),e.recalcSlides(),e.updateSlides()}else Xl("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");r()}else r();e.loopFix({slideRealIndex:t,direction:i.centeredSlides?void 0:"next"})},loopFix:function(t){let{slideRealIndex:e,slideTo:i=!0,direction:n,setTranslate:r,activeSlideIndex:s,byController:o,byMousewheel:a}=void 0===t?{}:t;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:c,allowSlidePrev:h,allowSlideNext:u,slidesEl:d,params:p}=l,{centeredSlides:f}=p;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&p.virtual.enabled)return i&&(p.centeredSlides||0!==l.snapIndex?p.centeredSlides&&l.snapIndex<p.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0):l.slideTo(l.virtual.slides.length,0,!1,!0)),l.allowSlidePrev=h,l.allowSlideNext=u,void l.emit("loopFix");let m=p.slidesPerView;"auto"===m?m=l.slidesPerViewDynamic():(m=Math.ceil(parseFloat(p.slidesPerView,10)),f&&m%2==0&&(m+=1));const g=p.slidesPerGroupAuto?m:p.slidesPerGroup;let _=g;_%g!=0&&(_+=g-_%g),_+=p.loopAdditionalSlides,l.loopedSlides=_;const y=l.grid&&p.grid&&p.grid.rows>1;c.length<m+_?Xl("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):y&&"row"===p.grid.fill&&Xl("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const v=[],b=[];let x=l.activeIndex;void 0===s?s=l.getSlideIndex(c.filter((t=>t.classList.contains(p.slideActiveClass)))[0]):x=s;const w="next"===n||!n,E="prev"===n||!n;let S=0,T=0;const M=y?Math.ceil(c.length/p.grid.rows):c.length,A=(y?c[s].column:s)+(f&&void 0===r?-m/2+.5:0);if(A<_){S=Math.max(_-A,g);for(let t=0;t<_-A;t+=1){const e=t-Math.floor(t/M)*M;if(y){const t=M-e-1;for(let e=c.length-1;e>=0;e-=1)c[e].column===t&&v.push(e)}else v.push(M-e-1)}}else if(A+m>M-_){T=Math.max(A-(M-2*_),g);for(let t=0;t<T;t+=1){const e=t-Math.floor(t/M)*M;y?c.forEach(((t,i)=>{t.column===e&&b.push(i)})):b.push(e)}}if(l.__preventObserver__=!0,requestAnimationFrame((()=>{l.__preventObserver__=!1})),E&&v.forEach((t=>{c[t].swiperLoopMoveDOM=!0,d.prepend(c[t]),c[t].swiperLoopMoveDOM=!1})),w&&b.forEach((t=>{c[t].swiperLoopMoveDOM=!0,d.append(c[t]),c[t].swiperLoopMoveDOM=!1})),l.recalcSlides(),"auto"===p.slidesPerView?l.updateSlides():y&&(v.length>0&&E||b.length>0&&w)&&l.slides.forEach(((t,e)=>{l.grid.updateSlide(e,t,l.slides)})),p.watchSlidesProgress&&l.updateSlidesOffset(),i)if(v.length>0&&E){if(void 0===e){const t=l.slidesGrid[x],e=l.slidesGrid[x+S]-t;a?l.setTranslate(l.translate-e):(l.slideTo(x+S,0,!1,!0),r&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-e,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-e))}else if(r){const t=y?v.length/p.grid.rows:v.length;l.slideTo(l.activeIndex+t,0,!1,!0),l.touchEventsData.currentTranslate=l.translate}}else if(b.length>0&&w)if(void 0===e){const t=l.slidesGrid[x],e=l.slidesGrid[x-T]-t;a?l.setTranslate(l.translate-e):(l.slideTo(x-T,0,!1,!0),r&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-e,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-e))}else{const t=y?b.length/p.grid.rows:b.length;l.slideTo(l.activeIndex-t,0,!1,!0)}if(l.allowSlidePrev=h,l.allowSlideNext=u,l.controller&&l.controller.control&&!o){const t={slideRealIndex:e,direction:n,setTranslate:r,activeSlideIndex:s,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach((e=>{!e.destroyed&&e.params.loop&&e.loopFix({...t,slideTo:e.params.slidesPerView===p.slidesPerView&&i})})):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...t,slideTo:l.controller.control.params.slidesPerView===p.slidesPerView&&i})}l.emit("loopFix")},loopDestroy:function(){const t=this,{params:e,slidesEl:i}=t;if(!e.loop||t.virtual&&t.params.virtual.enabled)return;t.recalcSlides();const n=[];t.slides.forEach((t=>{const e=void 0===t.swiperSlideIndex?1*t.getAttribute("data-swiper-slide-index"):t.swiperSlideIndex;n[e]=t})),t.slides.forEach((t=>{t.removeAttribute("data-swiper-slide-index")})),n.forEach((t=>{i.append(t)})),t.recalcSlides(),t.slideTo(t.realIndex,0)}};var yc={setGrabCursor:function(t){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const i="container"===e.params.touchEventsTarget?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),i.style.cursor="move",i.style.cursor=t?"grabbing":"grab",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1}))},unsetGrabCursor:function(){const t=this;t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.isElement&&(t.__preventObserver__=!0),t["container"===t.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1})))}};function vc(t,e,i){const n=jl(),{params:r}=t,s=r.edgeSwipeDetection,o=r.edgeSwipeThreshold;return!s||!(i<=o||i>=n.innerWidth-o)||"prevent"===s&&(e.preventDefault(),!0)}function bc(t){const e=this,i=Bl();let n=t;n.originalEvent&&(n=n.originalEvent);const r=e.touchEventsData;if("pointerdown"===n.type){if(null!==r.pointerId&&r.pointerId!==n.pointerId)return;r.pointerId=n.pointerId}else"touchstart"===n.type&&1===n.targetTouches.length&&(r.touchId=n.targetTouches[0].identifier);if("touchstart"===n.type)return void vc(e,n,n.targetTouches[0].pageX);const{params:s,touches:o,enabled:a}=e;if(!a)return;if(!s.simulateTouch&&"mouse"===n.pointerType)return;if(e.animating&&s.preventInteractionOnTransition)return;!e.animating&&s.cssMode&&s.loop&&e.loopFix();let l=n.target;if("wrapper"===s.touchEventsTarget&&!e.wrapperEl.contains(l))return;if("which"in n&&3===n.which)return;if("button"in n&&n.button>0)return;if(r.isTouched&&r.isMoved)return;const c=!!s.noSwipingClass&&""!==s.noSwipingClass,h=n.composedPath?n.composedPath():n.path;c&&n.target&&n.target.shadowRoot&&h&&(l=h[0]);const u=s.noSwipingSelector?s.noSwipingSelector:`.${s.noSwipingClass}`,d=!(!n.target||!n.target.shadowRoot);if(s.noSwiping&&(d?function(t,e){return void 0===e&&(e=this),function e(i){if(!i||i===Bl()||i===jl())return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||i.getRootNode?n||e(i.getRootNode().host):null}(e)}(u,l):l.closest(u)))return void(e.allowClick=!0);if(s.swipeHandler&&!l.closest(s.swipeHandler))return;o.currentX=n.pageX,o.currentY=n.pageY;const p=o.currentX,f=o.currentY;if(!vc(e,n,p))return;Object.assign(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=p,o.startY=f,r.touchStartTime=Ul(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(r.allowThresholdMove=!1);let m=!0;l.matches(r.focusableElements)&&(m=!1,"SELECT"===l.nodeName&&(r.isTouched=!1)),i.activeElement&&i.activeElement.matches(r.focusableElements)&&i.activeElement!==l&&i.activeElement.blur();const g=m&&e.allowTouchMove&&s.touchStartPreventDefault;!s.touchStartForcePreventDefault&&!g||l.isContentEditable||n.preventDefault(),s.freeMode&&s.freeMode.enabled&&e.freeMode&&e.animating&&!s.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",n)}function xc(t){const e=Bl(),i=this,n=i.touchEventsData,{params:r,touches:s,rtlTranslate:o,enabled:a}=i;if(!a)return;if(!r.simulateTouch&&"mouse"===t.pointerType)return;let l,c=t;if(c.originalEvent&&(c=c.originalEvent),"pointermove"===c.type){if(null!==n.touchId)return;if(c.pointerId!==n.pointerId)return}if("touchmove"===c.type){if(l=[...c.changedTouches].filter((t=>t.identifier===n.touchId))[0],!l||l.identifier!==n.touchId)return}else l=c;if(!n.isTouched)return void(n.startMoving&&n.isScrolling&&i.emit("touchMoveOpposite",c));const h=l.pageX,u=l.pageY;if(c.preventedByNestedSwiper)return s.startX=h,void(s.startY=u);if(!i.allowTouchMove)return c.target.matches(n.focusableElements)||(i.allowClick=!1),void(n.isTouched&&(Object.assign(s,{startX:h,startY:u,currentX:h,currentY:u}),n.touchStartTime=Ul()));if(r.touchReleaseOnEdges&&!r.loop)if(i.isVertical()){if(u<s.startY&&i.translate<=i.maxTranslate()||u>s.startY&&i.translate>=i.minTranslate())return n.isTouched=!1,void(n.isMoved=!1)}else if(h<s.startX&&i.translate<=i.maxTranslate()||h>s.startX&&i.translate>=i.minTranslate())return;if(e.activeElement&&c.target===e.activeElement&&c.target.matches(n.focusableElements))return n.isMoved=!0,void(i.allowClick=!1);n.allowTouchCallbacks&&i.emit("touchMove",c),s.previousX=s.currentX,s.previousY=s.currentY,s.currentX=h,s.currentY=u;const d=s.currentX-s.startX,p=s.currentY-s.startY;if(i.params.threshold&&Math.sqrt(d**2+p**2)<i.params.threshold)return;if(void 0===n.isScrolling){let t;i.isHorizontal()&&s.currentY===s.startY||i.isVertical()&&s.currentX===s.startX?n.isScrolling=!1:d*d+p*p>=25&&(t=180*Math.atan2(Math.abs(p),Math.abs(d))/Math.PI,n.isScrolling=i.isHorizontal()?t>r.touchAngle:90-t>r.touchAngle)}if(n.isScrolling&&i.emit("touchMoveOpposite",c),void 0===n.startMoving&&(s.currentX===s.startX&&s.currentY===s.startY||(n.startMoving=!0)),n.isScrolling)return void(n.isTouched=!1);if(!n.startMoving)return;i.allowClick=!1,!r.cssMode&&c.cancelable&&c.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&c.stopPropagation();let f=i.isHorizontal()?d:p,m=i.isHorizontal()?s.currentX-s.previousX:s.currentY-s.previousY;r.oneWayMovement&&(f=Math.abs(f)*(o?1:-1),m=Math.abs(m)*(o?1:-1)),s.diff=f,f*=r.touchRatio,o&&(f=-f,m=-m);const g=i.touchesDirection;i.swipeDirection=f>0?"prev":"next",i.touchesDirection=m>0?"prev":"next";const _=i.params.loop&&!r.cssMode,y="next"===i.touchesDirection&&i.allowSlideNext||"prev"===i.touchesDirection&&i.allowSlidePrev;if(!n.isMoved){if(_&&y&&i.loopFix({direction:i.swipeDirection}),n.startTranslate=i.getTranslate(),i.setTransition(0),i.animating){const t=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});i.wrapperEl.dispatchEvent(t)}n.allowMomentumBounce=!1,!r.grabCursor||!0!==i.allowSlideNext&&!0!==i.allowSlidePrev||i.setGrabCursor(!0),i.emit("sliderFirstMove",c)}if((new Date).getTime(),n.isMoved&&n.allowThresholdMove&&g!==i.touchesDirection&&_&&y&&Math.abs(f)>=1)return Object.assign(s,{startX:h,startY:u,currentX:h,currentY:u,startTranslate:n.currentTranslate}),n.loopSwapReset=!0,void(n.startTranslate=n.currentTranslate);i.emit("sliderMove",c),n.isMoved=!0,n.currentTranslate=f+n.startTranslate;let v=!0,b=r.resistanceRatio;if(r.touchReleaseOnEdges&&(b=0),f>0?(_&&y&&n.allowThresholdMove&&n.currentTranslate>(r.centeredSlides?i.minTranslate()-i.slidesSizesGrid[i.activeIndex+1]:i.minTranslate())&&i.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),n.currentTranslate>i.minTranslate()&&(v=!1,r.resistance&&(n.currentTranslate=i.minTranslate()-1+(-i.minTranslate()+n.startTranslate+f)**b))):f<0&&(_&&y&&n.allowThresholdMove&&n.currentTranslate<(r.centeredSlides?i.maxTranslate()+i.slidesSizesGrid[i.slidesSizesGrid.length-1]:i.maxTranslate())&&i.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:i.slides.length-("auto"===r.slidesPerView?i.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),n.currentTranslate<i.maxTranslate()&&(v=!1,r.resistance&&(n.currentTranslate=i.maxTranslate()+1-(i.maxTranslate()-n.startTranslate-f)**b))),v&&(c.preventedByNestedSwiper=!0),!i.allowSlideNext&&"next"===i.swipeDirection&&n.currentTranslate<n.startTranslate&&(n.currentTranslate=n.startTranslate),!i.allowSlidePrev&&"prev"===i.swipeDirection&&n.currentTranslate>n.startTranslate&&(n.currentTranslate=n.startTranslate),i.allowSlidePrev||i.allowSlideNext||(n.currentTranslate=n.startTranslate),r.threshold>0){if(!(Math.abs(f)>r.threshold||n.allowThresholdMove))return void(n.currentTranslate=n.startTranslate);if(!n.allowThresholdMove)return n.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,n.currentTranslate=n.startTranslate,void(s.diff=i.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&i.freeMode||r.watchSlidesProgress)&&(i.updateActiveIndex(),i.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&i.freeMode&&i.freeMode.onTouchMove(),i.updateProgress(n.currentTranslate),i.setTranslate(n.currentTranslate))}function wc(t){const e=this,i=e.touchEventsData;let n,r=t;r.originalEvent&&(r=r.originalEvent);if("touchend"===r.type||"touchcancel"===r.type){if(n=[...r.changedTouches].filter((t=>t.identifier===i.touchId))[0],!n||n.identifier!==i.touchId)return}else{if(null!==i.touchId)return;if(r.pointerId!==i.pointerId)return;n=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)){if(!(["pointercancel","contextmenu"].includes(r.type)&&(e.browser.isSafari||e.browser.isWebView)))return}i.pointerId=null,i.touchId=null;const{params:s,touches:o,rtlTranslate:a,slidesGrid:l,enabled:c}=e;if(!c)return;if(!s.simulateTouch&&"mouse"===r.pointerType)return;if(i.allowTouchCallbacks&&e.emit("touchEnd",r),i.allowTouchCallbacks=!1,!i.isTouched)return i.isMoved&&s.grabCursor&&e.setGrabCursor(!1),i.isMoved=!1,void(i.startMoving=!1);s.grabCursor&&i.isMoved&&i.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);const h=Ul(),u=h-i.touchStartTime;if(e.allowClick){const t=r.path||r.composedPath&&r.composedPath();e.updateClickedSlide(t&&t[0]||r.target,t),e.emit("tap click",r),u<300&&h-i.lastClickTime<300&&e.emit("doubleTap doubleClick",r)}if(i.lastClickTime=Ul(),Vl((()=>{e.destroyed||(e.allowClick=!0)})),!i.isTouched||!i.isMoved||!e.swipeDirection||0===o.diff&&!i.loopSwapReset||i.currentTranslate===i.startTranslate&&!i.loopSwapReset)return i.isTouched=!1,i.isMoved=!1,void(i.startMoving=!1);let d;if(i.isTouched=!1,i.isMoved=!1,i.startMoving=!1,d=s.followFinger?a?e.translate:-e.translate:-i.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled)return void e.freeMode.onTouchEnd({currentPos:d});const p=d>=-e.maxTranslate()&&!e.params.loop;let f=0,m=e.slidesSizesGrid[0];for(let t=0;t<l.length;t+=t<s.slidesPerGroupSkip?1:s.slidesPerGroup){const e=t<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;void 0!==l[t+e]?(p||d>=l[t]&&d<l[t+e])&&(f=t,m=l[t+e]-l[t]):(p||d>=l[t])&&(f=t,m=l[l.length-1]-l[l.length-2])}let g=null,_=null;s.rewind&&(e.isBeginning?_=s.virtual&&s.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(g=0));const y=(d-l[f])/m,v=f<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;if(u>s.longSwipesMs){if(!s.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&(y>=s.longSwipesRatio?e.slideTo(s.rewind&&e.isEnd?g:f+v):e.slideTo(f)),"prev"===e.swipeDirection&&(y>1-s.longSwipesRatio?e.slideTo(f+v):null!==_&&y<0&&Math.abs(y)>s.longSwipesRatio?e.slideTo(_):e.slideTo(f))}else{if(!s.shortSwipes)return void e.slideTo(e.activeIndex);e.navigation&&(r.target===e.navigation.nextEl||r.target===e.navigation.prevEl)?r.target===e.navigation.nextEl?e.slideTo(f+v):e.slideTo(f):("next"===e.swipeDirection&&e.slideTo(null!==g?g:f+v),"prev"===e.swipeDirection&&e.slideTo(null!==_?_:f))}}function Ec(){const t=this,{params:e,el:i}=t;if(i&&0===i.offsetWidth)return;e.breakpoints&&t.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:r,snapGrid:s}=t,o=t.virtual&&t.params.virtual.enabled;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses();const a=o&&e.loop;!("auto"===e.slidesPerView||e.slidesPerView>1)||!t.isEnd||t.isBeginning||t.params.centeredSlides||a?t.params.loop&&!o?t.slideToLoop(t.realIndex,0,!1,!0):t.slideTo(t.activeIndex,0,!1,!0):t.slideTo(t.slides.length-1,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&(clearTimeout(t.autoplay.resizeTimeout),t.autoplay.resizeTimeout=setTimeout((()=>{t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.resume()}),500)),t.allowSlidePrev=r,t.allowSlideNext=n,t.params.watchOverflow&&s!==t.snapGrid&&t.checkOverflow()}function Sc(t){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation())))}function Tc(){const t=this,{wrapperEl:e,rtlTranslate:i,enabled:n}=t;if(!n)return;let r;t.previousTranslate=t.translate,t.isHorizontal()?t.translate=-e.scrollLeft:t.translate=-e.scrollTop,0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();const s=t.maxTranslate()-t.minTranslate();r=0===s?0:(t.translate-t.minTranslate())/s,r!==t.progress&&t.updateProgress(i?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}function Mc(t){const e=this;cc(e,t.target),e.params.cssMode||"auto"!==e.params.slidesPerView&&!e.params.autoHeight||e.update()}function Ac(){const t=this;t.documentTouchHandlerProceeded||(t.documentTouchHandlerProceeded=!0,t.params.touchReleaseOnEdges&&(t.el.style.touchAction="auto"))}const Cc=(t,e)=>{const i=Bl(),{params:n,el:r,wrapperEl:s,device:o}=t,a=!!n.nested,l="on"===e?"addEventListener":"removeEventListener",c=e;i[l]("touchstart",t.onDocumentTouchStart,{passive:!1,capture:a}),r[l]("touchstart",t.onTouchStart,{passive:!1}),r[l]("pointerdown",t.onTouchStart,{passive:!1}),i[l]("touchmove",t.onTouchMove,{passive:!1,capture:a}),i[l]("pointermove",t.onTouchMove,{passive:!1,capture:a}),i[l]("touchend",t.onTouchEnd,{passive:!0}),i[l]("pointerup",t.onTouchEnd,{passive:!0}),i[l]("pointercancel",t.onTouchEnd,{passive:!0}),i[l]("touchcancel",t.onTouchEnd,{passive:!0}),i[l]("pointerout",t.onTouchEnd,{passive:!0}),i[l]("pointerleave",t.onTouchEnd,{passive:!0}),i[l]("contextmenu",t.onTouchEnd,{passive:!0}),(n.preventClicks||n.preventClicksPropagation)&&r[l]("click",t.onClick,!0),n.cssMode&&s[l]("scroll",t.onScroll),n.updateOnWindowResize?t[c](o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate",Ec,!0):t[c]("observerUpdate",Ec,!0),r[l]("load",t.onLoad,{capture:!0})};var kc={attachEvents:function(){const t=this,{params:e}=t;t.onTouchStart=bc.bind(t),t.onTouchMove=xc.bind(t),t.onTouchEnd=wc.bind(t),t.onDocumentTouchStart=Ac.bind(t),e.cssMode&&(t.onScroll=Tc.bind(t)),t.onClick=Sc.bind(t),t.onLoad=Mc.bind(t),Cc(t,"on")},detachEvents:function(){Cc(this,"off")}};const Pc=(t,e)=>t.grid&&e.grid&&e.grid.rows>1;var Ic={setBreakpoint:function(){const t=this,{realIndex:e,initialized:i,params:n,el:r}=t,s=n.breakpoints;if(!s||s&&0===Object.keys(s).length)return;const o=t.getBreakpoint(s,t.params.breakpointsBase,t.el);if(!o||t.currentBreakpoint===o)return;const a=(o in s?s[o]:void 0)||t.originalParams,l=Pc(t,n),c=Pc(t,a),h=n.enabled;l&&!c?(r.classList.remove(`${n.containerModifierClass}grid`,`${n.containerModifierClass}grid-column`),t.emitContainerClasses()):!l&&c&&(r.classList.add(`${n.containerModifierClass}grid`),(a.grid.fill&&"column"===a.grid.fill||!a.grid.fill&&"column"===n.grid.fill)&&r.classList.add(`${n.containerModifierClass}grid-column`),t.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach((e=>{if(void 0===a[e])return;const i=n[e]&&n[e].enabled,r=a[e]&&a[e].enabled;i&&!r&&t[e].disable(),!i&&r&&t[e].enable()}));const u=a.direction&&a.direction!==n.direction,d=n.loop&&(a.slidesPerView!==n.slidesPerView||u),p=n.loop;u&&i&&t.changeDirection(),ql(t.params,a);const f=t.params.enabled,m=t.params.loop;Object.assign(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),h&&!f?t.disable():!h&&f&&t.enable(),t.currentBreakpoint=o,t.emit("_beforeBreakpoint",a),i&&(d?(t.loopDestroy(),t.loopCreate(e),t.updateSlides()):!p&&m?(t.loopCreate(e),t.updateSlides()):p&&!m&&t.loopDestroy()),t.emit("breakpoint",a)},getBreakpoint:function(t,e,i){if(void 0===e&&(e="window"),!t||"container"===e&&!i)return;let n=!1;const r=jl(),s="window"===e?r.innerHeight:i.clientHeight,o=Object.keys(t).map((t=>{if("string"==typeof t&&0===t.indexOf("@")){const e=parseFloat(t.substr(1));return{value:s*e,point:t}}return{value:t,point:t}}));o.sort(((t,e)=>parseInt(t.value,10)-parseInt(e.value,10)));for(let t=0;t<o.length;t+=1){const{point:s,value:a}=o[t];"window"===e?r.matchMedia(`(min-width: ${a}px)`).matches&&(n=s):a<=i.clientWidth&&(n=s)}return n||"max"}};var Dc={addClasses:function(){const t=this,{classNames:e,params:i,rtl:n,el:r,device:s}=t,o=function(t,e){const i=[];return t.forEach((t=>{"object"==typeof t?Object.keys(t).forEach((n=>{t[n]&&i.push(e+n)})):"string"==typeof t&&i.push(e+t)})),i}(["initialized",i.direction,{"free-mode":t.params.freeMode&&i.freeMode.enabled},{autoheight:i.autoHeight},{rtl:n},{grid:i.grid&&i.grid.rows>1},{"grid-column":i.grid&&i.grid.rows>1&&"column"===i.grid.fill},{android:s.android},{ios:s.ios},{"css-mode":i.cssMode},{centered:i.cssMode&&i.centeredSlides},{"watch-progress":i.watchSlidesProgress}],i.containerModifierClass);e.push(...o),r.classList.add(...e),t.emitContainerClasses()},removeClasses:function(){const{el:t,classNames:e}=this;t.classList.remove(...e),this.emitContainerClasses()}};var Oc={checkOverflow:function(){const t=this,{isLocked:e,params:i}=t,{slidesOffsetBefore:n}=i;if(n){const e=t.slides.length-1,i=t.slidesGrid[e]+t.slidesSizesGrid[e]+2*n;t.isLocked=t.size>i}else t.isLocked=1===t.snapGrid.length;!0===i.allowSlideNext&&(t.allowSlideNext=!t.isLocked),!0===i.allowSlidePrev&&(t.allowSlidePrev=!t.isLocked),e&&e!==t.isLocked&&(t.isEnd=!1),e!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock")}},Lc={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function zc(t,e){return function(i){void 0===i&&(i={});const n=Object.keys(i)[0],r=i[n];"object"==typeof r&&null!==r?(!0===t[n]&&(t[n]={enabled:!0}),"navigation"===n&&t[n]&&t[n].enabled&&!t[n].prevEl&&!t[n].nextEl&&(t[n].auto=!0),["pagination","scrollbar"].indexOf(n)>=0&&t[n]&&t[n].enabled&&!t[n].el&&(t[n].auto=!0),n in t&&"enabled"in r?("object"!=typeof t[n]||"enabled"in t[n]||(t[n].enabled=!0),t[n]||(t[n]={enabled:!1}),ql(e,i)):ql(e,i)):ql(e,i)}}const Rc={eventsEmitter:lc,update:dc,translate:pc,transition:mc,slide:gc,loop:_c,grabCursor:yc,events:kc,breakpoints:Ic,checkOverflow:Oc,classes:Dc},Fc={};class Bc{constructor(){let t,e;for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];1===n.length&&n[0].constructor&&"Object"===Object.prototype.toString.call(n[0]).slice(8,-1)?e=n[0]:[t,e]=n,e||(e={}),e=ql({},e),t&&!e.el&&(e.el=t);const s=Bl();if(e.el&&"string"==typeof e.el&&s.querySelectorAll(e.el).length>1){const t=[];return s.querySelectorAll(e.el).forEach((i=>{const n=ql({},e,{el:i});t.push(new Bc(n))})),t}const o=this;o.__swiper__=!0,o.support=sc(),o.device=oc({userAgent:e.userAgent}),o.browser=ac(),o.eventsListeners={},o.eventsAnyListeners=[],o.modules=[...o.__modules__],e.modules&&Array.isArray(e.modules)&&o.modules.push(...e.modules);const a={};o.modules.forEach((t=>{t({params:e,swiper:o,extendParams:zc(e,a),on:o.on.bind(o),once:o.once.bind(o),off:o.off.bind(o),emit:o.emit.bind(o)})}));const l=ql({},Lc,a);return o.params=ql({},l,Fc,e),o.originalParams=ql({},o.params),o.passedParams=ql({},e),o.params&&o.params.on&&Object.keys(o.params.on).forEach((t=>{o.on(t,o.params.on[t])})),o.params&&o.params.onAny&&o.onAny(o.params.onAny),Object.assign(o,{enabled:o.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return"horizontal"===o.params.direction},isVertical(){return"vertical"===o.params.direction},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:o.params.allowSlideNext,allowSlidePrev:o.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:o.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:o.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),o.emit("_swiper"),o.params.init&&o.init(),o}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:e,params:i}=this,n=Jl(Yl(e,`.${i.slideClass}, swiper-slide`)[0]);return Jl(t)-n}getSlideIndexByData(t){return this.getSlideIndex(this.slides.filter((e=>1*e.getAttribute("data-swiper-slide-index")===t))[0])}recalcSlides(){const{slidesEl:t,params:e}=this;this.slides=Yl(t,`.${e.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,e){const i=this;t=Math.min(Math.max(t,0),1);const n=i.minTranslate(),r=(i.maxTranslate()-n)*t+n;i.translateTo(r,void 0===e?0:e),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const e=t.el.className.split(" ").filter((e=>0===e.indexOf("swiper")||0===e.indexOf(t.params.containerModifierClass)));t.emit("_containerClasses",e.join(" "))}getSlideClasses(t){const e=this;return e.destroyed?"":t.className.split(" ").filter((t=>0===t.indexOf("swiper-slide")||0===t.indexOf(e.params.slideClass))).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const e=[];t.slides.forEach((i=>{const n=t.getSlideClasses(i);e.push({slideEl:i,classNames:n}),t.emit("_slideClass",i,n)})),t.emit("_slideClasses",e)}slidesPerViewDynamic(t,e){void 0===t&&(t="current"),void 0===e&&(e=!1);const{params:i,slides:n,slidesGrid:r,slidesSizesGrid:s,size:o,activeIndex:a}=this;let l=1;if("number"==typeof i.slidesPerView)return i.slidesPerView;if(i.centeredSlides){let t,e=n[a]?n[a].swiperSlideSize:0;for(let i=a+1;i<n.length;i+=1)n[i]&&!t&&(e+=n[i].swiperSlideSize,l+=1,e>o&&(t=!0));for(let i=a-1;i>=0;i-=1)n[i]&&!t&&(e+=n[i].swiperSlideSize,l+=1,e>o&&(t=!0))}else if("current"===t)for(let t=a+1;t<n.length;t+=1){(e?r[t]+s[t]-r[a]<o:r[t]-r[a]<o)&&(l+=1)}else for(let t=a-1;t>=0;t-=1){r[a]-r[t]<o&&(l+=1)}return l}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:e,params:i}=t;function n(){const e=t.rtlTranslate?-1*t.translate:t.translate,i=Math.min(Math.max(e,t.maxTranslate()),t.minTranslate());t.setTranslate(i),t.updateActiveIndex(),t.updateSlidesClasses()}let r;if(i.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach((e=>{e.complete&&cc(t,e)})),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),i.freeMode&&i.freeMode.enabled&&!i.cssMode)n(),i.autoHeight&&t.updateAutoHeight();else{if(("auto"===i.slidesPerView||i.slidesPerView>1)&&t.isEnd&&!i.centeredSlides){const e=t.virtual&&i.virtual.enabled?t.virtual.slides:t.slides;r=t.slideTo(e.length-1,0,!1,!0)}else r=t.slideTo(t.activeIndex,0,!1,!0);r||n()}i.watchOverflow&&e!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,e){void 0===e&&(e=!0);const i=this,n=i.params.direction;return t||(t="horizontal"===n?"vertical":"horizontal"),t===n||"horizontal"!==t&&"vertical"!==t||(i.el.classList.remove(`${i.params.containerModifierClass}${n}`),i.el.classList.add(`${i.params.containerModifierClass}${t}`),i.emitContainerClasses(),i.params.direction=t,i.slides.forEach((e=>{"vertical"===t?e.style.width="":e.style.height=""})),i.emit("changeDirection"),e&&i.update()),i}changeLanguageDirection(t){const e=this;e.rtl&&"rtl"===t||!e.rtl&&"ltr"===t||(e.rtl="rtl"===t,e.rtlTranslate="horizontal"===e.params.direction&&e.rtl,e.rtl?(e.el.classList.add(`${e.params.containerModifierClass}rtl`),e.el.dir="rtl"):(e.el.classList.remove(`${e.params.containerModifierClass}rtl`),e.el.dir="ltr"),e.update())}mount(t){const e=this;if(e.mounted)return!0;let i=t||e.params.el;if("string"==typeof i&&(i=document.querySelector(i)),!i)return!1;i.swiper=e,i.parentNode&&i.parentNode.host&&"SWIPER-CONTAINER"===i.parentNode.host.nodeName&&(e.isElement=!0);const n=()=>`.${(e.params.wrapperClass||"").trim().split(" ").join(".")}`;let r=(()=>{if(i&&i.shadowRoot&&i.shadowRoot.querySelector){return i.shadowRoot.querySelector(n())}return Yl(i,n())[0]})();return!r&&e.params.createElements&&(r=Kl("div",e.params.wrapperClass),i.append(r),Yl(i,`.${e.params.slideClass}`).forEach((t=>{r.append(t)}))),Object.assign(e,{el:i,wrapperEl:r,slidesEl:e.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:r,hostEl:e.isElement?i.parentNode.host:i,mounted:!0,rtl:"rtl"===i.dir.toLowerCase()||"rtl"===Ql(i,"direction"),rtlTranslate:"horizontal"===e.params.direction&&("rtl"===i.dir.toLowerCase()||"rtl"===Ql(i,"direction")),wrongRTL:"-webkit-box"===Ql(r,"display")}),!0}init(t){const e=this;if(e.initialized)return e;if(!1===e.mount(t))return e;e.emit("beforeInit"),e.params.breakpoints&&e.setBreakpoint(),e.addClasses(),e.updateSize(),e.updateSlides(),e.params.watchOverflow&&e.checkOverflow(),e.params.grabCursor&&e.enabled&&e.setGrabCursor(),e.params.loop&&e.virtual&&e.params.virtual.enabled?e.slideTo(e.params.initialSlide+e.virtual.slidesBefore,0,e.params.runCallbacksOnInit,!1,!0):e.slideTo(e.params.initialSlide,0,e.params.runCallbacksOnInit,!1,!0),e.params.loop&&e.loopCreate(),e.attachEvents();const i=[...e.el.querySelectorAll('[loading="lazy"]')];return e.isElement&&i.push(...e.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach((t=>{t.complete?cc(e,t):t.addEventListener("load",(t=>{cc(e,t.target)}))})),uc(e),e.initialized=!0,uc(e),e.emit("init"),e.emit("afterInit"),e}destroy(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);const i=this,{params:n,el:r,wrapperEl:s,slides:o}=i;return void 0===i.params||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),n.loop&&i.loopDestroy(),e&&(i.removeClasses(),r.removeAttribute("style"),s.removeAttribute("style"),o&&o.length&&o.forEach((t=>{t.classList.remove(n.slideVisibleClass,n.slideFullyVisibleClass,n.slideActiveClass,n.slideNextClass,n.slidePrevClass),t.removeAttribute("style"),t.removeAttribute("data-swiper-slide-index")}))),i.emit("destroy"),Object.keys(i.eventsListeners).forEach((t=>{i.off(t)})),!1!==t&&(i.el.swiper=null,function(t){const e=t;Object.keys(e).forEach((t=>{try{e[t]=null}catch(t){}try{delete e[t]}catch(t){}}))}(i)),i.destroyed=!0),null}static extendDefaults(t){ql(Fc,t)}static get extendedDefaults(){return Fc}static get defaults(){return Lc}static installModule(t){Bc.prototype.__modules__||(Bc.prototype.__modules__=[]);const e=Bc.prototype.__modules__;"function"==typeof t&&e.indexOf(t)<0&&e.push(t)}static use(t){return Array.isArray(t)?(t.forEach((t=>Bc.installModule(t))),Bc):(Bc.installModule(t),Bc)}}function Nc(t,e,i,n){return t.params.createElements&&Object.keys(n).forEach((r=>{if(!i[r]&&!0===i.auto){let s=Yl(t.el,`.${n[r]}`)[0];s||(s=Kl("div",n[r]),s.className=n[r],t.el.append(s)),i[r]=s,e[r]=s}})),i}function jc(t){let{swiper:e,extendParams:i,on:n,emit:r}=t;i({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),e.navigation={nextEl:null,prevEl:null};const s=t=>(Array.isArray(t)?t:[t]).filter((t=>!!t));function o(t){let i;return t&&"string"==typeof t&&e.isElement&&(i=e.el.querySelector(t),i)?i:(t&&("string"==typeof t&&(i=[...document.querySelectorAll(t)]),e.params.uniqueNavElements&&"string"==typeof t&&i.length>1&&1===e.el.querySelectorAll(t).length&&(i=e.el.querySelector(t))),t&&!i?t:i)}function a(t,i){const n=e.params.navigation;(t=s(t)).forEach((t=>{t&&(t.classList[i?"add":"remove"](...n.disabledClass.split(" ")),"BUTTON"===t.tagName&&(t.disabled=i),e.params.watchOverflow&&e.enabled&&t.classList[e.isLocked?"add":"remove"](n.lockClass))}))}function l(){const{nextEl:t,prevEl:i}=e.navigation;if(e.params.loop)return a(i,!1),void a(t,!1);a(i,e.isBeginning&&!e.params.rewind),a(t,e.isEnd&&!e.params.rewind)}function c(t){t.preventDefault(),(!e.isBeginning||e.params.loop||e.params.rewind)&&(e.slidePrev(),r("navigationPrev"))}function h(t){t.preventDefault(),(!e.isEnd||e.params.loop||e.params.rewind)&&(e.slideNext(),r("navigationNext"))}function u(){const t=e.params.navigation;if(e.params.navigation=Nc(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!t.nextEl&&!t.prevEl)return;let i=o(t.nextEl),n=o(t.prevEl);Object.assign(e.navigation,{nextEl:i,prevEl:n}),i=s(i),n=s(n);const r=(i,n)=>{i&&i.addEventListener("click","next"===n?h:c),!e.enabled&&i&&i.classList.add(...t.lockClass.split(" "))};i.forEach((t=>r(t,"next"))),n.forEach((t=>r(t,"prev")))}function d(){let{nextEl:t,prevEl:i}=e.navigation;t=s(t),i=s(i);const n=(t,i)=>{t.removeEventListener("click","next"===i?h:c),t.classList.remove(...e.params.navigation.disabledClass.split(" "))};t.forEach((t=>n(t,"next"))),i.forEach((t=>n(t,"prev")))}n("init",(()=>{!1===e.params.navigation.enabled?p():(u(),l())})),n("toEdge fromEdge lock unlock",(()=>{l()})),n("destroy",(()=>{d()})),n("enable disable",(()=>{let{nextEl:t,prevEl:i}=e.navigation;t=s(t),i=s(i),e.enabled?l():[...t,...i].filter((t=>!!t)).forEach((t=>t.classList.add(e.params.navigation.lockClass)))})),n("click",((t,i)=>{let{nextEl:n,prevEl:o}=e.navigation;n=s(n),o=s(o);const a=i.target;if(e.params.navigation.hideOnClick&&!o.includes(a)&&!n.includes(a)){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===a||e.pagination.el.contains(a)))return;let t;n.length?t=n[0].classList.contains(e.params.navigation.hiddenClass):o.length&&(t=o[0].classList.contains(e.params.navigation.hiddenClass)),r(!0===t?"navigationShow":"navigationHide"),[...n,...o].filter((t=>!!t)).forEach((t=>t.classList.toggle(e.params.navigation.hiddenClass)))}}));const p=()=>{e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),d()};Object.assign(e.navigation,{enable:()=>{e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),u(),l()},disable:p,update:l,init:u,destroy:d})}function Vc(t){return void 0===t&&(t=""),`.${t.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function Uc(t){let{swiper:e,extendParams:i,on:n,emit:r}=t;const s="swiper-pagination";let o;i({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:t=>t,formatFractionTotal:t=>t,bulletClass:`${s}-bullet`,bulletActiveClass:`${s}-bullet-active`,modifierClass:`${s}-`,currentClass:`${s}-current`,totalClass:`${s}-total`,hiddenClass:`${s}-hidden`,progressbarFillClass:`${s}-progressbar-fill`,progressbarOppositeClass:`${s}-progressbar-opposite`,clickableClass:`${s}-clickable`,lockClass:`${s}-lock`,horizontalClass:`${s}-horizontal`,verticalClass:`${s}-vertical`,paginationDisabledClass:`${s}-disabled`}}),e.pagination={el:null,bullets:[]};let a=0;const l=t=>(Array.isArray(t)?t:[t]).filter((t=>!!t));function c(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&0===e.pagination.el.length}function h(t,i){const{bulletActiveClass:n}=e.params.pagination;t&&(t=t[("prev"===i?"previous":"next")+"ElementSibling"])&&(t.classList.add(`${n}-${i}`),(t=t[("prev"===i?"previous":"next")+"ElementSibling"])&&t.classList.add(`${n}-${i}-${i}`))}function u(t){const i=t.target.closest(Vc(e.params.pagination.bulletClass));if(!i)return;t.preventDefault();const n=Jl(i)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===n)return;e.slideToLoop(n)}else e.slideTo(n)}function d(){const t=e.rtl,i=e.params.pagination;if(c())return;let n,s,u=e.pagination.el;u=l(u);const d=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,p=e.params.loop?Math.ceil(d/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(s=e.previousRealIndex||0,n=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):void 0!==e.snapIndex?(n=e.snapIndex,s=e.previousSnapIndex):(s=e.previousIndex||0,n=e.activeIndex||0),"bullets"===i.type&&e.pagination.bullets&&e.pagination.bullets.length>0){const r=e.pagination.bullets;let l,c,d;if(i.dynamicBullets&&(o=ec(r[0],e.isHorizontal()?"width":"height",!0),u.forEach((t=>{t.style[e.isHorizontal()?"width":"height"]=o*(i.dynamicMainBullets+4)+"px"})),i.dynamicMainBullets>1&&void 0!==s&&(a+=n-(s||0),a>i.dynamicMainBullets-1?a=i.dynamicMainBullets-1:a<0&&(a=0)),l=Math.max(n-a,0),c=l+(Math.min(r.length,i.dynamicMainBullets)-1),d=(c+l)/2),r.forEach((t=>{const e=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((t=>`${i.bulletActiveClass}${t}`))].map((t=>"string"==typeof t&&t.includes(" ")?t.split(" "):t)).flat();t.classList.remove(...e)})),u.length>1)r.forEach((t=>{const r=Jl(t);r===n?t.classList.add(...i.bulletActiveClass.split(" ")):e.isElement&&t.setAttribute("part","bullet"),i.dynamicBullets&&(r>=l&&r<=c&&t.classList.add(...`${i.bulletActiveClass}-main`.split(" ")),r===l&&h(t,"prev"),r===c&&h(t,"next"))}));else{const t=r[n];if(t&&t.classList.add(...i.bulletActiveClass.split(" ")),e.isElement&&r.forEach(((t,e)=>{t.setAttribute("part",e===n?"bullet-active":"bullet")})),i.dynamicBullets){const t=r[l],e=r[c];for(let t=l;t<=c;t+=1)r[t]&&r[t].classList.add(...`${i.bulletActiveClass}-main`.split(" "));h(t,"prev"),h(e,"next")}}if(i.dynamicBullets){const n=Math.min(r.length,i.dynamicMainBullets+4),s=(o*n-o)/2-d*o,a=t?"right":"left";r.forEach((t=>{t.style[e.isHorizontal()?a:"top"]=`${s}px`}))}}u.forEach(((t,s)=>{if("fraction"===i.type&&(t.querySelectorAll(Vc(i.currentClass)).forEach((t=>{t.textContent=i.formatFractionCurrent(n+1)})),t.querySelectorAll(Vc(i.totalClass)).forEach((t=>{t.textContent=i.formatFractionTotal(p)}))),"progressbar"===i.type){let r;r=i.progressbarOpposite?e.isHorizontal()?"vertical":"horizontal":e.isHorizontal()?"horizontal":"vertical";const s=(n+1)/p;let o=1,a=1;"horizontal"===r?o=s:a=s,t.querySelectorAll(Vc(i.progressbarFillClass)).forEach((t=>{t.style.transform=`translate3d(0,0,0) scaleX(${o}) scaleY(${a})`,t.style.transitionDuration=`${e.params.speed}ms`}))}"custom"===i.type&&i.renderCustom?(t.innerHTML=i.renderCustom(e,n+1,p),0===s&&r("paginationRender",t)):(0===s&&r("paginationRender",t),r("paginationUpdate",t)),e.params.watchOverflow&&e.enabled&&t.classList[e.isLocked?"add":"remove"](i.lockClass)}))}function p(){const t=e.params.pagination;if(c())return;const i=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.grid&&e.params.grid.rows>1?e.slides.length/Math.ceil(e.params.grid.rows):e.slides.length;let n=e.pagination.el;n=l(n);let s="";if("bullets"===t.type){let n=e.params.loop?Math.ceil(i/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&n>i&&(n=i);for(let i=0;i<n;i+=1)t.renderBullet?s+=t.renderBullet.call(e,i,t.bulletClass):s+=`<${t.bulletElement} ${e.isElement?'part="bullet"':""} class="${t.bulletClass}"></${t.bulletElement}>`}"fraction"===t.type&&(s=t.renderFraction?t.renderFraction.call(e,t.currentClass,t.totalClass):`<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`),"progressbar"===t.type&&(s=t.renderProgressbar?t.renderProgressbar.call(e,t.progressbarFillClass):`<span class="${t.progressbarFillClass}"></span>`),e.pagination.bullets=[],n.forEach((i=>{"custom"!==t.type&&(i.innerHTML=s||""),"bullets"===t.type&&e.pagination.bullets.push(...i.querySelectorAll(Vc(t.bulletClass)))})),"custom"!==t.type&&r("paginationRender",n[0])}function f(){e.params.pagination=Nc(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const t=e.params.pagination;if(!t.el)return;let i;"string"==typeof t.el&&e.isElement&&(i=e.el.querySelector(t.el)),i||"string"!=typeof t.el||(i=[...document.querySelectorAll(t.el)]),i||(i=t.el),i&&0!==i.length&&(e.params.uniqueNavElements&&"string"==typeof t.el&&Array.isArray(i)&&i.length>1&&(i=[...e.el.querySelectorAll(t.el)],i.length>1&&(i=i.filter((t=>tc(t,".swiper")[0]===e.el))[0])),Array.isArray(i)&&1===i.length&&(i=i[0]),Object.assign(e.pagination,{el:i}),i=l(i),i.forEach((i=>{"bullets"===t.type&&t.clickable&&i.classList.add(...(t.clickableClass||"").split(" ")),i.classList.add(t.modifierClass+t.type),i.classList.add(e.isHorizontal()?t.horizontalClass:t.verticalClass),"bullets"===t.type&&t.dynamicBullets&&(i.classList.add(`${t.modifierClass}${t.type}-dynamic`),a=0,t.dynamicMainBullets<1&&(t.dynamicMainBullets=1)),"progressbar"===t.type&&t.progressbarOpposite&&i.classList.add(t.progressbarOppositeClass),t.clickable&&i.addEventListener("click",u),e.enabled||i.classList.add(t.lockClass)})))}function m(){const t=e.params.pagination;if(c())return;let i=e.pagination.el;i&&(i=l(i),i.forEach((i=>{i.classList.remove(t.hiddenClass),i.classList.remove(t.modifierClass+t.type),i.classList.remove(e.isHorizontal()?t.horizontalClass:t.verticalClass),t.clickable&&(i.classList.remove(...(t.clickableClass||"").split(" ")),i.removeEventListener("click",u))}))),e.pagination.bullets&&e.pagination.bullets.forEach((e=>e.classList.remove(...t.bulletActiveClass.split(" "))))}n("changeDirection",(()=>{if(!e.pagination||!e.pagination.el)return;const t=e.params.pagination;let{el:i}=e.pagination;i=l(i),i.forEach((i=>{i.classList.remove(t.horizontalClass,t.verticalClass),i.classList.add(e.isHorizontal()?t.horizontalClass:t.verticalClass)}))})),n("init",(()=>{!1===e.params.pagination.enabled?g():(f(),p(),d())})),n("activeIndexChange",(()=>{void 0===e.snapIndex&&d()})),n("snapIndexChange",(()=>{d()})),n("snapGridLengthChange",(()=>{p(),d()})),n("destroy",(()=>{m()})),n("enable disable",(()=>{let{el:t}=e.pagination;t&&(t=l(t),t.forEach((t=>t.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass))))})),n("lock unlock",(()=>{d()})),n("click",((t,i)=>{const n=i.target,s=l(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&s&&s.length>0&&!n.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&n===e.navigation.nextEl||e.navigation.prevEl&&n===e.navigation.prevEl))return;const t=s[0].classList.contains(e.params.pagination.hiddenClass);r(!0===t?"paginationShow":"paginationHide"),s.forEach((t=>t.classList.toggle(e.params.pagination.hiddenClass)))}}));const g=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:t}=e.pagination;t&&(t=l(t),t.forEach((t=>t.classList.add(e.params.pagination.paginationDisabledClass)))),m()};Object.assign(e.pagination,{enable:()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:t}=e.pagination;t&&(t=l(t),t.forEach((t=>t.classList.remove(e.params.pagination.paginationDisabledClass)))),f(),p(),d()},disable:g,render:p,update:d,init:f,destroy:m})}function $c(t){let e,i,{swiper:n,extendParams:r,on:s,emit:o,params:a}=t;n.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,c,h,u,d,p,f,m,g=a&&a.autoplay?a.autoplay.delay:3e3,_=a&&a.autoplay?a.autoplay.delay:3e3,y=(new Date).getTime();function v(t){n&&!n.destroyed&&n.wrapperEl&&t.target===n.wrapperEl&&(n.wrapperEl.removeEventListener("transitionend",v),m||T())}const b=()=>{if(n.destroyed||!n.autoplay.running)return;n.autoplay.paused?c=!0:c&&(_=l,c=!1);const t=n.autoplay.paused?l:y+_-(new Date).getTime();n.autoplay.timeLeft=t,o("autoplayTimeLeft",t,t/g),i=requestAnimationFrame((()=>{b()}))},x=t=>{if(n.destroyed||!n.autoplay.running)return;cancelAnimationFrame(i),b();let r=void 0===t?n.params.autoplay.delay:t;g=n.params.autoplay.delay,_=n.params.autoplay.delay;const s=(()=>{let t;if(t=n.virtual&&n.params.virtual.enabled?n.slides.filter((t=>t.classList.contains("swiper-slide-active")))[0]:n.slides[n.activeIndex],!t)return;return parseInt(t.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(s)&&s>0&&void 0===t&&(r=s,g=s,_=s),l=r;const a=n.params.speed,c=()=>{n&&!n.destroyed&&(n.params.autoplay.reverseDirection?!n.isBeginning||n.params.loop||n.params.rewind?(n.slidePrev(a,!0,!0),o("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(n.slides.length-1,a,!0,!0),o("autoplay")):!n.isEnd||n.params.loop||n.params.rewind?(n.slideNext(a,!0,!0),o("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(0,a,!0,!0),o("autoplay")),n.params.cssMode&&(y=(new Date).getTime(),requestAnimationFrame((()=>{x()}))))};return r>0?(clearTimeout(e),e=setTimeout((()=>{c()}),r)):requestAnimationFrame((()=>{c()})),r},w=()=>{y=(new Date).getTime(),n.autoplay.running=!0,x(),o("autoplayStart")},E=()=>{n.autoplay.running=!1,clearTimeout(e),cancelAnimationFrame(i),o("autoplayStop")},S=(t,i)=>{if(n.destroyed||!n.autoplay.running)return;clearTimeout(e),t||(f=!0);const r=()=>{o("autoplayPause"),n.params.autoplay.waitForTransition?n.wrapperEl.addEventListener("transitionend",v):T()};if(n.autoplay.paused=!0,i)return p&&(l=n.params.autoplay.delay),p=!1,void r();const s=l||n.params.autoplay.delay;l=s-((new Date).getTime()-y),n.isEnd&&l<0&&!n.params.loop||(l<0&&(l=0),r())},T=()=>{n.isEnd&&l<0&&!n.params.loop||n.destroyed||!n.autoplay.running||(y=(new Date).getTime(),f?(f=!1,x(l)):x(),n.autoplay.paused=!1,o("autoplayResume"))},M=()=>{if(n.destroyed||!n.autoplay.running)return;const t=Bl();"hidden"===t.visibilityState&&(f=!0,S(!0)),"visible"===t.visibilityState&&T()},A=t=>{"mouse"===t.pointerType&&(f=!0,m=!0,n.animating||n.autoplay.paused||S(!0))},C=t=>{"mouse"===t.pointerType&&(m=!1,n.autoplay.paused&&T())};s("init",(()=>{n.params.autoplay.enabled&&(n.params.autoplay.pauseOnMouseEnter&&(n.el.addEventListener("pointerenter",A),n.el.addEventListener("pointerleave",C)),Bl().addEventListener("visibilitychange",M),w())})),s("destroy",(()=>{n.el.removeEventListener("pointerenter",A),n.el.removeEventListener("pointerleave",C),Bl().removeEventListener("visibilitychange",M),n.autoplay.running&&E()})),s("_freeModeStaticRelease",(()=>{(u||f)&&T()})),s("_freeModeNoMomentumRelease",(()=>{n.params.autoplay.disableOnInteraction?E():S(!0,!0)})),s("beforeTransitionStart",((t,e,i)=>{!n.destroyed&&n.autoplay.running&&(i||!n.params.autoplay.disableOnInteraction?S(!0,!0):E())})),s("sliderFirstMove",(()=>{!n.destroyed&&n.autoplay.running&&(n.params.autoplay.disableOnInteraction?E():(h=!0,u=!1,f=!1,d=setTimeout((()=>{f=!0,u=!0,S(!0)}),200)))})),s("touchEnd",(()=>{if(!n.destroyed&&n.autoplay.running&&h){if(clearTimeout(d),clearTimeout(e),n.params.autoplay.disableOnInteraction)return u=!1,void(h=!1);u&&n.params.cssMode&&T(),u=!1,h=!1}})),s("slideChange",(()=>{!n.destroyed&&n.autoplay.running&&(p=!0)})),Object.assign(n.autoplay,{start:w,stop:E,pause:S,resume:T})}function Hc(t){let{swiper:e,extendParams:i,on:n}=t;i({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let r=!1,s=!1;function o(){const t=e.thumbs.swiper;if(!t||t.destroyed)return;const i=t.clickedIndex,n=t.clickedSlide;if(n&&n.classList.contains(e.params.thumbs.slideThumbActiveClass))return;if(null==i)return;let r;r=t.params.loop?parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"),10):i,e.params.loop?e.slideToLoop(r):e.slideTo(r)}function a(){const{thumbs:t}=e.params;if(r)return!1;r=!0;const i=e.constructor;if(t.swiper instanceof i)e.thumbs.swiper=t.swiper,Object.assign(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper.update();else if(Hl(t.swiper)){const n=Object.assign({},t.swiper);Object.assign(n,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper=new i(n),s=!0}return e.thumbs.swiper.el.classList.add(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",o),!0}function l(t){const i=e.thumbs.swiper;if(!i||i.destroyed)return;const n="auto"===i.params.slidesPerView?i.slidesPerViewDynamic():i.params.slidesPerView;let r=1;const s=e.params.thumbs.slideThumbActiveClass;if(e.params.slidesPerView>1&&!e.params.centeredSlides&&(r=e.params.slidesPerView),e.params.thumbs.multipleActiveThumbs||(r=1),r=Math.floor(r),i.slides.forEach((t=>t.classList.remove(s))),i.params.loop||i.params.virtual&&i.params.virtual.enabled)for(let t=0;t<r;t+=1)Yl(i.slidesEl,`[data-swiper-slide-index="${e.realIndex+t}"]`).forEach((t=>{t.classList.add(s)}));else for(let t=0;t<r;t+=1)i.slides[e.realIndex+t]&&i.slides[e.realIndex+t].classList.add(s);const o=e.params.thumbs.autoScrollOffset,a=o&&!i.params.loop;if(e.realIndex!==i.realIndex||a){const r=i.activeIndex;let s,l;if(i.params.loop){const t=i.slides.filter((t=>t.getAttribute("data-swiper-slide-index")===`${e.realIndex}`))[0];s=i.slides.indexOf(t),l=e.activeIndex>e.previousIndex?"next":"prev"}else s=e.realIndex,l=s>e.previousIndex?"next":"prev";a&&(s+="next"===l?o:-1*o),i.visibleSlidesIndexes&&i.visibleSlidesIndexes.indexOf(s)<0&&(i.params.centeredSlides?s=s>r?s-Math.floor(n/2)+1:s+Math.floor(n/2)-1:s>r&&i.params.slidesPerGroup,i.slideTo(s,t?0:void 0))}}e.thumbs={swiper:null},n("beforeInit",(()=>{const{thumbs:t}=e.params;if(t&&t.swiper)if("string"==typeof t.swiper||t.swiper instanceof HTMLElement){const i=Bl(),n=()=>{const n="string"==typeof t.swiper?i.querySelector(t.swiper):t.swiper;if(n&&n.swiper)t.swiper=n.swiper,a(),l(!0);else if(n){const i=r=>{t.swiper=r.detail[0],n.removeEventListener("init",i),a(),l(!0),t.swiper.update(),e.update()};n.addEventListener("init",i)}return n},r=()=>{if(e.destroyed)return;n()||requestAnimationFrame(r)};requestAnimationFrame(r)}else a(),l(!0)})),n("slideChange update resize observerUpdate",(()=>{l()})),n("setTransition",((t,i)=>{const n=e.thumbs.swiper;n&&!n.destroyed&&n.setTransition(i)})),n("beforeDestroy",(()=>{const t=e.thumbs.swiper;t&&!t.destroyed&&s&&t.destroy()})),Object.assign(e.thumbs,{init:a,update:l})}function qc(t,e){const i=Zl(e);return i!==e&&(i.style.backfaceVisibility="hidden",i.style["-webkit-backface-visibility"]="hidden"),i}function Wc(t){let{swiper:e,duration:i,transformElements:n,allSlides:r}=t;const{activeIndex:s}=e;if(e.params.virtualTranslate&&0!==i){let t,i=!1;t=r?n:n.filter((t=>{const i=t.classList.contains("swiper-slide-transform")?(t=>{if(!t.parentElement)return e.slides.filter((e=>e.shadowRoot&&e.shadowRoot===t.parentNode))[0];return t.parentElement})(t):t;return e.getSlideIndex(i)===s})),t.forEach((t=>{!function(t,e){e&&t.addEventListener("transitionend",(function i(n){n.target===t&&(e.call(t,n),t.removeEventListener("transitionend",i))}))}(t,(()=>{if(i)return;if(!e||e.destroyed)return;i=!0,e.animating=!1;const t=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});e.wrapperEl.dispatchEvent(t)}))}))}}function Gc(t){let{swiper:e,extendParams:i,on:n}=t;i({fadeEffect:{crossFade:!1}});!function(t){const{effect:e,swiper:i,on:n,setTranslate:r,setTransition:s,overwriteParams:o,perspective:a,recreateShadows:l,getEffectParams:c}=t;let h;n("beforeInit",(()=>{if(i.params.effect!==e)return;i.classNames.push(`${i.params.containerModifierClass}${e}`),a&&a()&&i.classNames.push(`${i.params.containerModifierClass}3d`);const t=o?o():{};Object.assign(i.params,t),Object.assign(i.originalParams,t)})),n("setTranslate",(()=>{i.params.effect===e&&r()})),n("setTransition",((t,n)=>{i.params.effect===e&&s(n)})),n("transitionEnd",(()=>{if(i.params.effect===e&&l){if(!c||!c().slideShadows)return;i.slides.forEach((t=>{t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>t.remove()))})),l()}})),n("virtualUpdate",(()=>{i.params.effect===e&&(i.slides.length||(h=!0),requestAnimationFrame((()=>{h&&i.slides&&i.slides.length&&(r(),h=!1)})))}))}({effect:"fade",swiper:e,on:n,setTranslate:()=>{const{slides:t}=e;e.params.fadeEffect;for(let i=0;i<t.length;i+=1){const t=e.slides[i];let n=-t.swiperSlideOffset;e.params.virtualTranslate||(n-=e.translate);let r=0;e.isHorizontal()||(r=n,n=0);const s=e.params.fadeEffect.crossFade?Math.max(1-Math.abs(t.progress),0):1+Math.min(Math.max(t.progress,-1),0),o=qc(0,t);o.style.opacity=s,o.style.transform=`translate3d(${n}px, ${r}px, 0px)`}},setTransition:t=>{const i=e.slides.map((t=>Zl(t)));i.forEach((e=>{e.style.transitionDuration=`${t}ms`})),Wc({swiper:e,duration:t,transformElements:i,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})}Object.keys(Rc).forEach((t=>{Object.keys(Rc[t]).forEach((e=>{Bc.prototype[e]=Rc[t][e]}))})),Bc.use([function(t){let{swiper:e,on:i,emit:n}=t;const r=jl();let s=null,o=null;const a=()=>{e&&!e.destroyed&&e.initialized&&(n("beforeResize"),n("resize"))},l=()=>{e&&!e.destroyed&&e.initialized&&n("orientationchange")};i("init",(()=>{e.params.resizeObserver&&void 0!==r.ResizeObserver?e&&!e.destroyed&&e.initialized&&(s=new ResizeObserver((t=>{o=r.requestAnimationFrame((()=>{const{width:i,height:n}=e;let r=i,s=n;t.forEach((t=>{let{contentBoxSize:i,contentRect:n,target:o}=t;o&&o!==e.el||(r=n?n.width:(i[0]||i).inlineSize,s=n?n.height:(i[0]||i).blockSize)})),r===i&&s===n||a()}))})),s.observe(e.el)):(r.addEventListener("resize",a),r.addEventListener("orientationchange",l))})),i("destroy",(()=>{o&&r.cancelAnimationFrame(o),s&&s.unobserve&&e.el&&(s.unobserve(e.el),s=null),r.removeEventListener("resize",a),r.removeEventListener("orientationchange",l)}))},function(t){let{swiper:e,extendParams:i,on:n,emit:r}=t;const s=[],o=jl(),a=function(t,i){void 0===i&&(i={});const n=new(o.MutationObserver||o.WebkitMutationObserver)((t=>{if(e.__preventObserver__)return;if(1===t.length)return void r("observerUpdate",t[0]);const i=function(){r("observerUpdate",t[0])};o.requestAnimationFrame?o.requestAnimationFrame(i):o.setTimeout(i,0)}));n.observe(t,{attributes:void 0===i.attributes||i.attributes,childList:void 0===i.childList||i.childList,characterData:void 0===i.characterData||i.characterData}),s.push(n)};i({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",(()=>{if(e.params.observer){if(e.params.observeParents){const t=tc(e.hostEl);for(let e=0;e<t.length;e+=1)a(t[e])}a(e.hostEl,{childList:e.params.observeSlideChildren}),a(e.wrapperEl,{attributes:!1})}})),n("destroy",(()=>{s.forEach((t=>{t.disconnect()})),s.splice(0,s.length)}))}]);var Zc=class extends Da{constructor(t,e){super(t,e),this.sliderContainer=t.querySelector(".swiper"),this.prevButton=t.querySelector(":scope .js-slider-prev"),this.nextButton=t.querySelector(":scope .js-slider-next")}init(){this.slider=new Bc(this.sliderContainer,{modules:[jc],navigation:{prevEl:this.prevButton,nextEl:this.nextButton},breakpoints:{0:{slidesPerView:1,spaceBetween:8},1024:{slidesPerView:2,spaceBetween:32}}})}destroy(){this.slider.destroy()}};function Yc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Yc(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Yc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}class Kc extends Da{constructor(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,e),s(this,"swiper",null),s(this,"prev",null),s(this,"next",null),s(this,"options",{modules:[jc],spaceBetween:64,slidesPerView:3,loop:!0,grabCursor:!0});var n=t.closest(".app-section");this.prev=null==n?void 0:n.querySelector(".js-slider-prev"),this.next=null==n?void 0:n.querySelector(".js-slider-next"),this.sliderNav=null==n?void 0:n.querySelector(".slider-nav"),this.options=Xc(Xc(Xc({},this.options),{},{navigation:{prevEl:this.prev,nextEl:this.next}},i),{},{on:{init:t=>{var e;null===(e=this.sliderNav)||void 0===e||e.classList.toggle("_hidden",t.isEnd)}}})}init(){this.swiper=new Bc(this.$element,this.options)}destroy(){var t;null===(t=this.swiper)||void 0===t||t.destroy()}}var Qc=class extends Kc{constructor(t,e){super(t,e,{modules:[$c],allowTouchMove:!1,slidesPerView:"auto",loop:!0,speed:4e3,autoplay:{delay:0},breakpoints:{0:{spaceBetween:20},1024:{spaceBetween:32}}}),window.addEventListener("load",(()=>{this.restartSwiper()})),e.on("resize:debounce",(()=>{this.restartSwiper()}))}restartSwiper(){this.destroy(),setTimeout((()=>{this.init()}),300)}};var Jc=class extends Da{constructor(t,e){super(t,e)}init(){this.slider=new Bc(this.$element,{modules:[Uc],pagination:{clickable:!0,el:".swiper-pagination"},spaceBetween:0,breakpoints:{0:{slidesPerView:1.2},767:{slidesPerView:2.2},1024:{slidesPerView:4}}})}destroy(){this.slider.destroy()}};function th(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function eh(t){return t instanceof th(t).Element||t instanceof Element}function ih(t){return t instanceof th(t).HTMLElement||t instanceof HTMLElement}function nh(t){return"undefined"!=typeof ShadowRoot&&(t instanceof th(t).ShadowRoot||t instanceof ShadowRoot)}var rh=Math.max,sh=Math.min,oh=Math.round;function ah(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function lh(){return!/^((?!chrome|android).)*safari/i.test(ah())}function ch(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,s=1;e&&ih(t)&&(r=t.offsetWidth>0&&oh(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&oh(n.height)/t.offsetHeight||1);var o=(eh(t)?th(t):window).visualViewport,a=!lh()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,h=n.width/r,u=n.height/s;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function hh(t){var e=th(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function uh(t){return t?(t.nodeName||"").toLowerCase():null}function dh(t){return((eh(t)?t.ownerDocument:t.document)||window.document).documentElement}function ph(t){return ch(dh(t)).left+hh(t).scrollLeft}function fh(t){return th(t).getComputedStyle(t)}function mh(t){var e=fh(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function gh(t,e,i){void 0===i&&(i=!1);var n,r,s=ih(e),o=ih(e)&&function(t){var e=t.getBoundingClientRect(),i=oh(e.width)/t.offsetWidth||1,n=oh(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=dh(e),l=ch(t,o,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(s||!s&&!i)&&(("body"!==uh(e)||mh(a))&&(c=(n=e)!==th(n)&&ih(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:hh(n)),ih(e)?((h=ch(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=ph(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function _h(t){var e=ch(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function yh(t){return"html"===uh(t)?t:t.assignedSlot||t.parentNode||(nh(t)?t.host:null)||dh(t)}function vh(t){return["html","body","#document"].indexOf(uh(t))>=0?t.ownerDocument.body:ih(t)&&mh(t)?t:vh(yh(t))}function bh(t,e){var i;void 0===e&&(e=[]);var n=vh(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),s=th(n),o=r?[s].concat(s.visualViewport||[],mh(n)?n:[]):n,a=e.concat(o);return r?a:a.concat(bh(yh(o)))}function xh(t){return["table","td","th"].indexOf(uh(t))>=0}function wh(t){return ih(t)&&"fixed"!==fh(t).position?t.offsetParent:null}function Eh(t){for(var e=th(t),i=wh(t);i&&xh(i)&&"static"===fh(i).position;)i=wh(i);return i&&("html"===uh(i)||"body"===uh(i)&&"static"===fh(i).position)?e:i||function(t){var e=/firefox/i.test(ah());if(/Trident/i.test(ah())&&ih(t)&&"fixed"===fh(t).position)return null;var i=yh(t);for(nh(i)&&(i=i.host);ih(i)&&["html","body"].indexOf(uh(i))<0;){var n=fh(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var Sh="top",Th="bottom",Mh="right",Ah="left",Ch="auto",kh=[Sh,Th,Mh,Ah],Ph="start",Ih="end",Dh="clippingParents",Oh="viewport",Lh="popper",zh="reference",Rh=kh.reduce((function(t,e){return t.concat([e+"-"+Ph,e+"-"+Ih])}),[]),Fh=[].concat(kh,[Ch]).reduce((function(t,e){return t.concat([e,e+"-"+Ph,e+"-"+Ih])}),[]),Bh=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Nh(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||r(t)})),n}var jh={placement:"bottom",modifiers:[],strategy:"absolute"};function Vh(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Uh(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,s=void 0===r?jh:r;return function(t,e,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},jh,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,h={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:eh(t)?bh(t):t.contextElement?bh(t.contextElement):[],popper:bh(e)};var o,c,d=function(t){var e=Nh(t);return Bh.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}((o=[].concat(n,a.options.modifiers),c=o.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=d.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,r=t.effect;if("function"==typeof r){var s=r({state:a,name:e,instance:h,options:n}),o=function(){};l.push(s||o)}})),h.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,i=t.popper;if(Vh(e,i)){a.rects={reference:gh(e,Eh(i),"fixed"===a.options.strategy),popper:_h(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:h})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise((function(t){h.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(r())}))}))),o}),destroy:function(){u(),c=!0}};if(!Vh(t,e))return h;function u(){l.forEach((function(t){return t()})),l=[]}return h.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),h}}var $h={passive:!0};var Hh={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=th(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",i.update,$h)})),a&&l.addEventListener("resize",i.update,$h),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",i.update,$h)})),a&&l.removeEventListener("resize",i.update,$h)}},data:{}};function qh(t){return t.split("-")[0]}function Wh(t){return t.split("-")[1]}function Gh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Zh(t){var e,i=t.reference,n=t.element,r=t.placement,s=r?qh(r):null,o=r?Wh(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case Sh:e={x:a,y:i.y-n.height};break;case Th:e={x:a,y:i.y+i.height};break;case Mh:e={x:i.x+i.width,y:l};break;case Ah:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=s?Gh(s):null;if(null!=c){var h="y"===c?"height":"width";switch(o){case Ph:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Ih:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Yh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Xh(t){var e,i=t.popper,n=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,u=t.isFixed,d=o.x,p=void 0===d?0:d,f=o.y,m=void 0===f?0:f,g="function"==typeof h?h({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var _=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),v=Ah,b=Sh,x=window;if(c){var w=Eh(i),E="clientHeight",S="clientWidth";if(w===th(i)&&"static"!==fh(w=dh(i)).position&&"absolute"===a&&(E="scrollHeight",S="scrollWidth"),r===Sh||(r===Ah||r===Mh)&&s===Ih)b=Th,m-=(u&&w===x&&x.visualViewport?x.visualViewport.height:w[E])-n.height,m*=l?1:-1;if(r===Ah||(r===Sh||r===Th)&&s===Ih)v=Mh,p-=(u&&w===x&&x.visualViewport?x.visualViewport.width:w[S])-n.width,p*=l?1:-1}var T,M=Object.assign({position:a},c&&Yh),A=!0===h?function(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:oh(i*r)/r||0,y:oh(n*r)/r||0}}({x:p,y:m},th(i)):{x:p,y:m};return p=A.x,m=A.y,l?Object.assign({},M,((T={})[b]=y?"0":"",T[v]=_?"0":"",T.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",T)):Object.assign({},M,((e={})[b]=y?m+"px":"",e[v]=_?p+"px":"",e.transform="",e))}var Kh={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:qh(e.placement),variation:Wh(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Xh(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xh(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var Qh={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];ih(r)&&uh(r)&&(Object.assign(r.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});ih(n)&&uh(n)&&(Object.assign(n.style,s),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};var Jh={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.offset,s=void 0===r?[0,0]:r,o=Fh.reduce((function(t,i){return t[i]=function(t,e,i){var n=qh(t),r=[Ah,Sh].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[Ah,Mh].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,e.rects,s),t}),{}),a=o[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}},tu={left:"right",right:"left",bottom:"top",top:"bottom"};function eu(t){return t.replace(/left|right|bottom|top/g,(function(t){return tu[t]}))}var iu={start:"end",end:"start"};function nu(t){return t.replace(/start|end/g,(function(t){return iu[t]}))}function ru(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&nh(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function su(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ou(t,e,i){return e===Oh?su(function(t,e){var i=th(t),n=dh(t),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=lh();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ph(t),y:l}}(t,i)):eh(e)?function(t,e){var i=ch(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):su(function(t){var e,i=dh(t),n=hh(t),r=null==(e=t.ownerDocument)?void 0:e.body,s=rh(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=rh(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ph(t),l=-n.scrollTop;return"rtl"===fh(r||i).direction&&(a+=rh(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(dh(t)))}function au(t,e,i,n){var r="clippingParents"===e?function(t){var e=bh(yh(t)),i=["absolute","fixed"].indexOf(fh(t).position)>=0&&ih(t)?Eh(t):t;return eh(i)?e.filter((function(t){return eh(t)&&ru(t,i)&&"body"!==uh(t)})):[]}(t):[].concat(e),s=[].concat(r,[i]),o=s[0],a=s.reduce((function(e,i){var r=ou(t,i,n);return e.top=rh(r.top,e.top),e.right=sh(r.right,e.right),e.bottom=sh(r.bottom,e.bottom),e.left=rh(r.left,e.left),e}),ou(t,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function lu(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function cu(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}function hu(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,s=i.strategy,o=void 0===s?t.strategy:s,a=i.boundary,l=void 0===a?Dh:a,c=i.rootBoundary,h=void 0===c?Oh:c,u=i.elementContext,d=void 0===u?Lh:u,p=i.altBoundary,f=void 0!==p&&p,m=i.padding,g=void 0===m?0:m,_=lu("number"!=typeof g?g:cu(g,kh)),y=d===Lh?zh:Lh,v=t.rects.popper,b=t.elements[f?y:d],x=au(eh(b)?b:b.contextElement||dh(t.elements.popper),l,h,o),w=ch(t.elements.reference),E=Zh({reference:w,element:v,strategy:"absolute",placement:r}),S=su(Object.assign({},v,E)),T=d===Lh?S:w,M={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},A=t.modifiersData.offset;if(d===Lh&&A){var C=A[r];Object.keys(M).forEach((function(t){var e=[Mh,Th].indexOf(t)>=0?1:-1,i=[Sh,Th].indexOf(t)>=0?"y":"x";M[t]+=C[i]*e}))}return M}var uu={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,h=i.boundary,u=i.rootBoundary,d=i.altBoundary,p=i.flipVariations,f=void 0===p||p,m=i.allowedAutoPlacements,g=e.options.placement,_=qh(g),y=l||(_===g||!f?[eu(g)]:function(t){if(qh(t)===Ch)return[];var e=eu(t);return[nu(t),e,nu(e)]}(g)),v=[g].concat(y).reduce((function(t,i){return t.concat(qh(i)===Ch?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Fh:l,h=Wh(n),u=h?a?Rh:Rh.filter((function(t){return Wh(t)===h})):kh,d=u.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=u);var p=d.reduce((function(e,i){return e[i]=hu(t,{placement:i,boundary:r,rootBoundary:s,padding:o})[qh(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:i,boundary:h,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:m}):i)}),[]),b=e.rects.reference,x=e.rects.popper,w=new Map,E=!0,S=v[0],T=0;T<v.length;T++){var M=v[T],A=qh(M),C=Wh(M)===Ph,k=[Sh,Th].indexOf(A)>=0,P=k?"width":"height",I=hu(e,{placement:M,boundary:h,rootBoundary:u,altBoundary:d,padding:c}),D=k?C?Mh:Ah:C?Th:Sh;b[P]>x[P]&&(D=eu(D));var O=eu(D),L=[];if(s&&L.push(I[A]<=0),a&&L.push(I[D]<=0,I[O]<=0),L.every((function(t){return t}))){S=M,E=!1;break}w.set(M,L)}if(E)for(var z=function(t){var e=v.find((function(e){var i=w.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return S=e,"break"},R=f?3:1;R>0;R--){if("break"===z(R))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function du(t,e,i){return rh(t,sh(e,i))}var pu={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,u=i.padding,d=i.tether,p=void 0===d||d,f=i.tetherOffset,m=void 0===f?0:f,g=hu(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:h}),_=qh(e.placement),y=Wh(e.placement),v=!y,b=Gh(_),x="x"===b?"y":"x",w=e.modifiersData.popperOffsets,E=e.rects.reference,S=e.rects.popper,T="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,M="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),A=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(w){if(s){var k,P="y"===b?Sh:Ah,I="y"===b?Th:Mh,D="y"===b?"height":"width",O=w[b],L=O+g[P],z=O-g[I],R=p?-S[D]/2:0,F=y===Ph?E[D]:S[D],B=y===Ph?-S[D]:-E[D],N=e.elements.arrow,j=p&&N?_h(N):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=V[P],$=V[I],H=du(0,E[D],j[D]),q=v?E[D]/2-R-H-U-M.mainAxis:F-H-U-M.mainAxis,W=v?-E[D]/2+R+H+$+M.mainAxis:B+H+$+M.mainAxis,G=e.elements.arrow&&Eh(e.elements.arrow),Z=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,Y=null!=(k=null==A?void 0:A[b])?k:0,X=O+W-Y,K=du(p?sh(L,O+q-Y-Z):L,O,p?rh(z,X):z);w[b]=K,C[b]=K-O}if(a){var Q,J="x"===b?Sh:Ah,tt="x"===b?Th:Mh,et=w[x],it="y"===x?"height":"width",nt=et+g[J],rt=et-g[tt],st=-1!==[Sh,Ah].indexOf(_),ot=null!=(Q=null==A?void 0:A[x])?Q:0,at=st?nt:et-E[it]-S[it]-ot+M.altAxis,lt=st?et+E[it]+S[it]-ot-M.altAxis:rt,ct=p&&st?function(t,e,i){var n=du(t,e,i);return n>i?i:n}(at,et,lt):du(p?at:nt,et,p?lt:rt);w[x]=ct,C[x]=ct-et}e.modifiersData[n]=C}},requiresIfExists:["offset"]};var fu={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,r=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=qh(i.placement),l=Gh(a),c=[Ah,Mh].indexOf(a)>=0?"height":"width";if(s&&o){var h=function(t,e){return lu("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:cu(t,kh))}(r.padding,i),u=_h(s),d="y"===l?Sh:Ah,p="y"===l?Th:Mh,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],m=o[l]-i.rects.reference[l],g=Eh(s),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,v=h[d],b=_-u[c]-h[p],x=_/2-u[c]/2+y,w=du(v,x,b),E=l;i.modifiersData[n]=((e={})[E]=w,e.centerOffset=w-x,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&ru(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mu(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function gu(t){return[Sh,Mh,Th,Ah].some((function(e){return t[e]>=0}))}var _u=Uh({defaultModifiers:[Hh,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Zh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},Kh,Qh,Jh,uu,pu,fu,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=hu(e,{elementContext:"reference"}),a=hu(e,{altBoundary:!0}),l=mu(o,n),c=mu(a,r,s),h=gu(l),u=gu(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}}]}),yu="tippy-content",vu="tippy-backdrop",bu="tippy-arrow",xu="tippy-svg-arrow",wu={passive:!0,capture:!0},Eu=function(){return document.body};function Su(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function Tu(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function Mu(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Au(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function Cu(t){return[].concat(t)}function ku(t,e){-1===t.indexOf(e)&&t.push(e)}function Pu(t){return t.split("-")[0]}function Iu(t){return[].slice.call(t)}function Du(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function Ou(){return document.createElement("div")}function Lu(t){return["Element","Fragment"].some((function(e){return Tu(t,e)}))}function zu(t){return Tu(t,"MouseEvent")}function Ru(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function Fu(t){return Lu(t)?[t]:function(t){return Tu(t,"NodeList")}(t)?Iu(t):Array.isArray(t)?t:Iu(document.querySelectorAll(t))}function Bu(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Nu(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function ju(t){var e,i=Cu(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function Vu(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}function Uu(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var $u={isTouch:!1},Hu=0;function qu(){$u.isTouch||($u.isTouch=!0,window.performance&&document.addEventListener("mousemove",Wu))}function Wu(){var t=performance.now();t-Hu<20&&($u.isTouch=!1,document.removeEventListener("mousemove",Wu)),Hu=t}function Gu(){var t=document.activeElement;if(Ru(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var Zu=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Yu={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Xu=Object.assign({appendTo:Eu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Yu,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ku=Object.keys(Xu);function Qu(t){var e=(t.plugins||[]).reduce((function(e,i){var n,r=i.name,s=i.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(n=Xu[r])?n:s);return e}),{});return Object.assign({},t,e)}function Ju(t,e){var i=Object.assign({},e,{content:Mu(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Qu(Object.assign({},Xu,{plugins:e}))):Ku).reduce((function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e}),{})}(t,e.plugins));return i.aria=Object.assign({},Xu.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}var td=function(){return"innerHTML"};function ed(t,e){t[td()]=e}function id(t){var e=Ou();return!0===t?e.className=bu:(e.className=xu,Lu(t)?e.appendChild(t):ed(e,t)),e}function nd(t,e){Lu(e.content)?(ed(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?ed(t,e.content):t.textContent=e.content)}function rd(t){var e=t.firstElementChild,i=Iu(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(yu)})),arrow:i.find((function(t){return t.classList.contains(bu)||t.classList.contains(xu)})),backdrop:i.find((function(t){return t.classList.contains(vu)}))}}function sd(t){var e=Ou(),i=Ou();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Ou();function r(i,n){var r=rd(e),s=r.box,o=r.content,a=r.arrow;n.theme?s.setAttribute("data-theme",n.theme):s.removeAttribute("data-theme"),"string"==typeof n.animation?s.setAttribute("data-animation",n.animation):s.removeAttribute("data-animation"),n.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?s.setAttribute("role",n.role):s.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||nd(o,t.props),n.arrow?a?i.arrow!==n.arrow&&(s.removeChild(a),s.appendChild(id(n.arrow))):s.appendChild(id(n.arrow)):a&&s.removeChild(a)}return n.className=yu,n.setAttribute("data-state","hidden"),nd(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props),{popper:e,onUpdate:r}}sd.$$tippy=!0;var od=1,ad=[],ld=[];function cd(t,e){var i,n,r,s,o,a,l,c,h=Ju(t,Object.assign({},Xu,Qu(Du(e)))),u=!1,d=!1,p=!1,f=!1,m=[],g=Au(G,h.interactiveDebounce),_=od++,y=(c=h.plugins).filter((function(t,e){return c.indexOf(t)===e})),v={id:_,reference:t,popper:Ou(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(r)},setProps:function(e){0;if(v.state.isDestroyed)return;O("onBeforeUpdate",[v,e]),q();var i=v.props,n=Ju(t,Object.assign({},i,Du(e),{ignoreAttributes:!0}));v.props=n,H(),i.interactiveDebounce!==n.interactiveDebounce&&(R(),g=Au(G,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?Cu(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded");z(),D(),w&&w(i,n);v.popperInstance&&(K(),J().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));O("onAfterUpdate",[v,e])},setContent:function(t){v.setProps({content:t})},show:function(){0;var t=v.state.isVisible,e=v.state.isDestroyed,i=!v.state.isEnabled,n=$u.isTouch&&!v.props.touch,r=Su(v.props.duration,0,Xu.duration);if(t||e||i||n)return;if(C().hasAttribute("disabled"))return;if(O("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,A()&&(x.style.visibility="visible");D(),j(),v.state.isMounted||(x.style.transition="none");if(A()){var s=P();Bu([s.box,s.content],0)}a=function(){var t;if(v.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,A()&&v.props.animation){var e=P(),i=e.box,n=e.content;Bu([i,n],r),Nu([i,n],"visible")}L(),z(),ku(ld,v),null==(t=v.popperInstance)||t.forceUpdate(),O("onMount",[v]),v.props.animation&&A()&&function(t,e){U(t,e)}(r,(function(){v.state.isShown=!0,O("onShown",[v])}))}},function(){var t,e=v.props.appendTo,i=C();t=v.props.interactive&&e===Eu||"parent"===e?i.parentNode:Mu(e,[i]);t.contains(x)||t.appendChild(x);v.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!v.state.isVisible,e=v.state.isDestroyed,i=!v.state.isEnabled,n=Su(v.props.duration,1,Xu.duration);if(t||e||i)return;if(O("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,u=!1,A()&&(x.style.visibility="hidden");if(R(),V(),D(!0),A()){var r=P(),s=r.box,o=r.content;v.props.animation&&(Bu([s,o],n),Nu([s,o],"hidden"))}L(),z(),v.props.animation?A()&&function(t,e){U(t,(function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}(n,v.unmount):v.unmount()},hideWithInteractivity:function(t){0;k().addEventListener("mousemove",g),ku(ad,g),g(t)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){0;v.state.isVisible&&v.hide();if(!v.state.isMounted)return;Q(),J().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);ld=ld.filter((function(t){return t!==v})),v.state.isMounted=!1,O("onHidden",[v])},destroy:function(){0;if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),q(),delete t._tippy,v.state.isDestroyed=!0,O("onDestroy",[v])}};if(!h.render)return v;var b=h.render(v),x=b.popper,w=b.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,t._tippy=v,x._tippy=v;var E=y.map((function(t){return t.fn(v)})),S=t.hasAttribute("aria-expanded");return H(),z(),D(),O("onCreate",[v]),h.showOnCreate&&tt(),x.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&k().addEventListener("mousemove",g)})),v;function T(){var t=v.props.touch;return Array.isArray(t)?t:[t,0]}function M(){return"hold"===T()[0]}function A(){var t;return!(null==(t=v.props.render)||!t.$$tippy)}function C(){return l||t}function k(){var t=C().parentNode;return t?ju(t):document}function P(){return rd(x)}function I(t){return v.state.isMounted&&!v.state.isVisible||$u.isTouch||s&&"focus"===s.type?0:Su(v.props.delay,t?0:1,Xu.delay)}function D(t){void 0===t&&(t=!1),x.style.pointerEvents=v.props.interactive&&!t?"":"none",x.style.zIndex=""+v.props.zIndex}function O(t,e,i){var n;(void 0===i&&(i=!0),E.forEach((function(i){i[t]&&i[t].apply(i,e)})),i)&&(n=v.props)[t].apply(n,e)}function L(){var e=v.props.aria;if(e.content){var i="aria-"+e.content,n=x.id;Cu(v.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(i);if(v.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var r=e&&e.replace(n,"").trim();r?t.setAttribute(i,r):t.removeAttribute(i)}}))}}function z(){!S&&v.props.aria.expanded&&Cu(v.props.triggerTarget||t).forEach((function(t){v.props.interactive?t.setAttribute("aria-expanded",v.state.isVisible&&t===C()?"true":"false"):t.removeAttribute("aria-expanded")}))}function R(){k().removeEventListener("mousemove",g),ad=ad.filter((function(t){return t!==g}))}function F(e){if(!$u.isTouch||!p&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!v.props.interactive||!Uu(x,i)){if(Cu(v.props.triggerTarget||t).some((function(t){return Uu(t,i)}))){if($u.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else O("onClickOutside",[v,e]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),d=!0,setTimeout((function(){d=!1})),v.state.isMounted||V())}}}function B(){p=!0}function N(){p=!1}function j(){var t=k();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,wu),t.addEventListener("touchstart",N,wu),t.addEventListener("touchmove",B,wu)}function V(){var t=k();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,wu),t.removeEventListener("touchstart",N,wu),t.removeEventListener("touchmove",B,wu)}function U(t,e){var i=P().box;function n(t){t.target===i&&(Vu(i,"remove",n),e())}if(0===t)return e();Vu(i,"remove",o),Vu(i,"add",n),o=n}function $(e,i,n){void 0===n&&(n=!1),Cu(v.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),m.push({node:t,eventType:e,handler:i,options:n})}))}function H(){var t;M()&&($("touchstart",W,{passive:!0}),$("touchend",Z,{passive:!0})),(t=v.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch($(t,W),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(Zu?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}}))}function q(){m.forEach((function(t){var e=t.node,i=t.eventType,n=t.handler,r=t.options;e.removeEventListener(i,n,r)})),m=[]}function W(t){var e,i=!1;if(v.state.isEnabled&&!X(t)&&!d){var n="focus"===(null==(e=s)?void 0:e.type);s=t,l=t.currentTarget,z(),!v.state.isVisible&&zu(t)&&ad.forEach((function(e){return e(t)})),"click"===t.type&&(v.props.trigger.indexOf("mouseenter")<0||u)&&!1!==v.props.hideOnClick&&v.state.isVisible?i=!0:tt(t),"click"===t.type&&(u=!i),i&&!n&&et(t)}}function G(t){var e=t.target,i=C().contains(e)||x.contains(e);if("mousemove"!==t.type||!i){var n=J().concat(x).map((function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null})).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,s=t.props.interactiveBorder,o=Pu(r.placement),a=r.modifiersData.offset;if(!a)return!0;var l="bottom"===o?a.top.y:0,c="top"===o?a.bottom.y:0,h="right"===o?a.left.x:0,u="left"===o?a.right.x:0,d=e.top-n+l>s,p=n-e.bottom-c>s,f=e.left-i+h>s,m=i-e.right-u>s;return d||p||f||m}))})(n,t)&&(R(),et(t))}}function Z(t){X(t)||v.props.trigger.indexOf("click")>=0&&u||(v.props.interactive?v.hideWithInteractivity(t):et(t))}function Y(t){v.props.trigger.indexOf("focusin")<0&&t.target!==C()||v.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||et(t)}function X(t){return!!$u.isTouch&&M()!==t.type.indexOf("touch")>=0}function K(){Q();var e=v.props,i=e.popperOptions,n=e.placement,r=e.offset,s=e.getReferenceClientRect,o=e.moveTransition,l=A()?rd(x).arrow:null,c=s?{getBoundingClientRect:s,contextElement:s.contextElement||C()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(A()){var i=P().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)})),e.attributes.popper={}}}},u=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},h];A()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==i?void 0:i.modifiers)||[]),v.popperInstance=_u(c,x,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:u}))}function Q(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function J(){return Iu(x.querySelectorAll("[data-tippy-root]"))}function tt(t){v.clearDelayTimeouts(),t&&O("onTrigger",[v,t]),j();var e=I(!0),n=T(),r=n[0],s=n[1];$u.isTouch&&"hold"===r&&s&&(e=s),e?i=setTimeout((function(){v.show()}),e):v.show()}function et(t){if(v.clearDelayTimeouts(),O("onUntrigger",[v,t]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&u)){var e=I(!1);e?n=setTimeout((function(){v.state.isVisible&&v.hide()}),e):r=requestAnimationFrame((function(){v.hide()}))}}else V()}}function hd(t,e){void 0===e&&(e={});var i=Xu.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",qu,wu),window.addEventListener("blur",Gu);var n=Object.assign({},e,{plugins:i}),r=Fu(t).reduce((function(t,e){var i=e&&cd(e,n);return i&&t.push(i),t}),[]);return Lu(t)?r[0]:r}hd.defaultProps=Xu,hd.setDefaultProps=function(t){Object.keys(t).forEach((function(e){Xu[e]=t[e]}))},hd.currentInput=$u;Object.assign({},Qh,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});hd.setDefaultProps({render:sd});var ud=hd;function dd(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var pd={appendTo:document.body,allowHTML:!0,interactive:!0,animation:"scale-subtle",placement:"top-start",offset:[0,8]};var fd=class extends Da{constructor(t,e){super(t,e),s(this,"$button",void 0),s(this,"$content",void 0),s(this,"content",void 0),s(this,"tippy",void 0),this.$button=this.$element.querySelector(".js-tooltip__button"),this.$content=this.$element.querySelector(".js-tooltip__content"),this.content=this.$content.innerHTML}init(){this.tippy=ud(this.$button,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?dd(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):dd(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({content:this.content},pd))}destroy(){this.tippy.destroy()}},md=__webpack_require__(8021),gd=__webpack_require__.n(md)();function _d(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function yd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var vd=new WeakMap,bd=new WeakMap,xd=new WeakMap,wd=new WeakMap,Ed=new WeakMap,Sd=new WeakMap,Td=new WeakMap,Md=new WeakMap;class Ad extends Da{constructor(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,e),yd(this,vd,{writable:!0,value:null}),yd(this,bd,{writable:!0,value:null}),yd(this,xd,{writable:!0,value:!1}),yd(this,wd,{writable:!0,value:null}),yd(this,Ed,{writable:!0,value:null}),yd(this,Sd,{writable:!0,value:[]}),yd(this,Td,{writable:!0,value:[]}),yd(this,Md,{writable:!0,value:{}}),Ra(this,Ed,t),Ra(this,bd,t.querySelector('input:not([type="hidden"])')),Ra(this,Td,t.querySelectorAll('input[type="hidden"]')),Ra(this,Md,i),Ra(this,wd,this._openDatepicker.bind(this))}get instance(){return za(this,vd)}init(){Ra(this,vd,new gd(za(this,bd),function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_d(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_d(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({range:!0,multipleDatesSeparator:" - ",autoclose:!0,onSelect:t=>{var{formattedDate:e}=t,i=new Event("change",{bubbles:!0}),[n="",r=""]=e,[s,o]=za(this,Td);za(this,Td).length&&(s.value=n,o.value=r||n),za(this,bd).dispatchEvent(i),"string"!=typeof za(this,Sd)&&Ra(this,Sd,[n,r]),this.emit("selected",{dates:za(this,Sd),isBtn:za(this,xd)}),Ra(this,xd,!1),Ra(this,Sd,[])}},za(this,Md)))),za(this,Ed).addEventListener("click",za(this,wd))}destroy(){var t;null===(t=za(this,vd))||void 0===t||t.destroy(),za(this,Ed).removeEventListener("click",za(this,wd))}selectDate(t){var{text:e,dates:i}=t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ra(this,xd,arguments.length>2&&void 0!==arguments[2]&&arguments[2]),n)return Ra(this,Sd,""),void za(this,vd).clear();Ra(this,Sd,e),Array.isArray(i)&&i.forEach(((t,e,i)=>{var n,r=e>0&&i.length>1;null===(n=za(this,vd))||void 0===n||n.selectDate(t,{silent:r})}))}_openDatepicker(){var t;null===(t=za(this,vd))||void 0===t||t.show()}}function Cd(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function kd(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Cd(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Cd(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Pd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Id="data-active",Dd=new WeakMap,Od=new WeakMap,Ld=new WeakMap,zd=new WeakMap,Rd=new WeakMap;class Fd extends Da{constructor(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(t,e),Pd(this,Dd,{writable:!0,value:null}),Pd(this,Od,{writable:!0,value:null}),Pd(this,Ld,{writable:!0,value:null}),Pd(this,zd,{writable:!0,value:[]}),Pd(this,Rd,{writable:!0,value:{}}),s(this,"_onSelectDate",(t=>{var{dates:e,isBtn:i=!1}=t;i||za(this,zd).forEach((t=>{var e=t.querySelector("input");e&&e.checked&&(e.checked=!1)})),this.emit("selected",e)})),s(this,"_unchecked",(t=>{var e=t.getAttribute(Id);return e&&(t.checked=!1,t.removeAttribute(Id)),!!e})),s(this,"_onClick",(t=>{var{target:e}=t,i=e.closest("input");if(i){var n,r=this._unchecked(i);if(za(this,Ld)&&this._unchecked(za(this,Ld)),r)null===(n=za(this,Od))||void 0===n||n.selectDate([],!0,!0);else i.setAttribute(Id,"1"),Ra(this,Ld,i)}})),s(this,"_onChange",(t=>{var e,i,{target:n}=t;null===(e=za(this,Od))||void 0===e||e.instance.clear({silent:!0}),null===(i=za(this,Od))||void 0===i||i.selectDate(this._getDates(n.value),!1,!0)})),s(this,"_getDates",(t=>{switch(t){case"tomorrow":var e=new Date;return{text:"Завтра",dates:[new Date(e.setDate(e.getDate()+1))]};case"week":return{text:"На этой неделе",dates:this._getWeekDates()};case"month":return{text:"В этом месяце",dates:this._getMonthDates()};default:return{text:"Сегодня",dates:[new Date]}}})),s(this,"_getWeekDates",(()=>{var t=new Date,e=t.getDate()-t.getDay()+1,i=e+6;return[new Date(t.setDate(e)),new Date(t.setDate(i))]})),s(this,"_getMonthDates",(()=>{var t=new Date;return[new Date(t.getFullYear(),t.getMonth(),1),new Date(t.getFullYear(),t.getMonth()+1,0)]})),Ra(this,Dd,t.querySelector(".js-datepicker-filter")),Ra(this,zd,t.querySelectorAll(".js-filter-button")),Ra(this,Rd,kd(kd({},za(this,Rd)),i))}init(){var t,e;za(this,Dd)&&(Ra(this,Od,new Ad(za(this,Dd),this.ctx,za(this,Rd))),null===(t=za(this,Od))||void 0===t||t.init(),null===(e=za(this,Od))||void 0===e||e.on("selected",this._onSelectDate));za(this,zd).forEach((t=>t.addEventListener("change",this._onChange))),za(this,zd).forEach((t=>t.addEventListener("click",this._onClick)))}destroy(){var t,e;null===(t=za(this,Od))||void 0===t||t.off("selected",this._onSelectDate),null===(e=za(this,Od))||void 0===e||e.destroy(),za(this,zd).forEach((t=>t.removeEventListener("change",this._onChange))),za(this,zd).forEach((t=>t.removeEventListener("click",this._onClick)))}refresh(){var t;null===(t=za(this,Od))||void 0===t||t.instance.clear()}}function Bd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Nd=new WeakMap,jd=new WeakMap,Vd=new WeakMap;function Ud(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}class $d extends Fd{constructor(t,e){super(t,e,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ud(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ud(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({view:"years",minView:"years",dateFormat:"yyyy",range:!1},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),s(this,"_onClick",(()=>{})),s(this,"_onSelectDate",(()=>{})),s(this,"_onChange",(()=>{}))}}var Hd="_active";class qd extends Da{constructor(t,e){super(t,e),s(this,"openButton",null),s(this,"closeButton",null),s(this,"apply",null),s(this,"popup",null),s(this,"isOpen",!1),s(this,"open",(()=>{this.isOpen=!0,this.ctx.plugins.lenis.stop(),this.popup.classList.add(Hd)})),s(this,"close",(()=>{this.isOpen=!1,this.ctx.plugins.lenis.start(),this.popup.classList.remove(Hd)})),s(this,"_onResize",(()=>{!this.ctx.plugins.responsive.tablet&&this.isOpen&&this.close()})),this.openButton=t;var i=this.openButton.getAttribute("data-target");this.popup=document.querySelector(i)}init(){this.popup&&(this.closeButton=this.popup.querySelector(".js-filter-close"),this.apply=this.popup.querySelector(".js-filter-apply"),this.openButton.addEventListener("click",this.open),this.apply.addEventListener("click",this.close),this.closeButton.addEventListener("click",this.close),this.ctx.on("resize:debounce",this._onResize))}destroy(){this.ctx.off("resize:debounce",this._onResize),this.openButton.removeEventListener("click",this.open),this.apply.removeEventListener("click",this.close),this.closeButton.removeEventListener("click",this.close)}}function Wd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Gd=new WeakMap,Zd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Kd=new WeakMap;function Qd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Jd=new WeakMap,tp=new WeakMap,ep=new WeakMap;__webpack_require__(69),__webpack_require__(8917),__webpack_require__(5156);function ip(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var np=new WeakMap,rp=new WeakMap,sp=new WeakMap,op=new WeakMap,ap=new WeakMap,lp=new WeakMap,cp=new WeakMap,hp=new WeakMap,up=new WeakMap,dp=new WeakMap,pp=new WeakMap,fp=new WeakMap,mp=new WeakMap,gp=new WeakMap,_p=new WeakMap;var yp=class extends Da{constructor(t,e){super(t,e),ip(this,np,{writable:!0,value:void 0}),ip(this,rp,{writable:!0,value:void 0}),ip(this,sp,{writable:!0,value:void 0}),ip(this,op,{writable:!0,value:void 0}),ip(this,ap,{writable:!0,value:void 0}),ip(this,lp,{writable:!0,value:void 0}),ip(this,cp,{writable:!0,value:void 0}),ip(this,hp,{writable:!0,value:void 0}),ip(this,up,{writable:!0,value:void 0}),ip(this,dp,{writable:!0,value:void 0}),ip(this,pp,{writable:!0,value:void 0}),ip(this,fp,{writable:!0,value:void 0}),ip(this,mp,{writable:!0,value:void 0}),ip(this,gp,{writable:!0,value:void 0}),ip(this,_p,{writable:!0,value:void 0}),s(this,"onResize",(()=>{this.$element.style.setProperty("--slider-header-height","".concat(.1*za(this,cp).offsetHeight,"rem"))})),s(this,"headerMilestoneChangeHandler",(t=>{var{realIndex:e}=t;za(this,hp)&&(za(this,up).forEach(((t,i)=>{t.classList.toggle("_active",i===e),t.classList.toggle("_caption-hidden",i===e&&"0%"===t.style.left||i===e&&"100%"===t.style.left)})),za(this,pp).classList.toggle("_active",za(this,up)[0].classList.contains("_caption-hidden")),za(this,fp).classList.toggle("_active",za(this,up)[za(this,up).length-1].classList.contains("_caption-hidden")))})),s(this,"footerMilestoneChangeHandler",(t=>{var{realIndex:e}=t;za(this,up).forEach(((t,i)=>{t.classList.toggle("_active",e===i)}))})),Ra(this,np,t.querySelector(".swiper")),Ra(this,sp,t.querySelector(".js-slider-prev")),Ra(this,op,t.querySelector(".js-slider-next")),Ra(this,ap,t.querySelector(".js-pagination-top")),Ra(this,lp,t.querySelector(".js-pagination-bottom")),Ra(this,cp,t.querySelector(".js-header")),Ra(this,hp,t.querySelector(".js-header-timeline")),Ra(this,dp,t.querySelector(".js-footer-timeline")),Ra(this,up,Array.from(t.querySelectorAll(".js-milestone"))),Ra(this,pp,this.$element.querySelector(".js-timeline-start")),Ra(this,fp,this.$element.querySelector(".js-timeline-end"))}init(){var t=za(this,hp)||za(this,dp);Ra(this,_p,this.$element.querySelector("._vertical")),this.onResize(),window.addEventListener("resize",this.onResize),za(this,_p)&&this.initSliderTimeline(),Ra(this,rp,new Bc(za(this,np),{modules:[jc,Uc,Gc,$c,Hc],loop:!t,autoplay:{enabled:!t,delay:5e3},pagination:{el:this.ctx.plugins.responsive.tablet?za(this,lp):za(this,ap)},effect:"fade",fadeEffect:{crossFade:!0},navigation:{prevEl:za(this,sp),nextEl:za(this,op)},speed:t?700:300,thumbs:{swiper:za(this,mp)}})),za(this,hp)&&this.initHeaderTimeline(),za(this,dp)&&this.initFooterTimeline()}initSliderTimeline(){Ra(this,mp,new Bc(za(this,_p),{breakpoints:{0:{spaceBetween:42.2},768:{spaceBetween:123},1023:{spaceBetween:99}},slidesPerView:"auto"}))}initHeaderTimeline(){var t=parseInt(za(this,pp).innerText),e=parseInt(za(this,fp).innerText);za(this,up).forEach((i=>{var n=parseInt(i.innerText),r=i.offsetWidth/2*-1,s=100*(n-t)/(e-t);k.ZP.set(i,{left:s+"%",x:r})})),this.headerMilestoneChangeHandler({realIndex:0}),this.initHeaderMilestonesChangeHandler()}initFooterTimeline(){za(this,rp).on("slideChange",this.footerMilestoneChangeHandler)}initHeaderMilestonesChangeHandler(){za(this,rp).on("slideChange",this.headerMilestoneChangeHandler)}destroy(){window.removeEventListener("resize",this.onResize)}},vp=Object.defineProperty,bp=(t,e,i)=>(((t,e,i)=>{e in t?vp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i})(t,"symbol"!=typeof e?e+"":e,i),i);const xp=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,wp=/^-?[0-9]\d*$/,Ep=/^(?=.*[A-Za-z])(?=.*\d).{8,}$/,Sp=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,Tp=t=>"string"!=typeof t||""===t;var Mp=(t=>(t.Required="required",t.Email="email",t.MinLength="minLength",t.MaxLength="maxLength",t.Password="password",t.Number="number",t.Integer="integer",t.MaxNumber="maxNumber",t.MinNumber="minNumber",t.StrongPassword="strongPassword",t.CustomRegexp="customRegexp",t.MinFilesCount="minFilesCount",t.MaxFilesCount="maxFilesCount",t.Files="files",t))(Mp||{}),Ap=(t=>(t.Required="required",t))(Ap||{}),Cp=(t=>(t.Label="label",t.LabelArrow="labelArrow",t))(Cp||{});const kp=[{key:Mp.Required,dict:{en:"The field is required"}},{key:Mp.Email,dict:{en:"Email has invalid format"}},{key:Mp.MaxLength,dict:{en:"The field must contain a maximum of :value characters"}},{key:Mp.MinLength,dict:{en:"The field must contain a minimum of :value characters"}},{key:Mp.Password,dict:{en:"Password must contain minimum eight characters, at least one letter and one number"}},{key:Mp.StrongPassword,dict:{en:"Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character"}},{key:Mp.Number,dict:{en:"Value should be a number"}},{key:Mp.MaxNumber,dict:{en:"Number should be less or equal than :value"}},{key:Mp.MinNumber,dict:{en:"Number should be more or equal than :value"}},{key:Mp.MinFilesCount,dict:{en:"Files count should be more or equal than :value"}},{key:Mp.MaxFilesCount,dict:{en:"Files count should be less or equal than :value"}},{key:Mp.Files,dict:{en:"Uploaded files have one or several invalid properties (extension/size/type etc)."}}],Pp=t=>"object"==typeof t&&null!==t&&"then"in t&&"function"==typeof t.then,Ip=t=>Array.isArray(t)?t.filter((t=>t.length>0)):"string"==typeof t&&t.trim()?[...t.split(" ").filter((t=>t.length>0))]:[],Dp=t=>t instanceof Element||t instanceof HTMLDocument,Op={errorFieldStyle:{color:"#b81111",border:"1px solid #B81111"},errorFieldCssClass:"just-validate-error-field",successFieldCssClass:"just-validate-success-field",errorLabelStyle:{color:"#b81111"},errorLabelCssClass:"just-validate-error-label",successLabelCssClass:"just-validate-success-label",focusInvalidField:!0,lockForm:!0,testingMode:!1,validateBeforeSubmitting:!1,submitFormAutomatically:!1};class Lp{constructor(t,e,i){bp(this,"form",null),bp(this,"fields",{}),bp(this,"groupFields",{}),bp(this,"errors",{}),bp(this,"isValid",!1),bp(this,"isSubmitted",!1),bp(this,"globalConfig",Op),bp(this,"errorLabels",{}),bp(this,"successLabels",{}),bp(this,"eventListeners",[]),bp(this,"dictLocale",kp),bp(this,"currentLocale","en"),bp(this,"customStyleTags",{}),bp(this,"onSuccessCallback"),bp(this,"onFailCallback"),bp(this,"onValidateCallback"),bp(this,"tooltips",[]),bp(this,"lastScrollPosition"),bp(this,"isScrollTick"),bp(this,"fieldIds",new Map),bp(this,"getKeyByFieldSelector",(t=>this.fieldIds.get(t))),bp(this,"getFieldSelectorByKey",(t=>{for(const[e,i]of this.fieldIds)if(t===i)return e})),bp(this,"getCompatibleFields",(()=>{const t={};return Object.keys(this.fields).forEach((e=>{let i=e;const n=this.getFieldSelectorByKey(e);"string"==typeof n&&(i=n),t[i]={...this.fields[e]}})),t})),bp(this,"setKeyByFieldSelector",(t=>{if(this.fieldIds.has(t))return this.fieldIds.get(t);const e=String(this.fieldIds.size+1);return this.fieldIds.set(t,e),e})),bp(this,"refreshAllTooltips",(()=>{this.tooltips.forEach((t=>{t.refresh()}))})),bp(this,"handleDocumentScroll",(()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame((()=>{this.refreshAllTooltips(),this.isScrollTick=!1})),this.isScrollTick=!0)})),bp(this,"formSubmitHandler",(t=>{t.preventDefault(),this.isSubmitted=!0,this.validateHandler(t)})),bp(this,"handleFieldChange",(t=>{let e;for(const i in this.fields){if(this.fields[i].elem===t){e=i;break}}e&&(this.fields[e].touched=!0,this.validateField(e,!0))})),bp(this,"handleGroupChange",(t=>{let e;for(const i in this.groupFields){if(this.groupFields[i].elems.find((e=>e===t))){e=i;break}}e&&(this.groupFields[e].touched=!0,this.validateGroup(e,!0))})),bp(this,"handlerChange",(t=>{t.target&&(this.handleFieldChange(t.target),this.handleGroupChange(t.target),this.renderErrors())})),this.initialize(t,e,i)}initialize(t,e,i){if(this.form=null,this.errors={},this.isValid=!1,this.isSubmitted=!1,this.globalConfig=Op,this.errorLabels={},this.successLabels={},this.eventListeners=[],this.customStyleTags={},this.tooltips=[],this.currentLocale="en","string"==typeof t){const e=document.querySelector(t);if(!e)throw Error(`Form with ${t} selector not found! Please check the form selector`);this.setForm(e)}else{if(!(t instanceof HTMLFormElement))throw Error("Form selector is not valid. Please specify a string selector or a DOM element.");this.setForm(t)}if(this.globalConfig={...Op,...e},i&&(this.dictLocale=[...i,...kp]),this.isTooltip()){const t=document.createElement("style");t.textContent=".just-validate-error-label[data-tooltip=true]{position:fixed;padding:4px 8px;background:#423f3f;color:#fff;white-space:nowrap;z-index:10;border-radius:4px;transform:translateY(-5px)}.just-validate-error-label[data-tooltip=true]:before{content:'';width:0;height:0;border-left:solid 5px transparent;border-right:solid 5px transparent;border-bottom:solid 5px #423f3f;position:absolute;z-index:3;display:block;bottom:-5px;transform:rotate(180deg);left:calc(50% - 5px)}.just-validate-error-label[data-tooltip=true][data-direction=left]{transform:translateX(-5px)}.just-validate-error-label[data-tooltip=true][data-direction=left]:before{right:-7px;bottom:auto;left:auto;top:calc(50% - 2px);transform:rotate(90deg)}.just-validate-error-label[data-tooltip=true][data-direction=right]{transform:translateX(5px)}.just-validate-error-label[data-tooltip=true][data-direction=right]:before{right:auto;bottom:auto;left:-7px;top:calc(50% - 2px);transform:rotate(-90deg)}.just-validate-error-label[data-tooltip=true][data-direction=bottom]{transform:translateY(5px)}.just-validate-error-label[data-tooltip=true][data-direction=bottom]:before{right:auto;bottom:auto;left:calc(50% - 5px);top:-5px;transform:rotate(0)}",this.customStyleTags[Cp.Label]=document.head.appendChild(t),this.addListener("scroll",document,this.handleDocumentScroll)}}getLocalisedString(t,e,i){var n;const r=null!=i?i:t;let s=null==(n=this.dictLocale.find((t=>t.key===r)))?void 0:n.dict[this.currentLocale];if(s||i&&(s=i),s&&void 0!==e)switch(t){case Mp.MaxLength:case Mp.MinLength:case Mp.MaxNumber:case Mp.MinNumber:case Mp.MinFilesCount:case Mp.MaxFilesCount:s=s.replace(":value",String(e))}return s||i||"Value is incorrect"}getFieldErrorMessage(t,e){const i="function"==typeof t.errorMessage?t.errorMessage(this.getElemValue(e),this.fields):t.errorMessage;return this.getLocalisedString(t.rule,t.value,i)}getFieldSuccessMessage(t,e){const i="function"==typeof t?t(this.getElemValue(e),this.fields):t;return this.getLocalisedString(void 0,void 0,i)}getGroupErrorMessage(t){return this.getLocalisedString(t.rule,void 0,t.errorMessage)}getGroupSuccessMessage(t){if(t.successMessage)return this.getLocalisedString(void 0,void 0,t.successMessage)}setFieldInvalid(t,e){this.fields[t].isValid=!1,this.fields[t].errorMessage=this.getFieldErrorMessage(e,this.fields[t].elem)}setFieldValid(t,e){this.fields[t].isValid=!0,void 0!==e&&(this.fields[t].successMessage=this.getFieldSuccessMessage(e,this.fields[t].elem))}setGroupInvalid(t,e){this.groupFields[t].isValid=!1,this.groupFields[t].errorMessage=this.getGroupErrorMessage(e)}setGroupValid(t,e){this.groupFields[t].isValid=!0,this.groupFields[t].successMessage=this.getGroupSuccessMessage(e)}getElemValue(t){switch(t.type){case"checkbox":return t.checked;case"file":return t.files;default:return t.value}}validateGroupRule(t,e,i){if(i.rule===Ap.Required)e.every((t=>!t.checked))?this.setGroupInvalid(t,i):this.setGroupValid(t,i)}validateFieldRule(t,e,i,n=!1){const r=i.value,s=this.getElemValue(e);if(i.plugin){i.plugin(s,this.getCompatibleFields())||this.setFieldInvalid(t,i)}else{switch(i.rule){case Mp.Required:(t=>{let e=t;return"string"==typeof t&&(e=t.trim()),!e})(s)&&this.setFieldInvalid(t,i);break;case Mp.Email:if(Tp(s))break;o=s,xp.test(o)||this.setFieldInvalid(t,i);break;case Mp.MaxLength:if(void 0===r){console.error(`Value for ${i.rule} rule for [${t}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if("number"!=typeof r){console.error(`Value for ${i.rule} rule for [${t}] should be a number. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if(Tp(s))break;((t,e)=>t.length>e)(s,r)&&this.setFieldInvalid(t,i);break;case Mp.MinLength:if(void 0===r){console.error(`Value for ${i.rule} rule for [${t}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if("number"!=typeof r){console.error(`Value for ${i.rule} rule for [${t}] should be a number. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if(Tp(s))break;((t,e)=>t.length<e)(s,r)&&this.setFieldInvalid(t,i);break;case Mp.Password:if(Tp(s))break;(t=>Ep.test(t))(s)||this.setFieldInvalid(t,i);break;case Mp.StrongPassword:if(Tp(s))break;(t=>Sp.test(t))(s)||this.setFieldInvalid(t,i);break;case Mp.Number:if(Tp(s))break;(t=>"string"==typeof t&&!isNaN(+t)&&!isNaN(parseFloat(t)))(s)||this.setFieldInvalid(t,i);break;case Mp.Integer:if(Tp(s))break;(t=>wp.test(t))(s)||this.setFieldInvalid(t,i);break;case Mp.MaxNumber:{if(void 0===r){console.error(`Value for ${i.rule} rule for [${t}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if("number"!=typeof r){console.error(`Value for ${i.rule} rule for [${t}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if(Tp(s))break;const e=+s;(Number.isNaN(e)||((t,e)=>t>e)(e,r))&&this.setFieldInvalid(t,i);break}case Mp.MinNumber:{if(void 0===r){console.error(`Value for ${i.rule} rule for [${t}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if("number"!=typeof r){console.error(`Value for ${i.rule} rule for [${t}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if(Tp(s))break;const e=+s;(Number.isNaN(e)||((t,e)=>t<e)(e,r))&&this.setFieldInvalid(t,i);break}case Mp.CustomRegexp:{if(void 0===r)return console.error(`Value for ${i.rule} rule for [${t}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(t,i);let e;try{e=new RegExp(r)}catch(e){console.error(`Value for ${i.rule} rule for [${t}] should be a valid regexp. This field will be always invalid.`),this.setFieldInvalid(t,i);break}const n=String(s);""===n||e.test(n)||this.setFieldInvalid(t,i);break}case Mp.MinFilesCount:if(void 0===r){console.error(`Value for ${i.rule} rule for [${t}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(t,i);break}if("number"!=typeof r){console.error(`Value for ${i.rule} rule for [${t}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if(Number.isFinite(null==s?void 0:s.length)&&s.length<r){this.setFieldInvalid(t,i);break}break;case Mp.MaxFilesCount:if(void 0===r){console.error(`Value for ${i.rule} rule for [${t}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(t,i);break}if("number"!=typeof r){console.error(`Value for ${i.rule} rule for [${t}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(t,i);break}if(Number.isFinite(null==s?void 0:s.length)&&s.length>r){this.setFieldInvalid(t,i);break}break;case Mp.Files:{if(void 0===r)return console.error(`Value for ${i.rule} rule for [${t}] field is not defined. This field will be always invalid.`),void this.setFieldInvalid(t,i);if("object"!=typeof r)return console.error(`Value for ${i.rule} rule for [${t}] field should be an object. This field will be always invalid.`),void this.setFieldInvalid(t,i);const e=r.files;if("object"!=typeof e)return console.error(`Value for ${i.rule} rule for [${t}] field should be an object with files array. This field will be always invalid.`),void this.setFieldInvalid(t,i);const n=(t,e)=>{const i=Number.isFinite(e.minSize)&&t.size<e.minSize,n=Number.isFinite(e.maxSize)&&t.size>e.maxSize,r=Array.isArray(e.names)&&!e.names.includes(t.name),s=Array.isArray(e.extensions)&&!e.extensions.includes(t.name.split(".")[t.name.split(".").length-1]),o=Array.isArray(e.types)&&!e.types.includes(t.type);return i||n||r||s||o};if("object"==typeof s&&null!==s)for(let r=0,o=s.length;r<o;++r){const o=s.item(r);if(!o){this.setFieldInvalid(t,i);break}if(n(o,e)){this.setFieldInvalid(t,i);break}}break}default:{if("function"!=typeof i.validator)return console.error(`Validator for custom rule for [${t}] field should be a function. This field will be always invalid.`),void this.setFieldInvalid(t,i);const e=i.validator(s,this.getCompatibleFields());if("boolean"!=typeof e&&"function"!=typeof e&&console.error(`Validator return value for [${t}] field should be boolean or function. It will be cast to boolean.`),"function"==typeof e){if(!n){this.fields[t].asyncCheckPending=!1;const n=e();return Pp(n)?n.then((e=>{e||this.setFieldInvalid(t,i)})).catch((()=>{this.setFieldInvalid(t,i)})):(console.error(`Validator function for custom rule for [${t}] field should return a Promise. This field will be always invalid.`),void this.setFieldInvalid(t,i))}this.fields[t].asyncCheckPending=!0}e||this.setFieldInvalid(t,i)}}var o}}isFormValid(){let t=!0;for(let e=0,i=Object.values(this.fields).length;e<i;++e){const i=Object.values(this.fields)[e];if(void 0===i.isValid){t=void 0;break}if(!1===i.isValid){t=!1;break}}for(let e=0,i=Object.values(this.groupFields).length;e<i;++e){const i=Object.values(this.groupFields)[e];if(void 0===i.isValid){t=void 0;break}if(!1===i.isValid){t=!1;break}}return t}validateField(t,e=!1){var i;const n=this.fields[t];n.isValid=!0;const r=[];return[...n.rules].reverse().forEach((i=>{const s=this.validateFieldRule(t,n.elem,i,e);Pp(s)&&r.push(s)})),n.isValid&&this.setFieldValid(t,null==(i=n.config)?void 0:i.successMessage),Promise.allSettled(r).finally((()=>{var t;e&&(null==(t=this.onValidateCallback)||t.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}))}))}revalidateField(t){if("string"!=typeof t&&!Dp(t))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");const e=this.getKeyByFieldSelector(t);return e&&this.fields[e]?new Promise((t=>{this.validateField(e,!0).finally((()=>{this.clearFieldStyle(e),this.clearFieldLabel(e),this.renderFieldError(e,!0),t(!!this.fields[e].isValid)}))})):(console.error("Field not found. Check the field selector."),Promise.reject())}revalidateGroup(t){if("string"!=typeof t&&!Dp(t))throw Error("Group selector is not valid. Please specify a string selector or a valid DOM element.");const e=this.getKeyByFieldSelector(t);return e&&this.groupFields[e]?new Promise((t=>{this.validateGroup(e).finally((()=>{this.clearFieldLabel(e),this.renderGroupError(e,!0),t(!!this.groupFields[e].isValid)}))})):(console.error("Group not found. Check the group selector."),Promise.reject())}validateGroup(t,e=!1){const i=this.groupFields[t],n=[];return[...i.rules].reverse().forEach((e=>{const r=this.validateGroupRule(t,i.elems,e);Pp(r)&&n.push(r)})),Promise.allSettled(n).finally((()=>{var t;e&&(null==(t=this.onValidateCallback)||t.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}))}))}focusInvalidField(){for(const t in this.fields){const e=this.fields[t];if(!e.isValid){setTimeout((()=>e.elem.focus()),0);break}}}afterSubmitValidation(t=!1){this.renderErrors(t),this.globalConfig.focusInvalidField&&this.focusInvalidField()}validate(t=!1){return new Promise((e=>{const i=[];Object.keys(this.fields).forEach((t=>{const e=this.validateField(t);Pp(e)&&i.push(e)})),Object.keys(this.groupFields).forEach((t=>{const e=this.validateGroup(t);Pp(e)&&i.push(e)})),Promise.allSettled(i).then((()=>{var n;this.afterSubmitValidation(t),null==(n=this.onValidateCallback)||n.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}),e(!!i.length)}))}))}revalidate(){return new Promise((t=>{this.validateHandler(void 0,!0).finally((()=>{this.globalConfig.focusInvalidField&&this.focusInvalidField(),t(this.isValid)}))}))}validateHandler(t,e=!1){return this.globalConfig.lockForm&&this.lockForm(),this.validate(e).finally((()=>{var e,i,n;this.globalConfig.lockForm&&this.unlockForm(),this.isValid?(null==(e=this.onSuccessCallback)||e.call(this,t),this.globalConfig.submitFormAutomatically&&(null==(i=null==t?void 0:t.currentTarget)||i.submit())):null==(n=this.onFailCallback)||n.call(this,this.getCompatibleFields(),this.groupFields)}))}setForm(t){this.form=t,this.form.setAttribute("novalidate","novalidate"),this.removeListener("submit",this.form,this.formSubmitHandler),this.addListener("submit",this.form,this.formSubmitHandler)}addListener(t,e,i){e.addEventListener(t,i),this.eventListeners.push({type:t,elem:e,func:i})}removeListener(t,e,i){e.removeEventListener(t,i),this.eventListeners=this.eventListeners.filter((i=>i.type!==t||i.elem!==e))}addField(t,e,i){if("string"!=typeof t&&!Dp(t))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");let n;if(n="string"==typeof t?this.form.querySelector(t):t,!n)throw Error("Field doesn't exist in the DOM! Please check the field selector.");if(!Array.isArray(e)||!e.length)throw Error("Rules argument should be an array and should contain at least 1 element.");e.forEach((t=>{if(!("rule"in t||"validator"in t||"plugin"in t))throw Error("Rules argument must contain at least one rule or validator property.");if(!(t.validator||t.plugin||t.rule&&Object.values(Mp).includes(t.rule)))throw Error(`Rule should be one of these types: ${Object.values(Mp).join(", ")}. Provided value: ${t.rule}`)}));const r=this.setKeyByFieldSelector(t);return this.fields[r]={elem:n,rules:e,isValid:void 0,touched:!1,config:i},this.setListeners(n),(this.isSubmitted||this.globalConfig.validateBeforeSubmitting)&&this.validateField(r),this}removeField(t){if("string"!=typeof t&&!Dp(t))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");const e=this.getKeyByFieldSelector(t);if(!e||!this.fields[e])return console.error("Field not found. Check the field selector."),this;const i=this.getListenerType(this.fields[e].elem.type);return this.removeListener(i,this.fields[e].elem,this.handlerChange),this.clearErrors(),delete this.fields[e],this}removeGroup(t){if("string"!=typeof t)throw Error("Group selector is not valid. Please specify a string selector.");const e=this.getKeyByFieldSelector(t);return e&&this.groupFields[e]?(this.groupFields[e].elems.forEach((t=>{const e=this.getListenerType(t.type);this.removeListener(e,t,this.handlerChange)})),this.clearErrors(),delete this.groupFields[e],this):(console.error("Group not found. Check the group selector."),this)}addRequiredGroup(t,e,i,n){if("string"!=typeof t&&!Dp(t))throw Error("Group selector is not valid. Please specify a string selector or a valid DOM element.");let r;if(r="string"==typeof t?this.form.querySelector(t):t,!r)throw Error("Group selector not found! Please check the group selector.");const s=r.querySelectorAll("input"),o=Array.from(s).filter((t=>{const e=((t,e)=>{const i=[...e].reverse();for(let e=0,n=i.length;e<n;++e){const n=i[e];for(const e in t){const i=t[e];if(i.groupElem===n)return[e,i]}}return null})(this.groupFields,(t=>{let e=t;const i=[];for(;e;)i.unshift(e),e=e.parentNode;return i})(t));return!e||e[1].elems.find((e=>e!==t))})),a=this.setKeyByFieldSelector(t);return this.groupFields[a]={rules:[{rule:Ap.Required,errorMessage:e,successMessage:n}],groupElem:r,elems:o,touched:!1,isValid:void 0,config:i},s.forEach((t=>{this.setListeners(t)})),this}getListenerType(t){switch(t){case"checkbox":case"select-one":case"file":case"radio":return"change";default:return"input"}}setListeners(t){const e=this.getListenerType(t.type);this.removeListener(e,t,this.handlerChange),this.addListener(e,t,this.handlerChange)}clearFieldLabel(t){var e,i;null==(e=this.errorLabels[t])||e.remove(),null==(i=this.successLabels[t])||i.remove()}clearFieldStyle(t){var e,i,n,r;const s=this.fields[t],o=(null==(e=s.config)?void 0:e.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(o).forEach((t=>{s.elem.style[t]=""}));const a=(null==(i=s.config)?void 0:i.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(a).forEach((t=>{s.elem.style[t]=""})),s.elem.classList.remove(...Ip((null==(n=s.config)?void 0:n.errorFieldCssClass)||this.globalConfig.errorFieldCssClass),...Ip((null==(r=s.config)?void 0:r.successFieldCssClass)||this.globalConfig.successFieldCssClass))}clearErrors(){var t,e;Object.keys(this.errorLabels).forEach((t=>this.errorLabels[t].remove())),Object.keys(this.successLabels).forEach((t=>this.successLabels[t].remove()));for(const t in this.fields)this.clearFieldStyle(t);for(const i in this.groupFields){const n=this.groupFields[i],r=(null==(t=n.config)?void 0:t.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(r).forEach((t=>{n.elems.forEach((e=>{var i;e.style[t]="",e.classList.remove(...Ip((null==(i=n.config)?void 0:i.errorFieldCssClass)||this.globalConfig.errorFieldCssClass))}))}));const s=(null==(e=n.config)?void 0:e.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(s).forEach((t=>{n.elems.forEach((e=>{var i;e.style[t]="",e.classList.remove(...Ip((null==(i=n.config)?void 0:i.successFieldCssClass)||this.globalConfig.successFieldCssClass))}))}))}this.tooltips=[]}isTooltip(){return!!this.globalConfig.tooltip}lockForm(){const t=this.form.querySelectorAll("input, textarea, button, select");for(let e=0,i=t.length;e<i;++e)t[e].setAttribute("data-just-validate-fallback-disabled",t[e].disabled?"true":"false"),t[e].setAttribute("disabled","disabled"),t[e].style.pointerEvents="none",t[e].style.webkitFilter="grayscale(100%)",t[e].style.filter="grayscale(100%)"}unlockForm(){const t=this.form.querySelectorAll("input, textarea, button, select");for(let e=0,i=t.length;e<i;++e)"true"!==t[e].getAttribute("data-just-validate-fallback-disabled")&&t[e].removeAttribute("disabled"),t[e].style.pointerEvents="",t[e].style.webkitFilter="",t[e].style.filter=""}renderTooltip(t,e,i){var n;const{top:r,left:s,width:o,height:a}=t.getBoundingClientRect(),l=e.getBoundingClientRect(),c=i||(null==(n=this.globalConfig.tooltip)?void 0:n.position);switch(c){case"left":e.style.top=r+a/2-l.height/2+"px",e.style.left=s-l.width-5+"px";break;case"top":e.style.top=r-l.height-5+"px",e.style.left=s+o/2-l.width/2+"px";break;case"right":e.style.top=r+a/2-l.height/2+"px",e.style.left=`${s+o+5}px`;break;case"bottom":e.style.top=`${r+a+5}px`,e.style.left=s+o/2-l.width/2+"px"}e.dataset.direction=c;return{refresh:()=>{this.renderTooltip(t,e,i)}}}createErrorLabelElem(t,e,i){const n=document.createElement("div");n.innerHTML=e;const r=this.isTooltip()?null==i?void 0:i.errorLabelStyle:(null==i?void 0:i.errorLabelStyle)||this.globalConfig.errorLabelStyle;return Object.assign(n.style,r),n.classList.add(...Ip((null==i?void 0:i.errorLabelCssClass)||this.globalConfig.errorLabelCssClass),"just-validate-error-label"),this.isTooltip()&&(n.dataset.tooltip="true"),this.globalConfig.testingMode&&(n.dataset.testId=`error-label-${t}`),this.errorLabels[t]=n,n}createSuccessLabelElem(t,e,i){if(void 0===e)return null;const n=document.createElement("div");n.innerHTML=e;const r=(null==i?void 0:i.successLabelStyle)||this.globalConfig.successLabelStyle;return Object.assign(n.style,r),n.classList.add(...Ip((null==i?void 0:i.successLabelCssClass)||this.globalConfig.successLabelCssClass),"just-validate-success-label"),this.globalConfig.testingMode&&(n.dataset.testId=`success-label-${t}`),this.successLabels[t]=n,n}renderErrorsContainer(t,e){const i=e||this.globalConfig.errorsContainer;if("string"==typeof i){const e=this.form.querySelector(i);if(e)return e.appendChild(t),!0;console.error(`Error container with ${i} selector not found. Errors will be rendered as usual`)}return i instanceof Element?(i.appendChild(t),!0):(void 0!==i&&console.error("Error container not found. It should be a string or existing Element. Errors will be rendered as usual"),!1)}renderGroupLabel(t,e,i,n){if(!n){if(this.renderErrorsContainer(e,i))return}t.appendChild(e)}renderFieldLabel(t,e,i,n){var r,s,o,a,l,c,h;if(!n){if(this.renderErrorsContainer(e,i))return}if("checkbox"===t.type||"radio"===t.type){const i=document.querySelector(`label[for="${t.getAttribute("id")}"]`);"label"===(null==(s=null==(r=t.parentElement)?void 0:r.tagName)?void 0:s.toLowerCase())?null==(a=null==(o=t.parentElement)?void 0:o.parentElement)||a.appendChild(e):i?null==(l=i.parentElement)||l.appendChild(e):null==(c=t.parentElement)||c.appendChild(e)}else null==(h=t.parentElement)||h.appendChild(e)}showLabels(t,e){Object.keys(t).forEach(((i,n)=>{const r=t[i],s=this.getKeyByFieldSelector(i);if(!s||!this.fields[s])return void console.error("Field not found. Check the field selector.");const o=this.fields[s];o.isValid=!e,this.clearFieldStyle(s),this.clearFieldLabel(s),this.renderFieldError(s,!1,r),0===n&&this.globalConfig.focusInvalidField&&setTimeout((()=>o.elem.focus()),0)}))}showErrors(t){if("object"!=typeof t)throw Error("[showErrors]: Errors should be an object with key: value format");this.showLabels(t,!0)}showSuccessLabels(t){if("object"!=typeof t)throw Error("[showSuccessLabels]: Labels should be an object with key: value format");this.showLabels(t,!1)}renderFieldError(t,e=!1,i){var n,r,s,o,a,l;const c=this.fields[t];if(!1===c.isValid&&(this.isValid=!1),void 0===c.isValid||!e&&!this.isSubmitted&&!c.touched&&void 0===i)return;if(c.isValid){if(!c.asyncCheckPending){const e=this.createSuccessLabelElem(t,void 0!==i?i:c.successMessage,c.config);e&&this.renderFieldLabel(c.elem,e,null==(n=c.config)?void 0:n.errorsContainer,!0),c.elem.classList.add(...Ip((null==(r=c.config)?void 0:r.successFieldCssClass)||this.globalConfig.successFieldCssClass))}return}c.elem.classList.add(...Ip((null==(s=c.config)?void 0:s.errorFieldCssClass)||this.globalConfig.errorFieldCssClass));const h=this.createErrorLabelElem(t,void 0!==i?i:c.errorMessage,c.config);this.renderFieldLabel(c.elem,h,null==(o=c.config)?void 0:o.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(c.elem,h,null==(l=null==(a=c.config)?void 0:a.tooltip)?void 0:l.position))}renderGroupError(t,e=!0){var i,n,r,s;const o=this.groupFields[t];if(!1===o.isValid&&(this.isValid=!1),void 0===o.isValid||!e&&!this.isSubmitted&&!o.touched)return;if(o.isValid){o.elems.forEach((t=>{var e,i;Object.assign(t.style,(null==(e=o.config)?void 0:e.successFieldStyle)||this.globalConfig.successFieldStyle),t.classList.add(...Ip((null==(i=o.config)?void 0:i.successFieldCssClass)||this.globalConfig.successFieldCssClass))}));const e=this.createSuccessLabelElem(t,o.successMessage,o.config);return void(e&&this.renderGroupLabel(o.groupElem,e,null==(i=o.config)?void 0:i.errorsContainer,!0))}this.isValid=!1,o.elems.forEach((t=>{var e,i;Object.assign(t.style,(null==(e=o.config)?void 0:e.errorFieldStyle)||this.globalConfig.errorFieldStyle),t.classList.add(...Ip((null==(i=o.config)?void 0:i.errorFieldCssClass)||this.globalConfig.errorFieldCssClass))}));const a=this.createErrorLabelElem(t,o.errorMessage,o.config);this.renderGroupLabel(o.groupElem,a,null==(n=o.config)?void 0:n.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(o.groupElem,a,null==(s=null==(r=o.config)?void 0:r.tooltip)?void 0:s.position))}renderErrors(t=!1){if(this.isSubmitted||t||this.globalConfig.validateBeforeSubmitting){this.clearErrors(),this.isValid=!0;for(const t in this.groupFields)this.renderGroupError(t);for(const t in this.fields)this.renderFieldError(t)}}destroy(){this.eventListeners.forEach((t=>{this.removeListener(t.type,t.elem,t.func)})),Object.keys(this.customStyleTags).forEach((t=>{this.customStyleTags[t].remove()})),this.clearErrors(),this.globalConfig.lockForm&&this.unlockForm()}refresh(){this.destroy(),this.form?(this.initialize(this.form,this.globalConfig),Object.keys(this.fields).forEach((t=>{const e=this.getFieldSelectorByKey(t);e&&this.addField(e,[...this.fields[t].rules],this.fields[t].config)}))):console.error("Cannot initialize the library! Form is not defined")}setCurrentLocale(t){"string"==typeof t||void 0===t?(this.currentLocale=t,this.isSubmitted&&this.validate()):console.error("Current locale should be a string")}onSuccess(t){return this.onSuccessCallback=t,this}onFail(t){return this.onFailCallback=t,this}onValidate(t){return this.onValidateCallback=t,this}}var zp={errorFieldCssClass:"is-invalid",errorFieldStyle:"",errorLabelCssClass:"error-label",errorLabelStyle:"",successFieldCssClass:"is-valid",focusInvalidField:!0,validateBeforeSubmitting:!0},Rp={minlength:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{rule:"minLength",value:Number(t),errorMessage:"Введите не меньше ".concat(t," символов")}},maxlength:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!!t&&{rule:"maxLength",value:Number(t),errorMessage:"Введите не больше ".concat(t," символов")}},pattern:t=>({rule:"customRegexp",value:t,errorMessage:"Поле заполнено не корректно"}),min:t=>({validator:e=>+t<=+e,errorMessage:"Введите число не меньше ".concat(t)}),max:t=>({validator:e=>+t>=+e,errorMessage:"Введите число не больше ".concat(t)}),required:()=>({rule:"required",errorMessage:"Это обязательное поле"}),type:t=>{switch(t){case"password":return{rule:"password",errorMessage:"Минимум 8 символов, по крайней мере 1 буква и 1 цифра"};case"email":return{rule:"email",errorMessage:"E-mail некорректный"};case"number":return{rule:"number",errorMessage:"Введите число"};case"file":return{validator:(t,e)=>!Object.values(e)[0].elem.required||!!t.length,errorMessage:"Загрузите файл"};default:return!1}},"data-mask":t=>{var e=t.toString().replace(/[{}]/g,"").length,i=t.toString().replace(/\D/g,"").length;return{rule:"minLength",value:e,errorMessage:"поле должно содержать ".concat(i," цифр")}},"data-max-files":t=>({rule:"maxFilesCount",value:Number(t),errorMessage:1===Number(t)?"Загрузите не более одного файла":"Загрузите не более ".concat(t," файлов")}),"data-repeat-field":t=>{var[e,i="поле заполнено неверно"]=t.split(":");return{validator:(t,i)=>{var n,r=null===(n=i[e])||void 0===n?void 0:n.elem;return!!r&&r.value===t},errorMessage:i}}};function Fp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fp(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Np(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var jp=new WeakMap,Vp=new WeakMap,Up=new WeakMap;var $p=function t(){var e=[].slice.call(arguments),i=!1;"boolean"==typeof e[0]&&(i=e.shift());var n=e[0];if(Hp(n))throw new Error("extendee must be an object");for(var r=e.slice(1),s=r.length,o=0;o<s;o++){var a=r[o];for(var l in a)if(Object.prototype.hasOwnProperty.call(a,l)){var c=a[l];if(i&&(u=c,Array.isArray(u)||"[object Object]"=={}.toString.call(u))){var h=Array.isArray(c)?[]:{};n[l]=t(!0,Object.prototype.hasOwnProperty.call(n,l)&&!Hp(n[l])?n[l]:h,c)}else n[l]=c}}var u;return n};function Hp(t){return!t||"object"!=typeof t&&"function"!=typeof t}function qp(t){return t&&t.__esModule?t.default:t}class Wp{on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this}emit(t,...e){this._callbacks=this._callbacks||{};let i=this._callbacks[t];if(i)for(let t of i)t.apply(this,e);return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+t,{args:e})),this}makeEvent(t,e){let i={bubbles:!0,cancelable:!0,detail:e};if("function"==typeof window.CustomEvent)return new CustomEvent(t,i);var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),n}off(t,e){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;let i=this._callbacks[t];if(!i)return this;if(1===arguments.length)return delete this._callbacks[t],this;for(let t=0;t<i.length;t++){if(i[t]===e){i.splice(t,1);break}}return this}}let Gp={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2097152,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,defaultHeaders:!0,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(t,e,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept(t,e){return e()},chunksUploaded:function(t,e){e()},binaryBody:!1,fallback(){let t;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let e of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(e.className)){t=e,e.className="dz-message";break}t||(t=Yp.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t));let e=t.getElementsByTagName("span")[0];return e&&(null!=e.textContent?e.textContent=this.options.dictFallbackMessage:null!=e.innerText&&(e.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(t,e,i,n){let r={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},s=t.width/t.height;null==e&&null==i?(e=r.srcWidth,i=r.srcHeight):null==e?e=i*s:null==i&&(i=e/s);let o=(e=Math.min(e,r.srcWidth))/(i=Math.min(i,r.srcHeight));if(r.srcWidth>e||r.srcHeight>i)if("crop"===n)s>o?(r.srcHeight=t.height,r.srcWidth=r.srcHeight*o):(r.srcWidth=t.width,r.srcHeight=r.srcWidth/o);else{if("contain"!==n)throw new Error(`Unknown resizeMethod '${n}'`);s>o?i=e/s:e=i*s}return r.srcX=(t.width-r.srcWidth)/2,r.srcY=(t.height-r.srcHeight)/2,r.trgWidth=e,r.trgHeight=i,r},transformFile(t,e){return(this.options.resizeWidth||this.options.resizeHeight)&&t.type.match(/image.*/)?this.resizeImage(t,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(t)},previewTemplate:qp('<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail=""></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size=""></span></div>\n <div class="dz-filename"><span data-dz-name=""></span></div>\n </div>\n <div class="dz-progress">\n <span class="dz-upload" data-dz-uploadprogress=""></span>\n </div>\n <div class="dz-error-message"><span data-dz-errormessage=""></span></div>\n <div class="dz-success-mark">\n <svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">\n <path d="M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z"></path>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">\n <path d="M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z"></path>\n </svg>\n </div>\n</div>\n'),drop(t){return this.element.classList.remove("dz-drag-hover")},dragstart(t){},dragend(t){return this.element.classList.remove("dz-drag-hover")},dragenter(t){return this.element.classList.add("dz-drag-hover")},dragover(t){return this.element.classList.add("dz-drag-hover")},dragleave(t){return this.element.classList.remove("dz-drag-hover")},paste(t){},reset(){return this.element.classList.remove("dz-started")},addedfile(t){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var e of(t.previewElement=Yp.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement),t.previewElement.querySelectorAll("[data-dz-name]")))e.textContent=t.name;for(e of t.previewElement.querySelectorAll("[data-dz-size]"))e.innerHTML=this.filesize(t.size);this.options.addRemoveLinks&&(t._removeLink=Yp.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),t.previewElement.appendChild(t._removeLink));let i=e=>(e.preventDefault(),e.stopPropagation(),t.status===Yp.UPLOADING?Yp.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(t))):this.options.dictRemoveFileConfirmation?Yp.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(t))):this.removeFile(t));for(let e of t.previewElement.querySelectorAll("[data-dz-remove]"))e.addEventListener("click",i)}},removedfile(t){return null!=t.previewElement&&null!=t.previewElement.parentNode&&t.previewElement.parentNode.removeChild(t.previewElement),this._updateMaxFilesReachedClass()},thumbnail(t,e){if(t.previewElement){t.previewElement.classList.remove("dz-file-preview");for(let i of t.previewElement.querySelectorAll("[data-dz-thumbnail]"))i.alt=t.name,i.src=e;return setTimeout((()=>t.previewElement.classList.add("dz-image-preview")),1)}},error(t,e){if(t.previewElement){t.previewElement.classList.add("dz-error"),"string"!=typeof e&&e.error&&(e=e.error);for(let i of t.previewElement.querySelectorAll("[data-dz-errormessage]"))i.textContent=e}},errormultiple(){},processing(t){if(t.previewElement&&(t.previewElement.classList.add("dz-processing"),t._removeLink))return t._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(t,e,i){if(t.previewElement)for(let i of t.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===i.nodeName?i.value=e:i.style.width=`${e}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(t){if(t.previewElement)return t.previewElement.classList.add("dz-success")},successmultiple(){},canceled(t){return this.emit("error",t,this.options.dictUploadCanceled)},canceledmultiple(){},complete(t){if(t._removeLink&&(t._removeLink.innerHTML=this.options.dictRemoveFile),t.previewElement)return t.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};var Zp=Gp;class Yp extends Wp{static initClass(){this.prototype.Emitter=Wp,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}getAcceptedFiles(){return this.files.filter((t=>t.accepted)).map((t=>t))}getRejectedFiles(){return this.files.filter((t=>!t.accepted)).map((t=>t))}getFilesWithStatus(t){return this.files.filter((e=>e.status===t)).map((t=>t))}getQueuedFiles(){return this.getFilesWithStatus(Yp.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(Yp.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(Yp.ADDED)}getActiveFiles(){return this.files.filter((t=>t.status===Yp.UPLOADING||t.status===Yp.QUEUED)).map((t=>t))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(Yp.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let t=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",Yp.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:e}=this.hiddenFileInput;if(e.length)for(let t of e)this.addFile(t);this.emit("addedfiles",e),t()}))};t()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let t of this.events)this.on(t,this.options[t]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(t=>this.emit("complete",t))),this.on("complete",(t=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let t=function(t){if(function(t){if(t.dataTransfer.types)for(var e=0;e<t.dataTransfer.types.length;e++)if("Files"===t.dataTransfer.types[e])return!0;return!1}(t))return t.stopPropagation(),t.preventDefault?t.preventDefault():t.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:t=>this.emit("dragstart",t),dragenter:e=>(t(e),this.emit("dragenter",e)),dragover:e=>{let i;try{i=e.dataTransfer.effectAllowed}catch(t){}return e.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",t(e),this.emit("dragover",e)},dragleave:t=>this.emit("dragleave",t),drop:e=>(t(e),this.drop(e)),dragend:t=>this.emit("dragend",t)}}],this.clickableElements.forEach((t=>this.listeners.push({element:t,events:{click:e=>((t!==this.element||e.target===this.element||Yp.elementInside(e.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,Yp.instances.splice(Yp.instances.indexOf(this),1)}updateTotalUploadProgress(){let t,e=0,i=0;if(this.getActiveFiles().length){for(let t of this.getActiveFiles())e+=t.upload.bytesSent,i+=t.upload.total;t=100*e/i}else t=100;return this.emit("totaluploadprogress",t,i,e)}_getParamName(t){return"function"==typeof this.options.paramName?this.options.paramName(t):`${this.options.paramName}${this.options.uploadMultiple?`[${t}]`:""}`}_renameFile(t){return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}getFallbackForm(){let t,e;if(t=this.getExistingFallback())return t;let i='<div class="dz-fallback">';this.options.dictFallbackText&&(i+=`<p>${this.options.dictFallbackText}</p>`),i+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let n=Yp.createElement(i);return"FORM"!==this.element.tagName?(e=Yp.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`),e.appendChild(n)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:n}getExistingFallback(){let t=function(t){for(let e of t)if(/(^| )fallback($| )/.test(e.className))return e};for(let i of["div","form"]){var e;if(e=t(this.element.getElementsByTagName(i)))return e}}setupEventListeners(){return this.listeners.map((t=>(()=>{let e=[];for(let i in t.events){let n=t.events[i];e.push(t.element.addEventListener(i,n,!1))}return e})()))}removeEventListeners(){return this.listeners.map((t=>(()=>{let e=[];for(let i in t.events){let n=t.events[i];e.push(t.element.removeEventListener(i,n,!1))}return e})()))}disable(){return this.clickableElements.forEach((t=>t.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((t=>this.cancelUpload(t)))}enable(){return delete this.disabled,this.clickableElements.forEach((t=>t.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(t){let e=0,i="b";if(t>0){let n=["tb","gb","mb","kb","b"];for(let r=0;r<n.length;r++){let s=n[r];if(t>=Math.pow(this.options.filesizeBase,4-r)/10){e=t/Math.pow(this.options.filesizeBase,4-r),i=s;break}}e=Math.round(10*e)/10}return`<strong>${e}</strong> ${this.options.dictFileSizeUnits[i]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(t){if(!t.dataTransfer)return;this.emit("drop",t);let e=[];for(let i=0;i<t.dataTransfer.files.length;i++)e[i]=t.dataTransfer.files[i];if(e.length){let{items:i}=t.dataTransfer;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(e)}this.emit("addedfiles",e)}paste(t){if(null==(e=null!=t?t.clipboardData:void 0,i=t=>t.items,null!=e?i(e):void 0))return;var e,i;this.emit("paste",t);let{items:n}=t.clipboardData;return n.length?this._addFilesFromItems(n):void 0}handleFiles(t){for(let e of t)this.addFile(e)}_addFilesFromItems(t){return(()=>{let e=[];for(let n of t){var i;null!=n.webkitGetAsEntry&&(i=n.webkitGetAsEntry())?i.isFile?e.push(this.addFile(n.getAsFile())):i.isDirectory?e.push(this._addFilesFromDirectory(i,i.name)):e.push(void 0):null!=n.getAsFile&&(null==n.kind||"file"===n.kind)?e.push(this.addFile(n.getAsFile())):e.push(void 0)}return e})()}_addFilesFromDirectory(t,e){let i=t.createReader(),n=t=>{return e=console,i="log",n=e=>e.log(t),null!=e&&"function"==typeof e[i]?n(e,i):void 0;var e,i,n};var r=()=>i.readEntries((t=>{if(t.length>0){for(let i of t)i.isFile?i.file((t=>{if(!this.options.ignoreHiddenFiles||"."!==t.name.substring(0,1))return t.fullPath=`${e}/${t.name}`,this.addFile(t)})):i.isDirectory&&this._addFilesFromDirectory(i,`${e}/${i.name}`);r()}return null}),n);return r()}accept(t,e){this.options.maxFilesize&&t.size>1048576*this.options.maxFilesize?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):Yp.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)}addFile(t){t.upload={uuid:Yp.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=Yp.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,(e=>{e?(t.accepted=!1,this._errorProcessing([t],e)):(t.accepted=!0,this.options.autoQueue&&this.enqueueFile(t)),this._updateMaxFilesReachedClass()}))}enqueueFiles(t){for(let e of t)this.enqueueFile(e);return null}enqueueFile(t){if(t.status!==Yp.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=Yp.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(t){if(this.options.createImageThumbnails&&t.type.match(/image.*/)&&t.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(t),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(e=>(this.emit("thumbnail",t,e),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(t){if(t.status===Yp.UPLOADING&&this.cancelUpload(t),this.files=Xp(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")}removeAllFiles(t){null==t&&(t=!1);for(let e of this.files.slice())(e.status!==Yp.UPLOADING||t)&&this.removeFile(e);return null}resizeImage(t,e,i,n,r){return this.createThumbnail(t,e,i,n,!0,((e,i)=>{if(null==i)return r(t);{let{resizeMimeType:e}=this.options;null==e&&(e=t.type);let n=i.toDataURL(e,this.options.resizeQuality);return"image/jpeg"!==e&&"image/jpg"!==e||(n=Jp.restore(t.dataURL,n)),r(Yp.dataURItoBlob(n))}}))}createThumbnail(t,e,i,n,r,s){let o=new FileReader;o.onload=()=>{t.dataURL=o.result,"image/svg+xml"!==t.type?this.createThumbnailFromUrl(t,e,i,n,r,s):null!=s&&s(o.result)},o.readAsDataURL(t)}displayExistingFile(t,e,i,n,r=!0){if(this.emit("addedfile",t),this.emit("complete",t),r){let r=e=>{this.emit("thumbnail",t,e),i&&i()};t.dataURL=e,this.createThumbnailFromUrl(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,r,n)}else this.emit("thumbnail",t,e),i&&i()}createThumbnailFromUrl(t,e,i,n,r,s,o){let a=document.createElement("img");return o&&(a.crossOrigin=o),r="from-image"!=getComputedStyle(document.body).imageOrientation&&r,a.onload=()=>{let o=t=>t(1);return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(o=t=>EXIF.getData(a,(function(){return t(EXIF.getTag(this,"Orientation"))}))),o((r=>{t.width=a.width,t.height=a.height;let o=this.options.resize.call(this,t,e,i,n),l=document.createElement("canvas"),c=l.getContext("2d");switch(l.width=o.trgWidth,l.height=o.trgHeight,r>4&&(l.width=o.trgHeight,l.height=o.trgWidth),r){case 2:c.translate(l.width,0),c.scale(-1,1);break;case 3:c.translate(l.width,l.height),c.rotate(Math.PI);break;case 4:c.translate(0,l.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-l.width);break;case 7:c.rotate(.5*Math.PI),c.translate(l.height,-l.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-l.height,0)}Qp(c,a,null!=o.srcX?o.srcX:0,null!=o.srcY?o.srcY:0,o.srcWidth,o.srcHeight,null!=o.trgX?o.trgX:0,null!=o.trgY?o.trgY:0,o.trgWidth,o.trgHeight);let h=l.toDataURL("image/png");if(null!=s)return s(h,l)}))},null!=s&&(a.onerror=s),a.src=t.dataURL}processQueue(){let{parallelUploads:t}=this.options,e=this.getUploadingFiles().length,i=e;if(e>=t)return;let n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-e));for(;i<t;){if(!n.length)return;this.processFile(n.shift()),i++}}}processFile(t){return this.processFiles([t])}processFiles(t){for(let e of t)e.processing=!0,e.status=Yp.UPLOADING,this.emit("processing",e);return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)}_getFilesWithXhr(t){return this.files.filter((e=>e.xhr===t)).map((t=>t))}cancelUpload(t){if(t.status===Yp.UPLOADING){let e=this._getFilesWithXhr(t.xhr);for(let t of e)t.status=Yp.CANCELED;void 0!==t.xhr&&t.xhr.abort();for(let t of e)this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",e)}else t.status!==Yp.ADDED&&t.status!==Yp.QUEUED||(t.status=Yp.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(t,...e){return"function"==typeof t?t.apply(this,e):t}uploadFile(t){return this.uploadFiles([t])}uploadFiles(t){this._transformFiles(t,(e=>{if(this.options.chunking){let i=e[0];t[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||i.size>this.options.chunkSize),t[0].upload.totalChunkCount=Math.ceil(i.size/this.options.chunkSize)}if(t[0].upload.chunked){let i=t[0],n=e[0],r=0;i.upload.chunks=[];let s=()=>{let e=0;for(;void 0!==i.upload.chunks[e];)e++;if(e>=i.upload.totalChunkCount)return;r++;let s=e*this.options.chunkSize,o=Math.min(s+this.options.chunkSize,n.size),a={name:this._getParamName(0),data:n.webkitSlice?n.webkitSlice(s,o):n.slice(s,o),filename:i.upload.filename,chunkIndex:e};i.upload.chunks[e]={file:i,index:e,dataBlock:a,status:Yp.UPLOADING,progress:0,retries:0},this._uploadData(t,[a])};if(i.upload.finishedChunkUpload=(e,n)=>{let r=!0;e.status=Yp.SUCCESS,e.dataBlock=null,e.response=e.xhr.responseText,e.responseHeaders=e.xhr.getAllResponseHeaders(),e.xhr=null;for(let t=0;t<i.upload.totalChunkCount;t++){if(void 0===i.upload.chunks[t])return s();i.upload.chunks[t].status!==Yp.SUCCESS&&(r=!1)}r&&this.options.chunksUploaded(i,(()=>{this._finished(t,n,null)}))},this.options.parallelChunkUploads)for(let t=0;t<i.upload.totalChunkCount;t++)s();else s()}else{let i=[];for(let n=0;n<t.length;n++)i[n]={name:this._getParamName(n),data:e[n],filename:t[n].upload.filename};this._uploadData(t,i)}}))}_getChunk(t,e){for(let i=0;i<t.upload.totalChunkCount;i++)if(void 0!==t.upload.chunks[i]&&t.upload.chunks[i].xhr===e)return t.upload.chunks[i]}_uploadData(t,e){let i=new XMLHttpRequest;for(let e of t)e.xhr=i;t[0].upload.chunked&&(t[0].upload.chunks[e[0].chunkIndex].xhr=i);let n=this.resolveOption(this.options.method,t,e),r=this.resolveOption(this.options.url,t,e);i.open(n,r,!0),this.resolveOption(this.options.timeout,t)&&(i.timeout=this.resolveOption(this.options.timeout,t)),i.withCredentials=!!this.options.withCredentials,i.onload=e=>{this._finishedUploading(t,i,e)},i.ontimeout=()=>{this._handleUploadError(t,i,`Request timedout after ${this.options.timeout/1e3} seconds`)},i.onerror=()=>{this._handleUploadError(t,i)},(null!=i.upload?i.upload:i).onprogress=e=>this._updateFilesUploadProgress(t,i,e);let s=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(s["Content-Type"]=t[0].type),this.options.headers&&$p(s,this.options.headers);for(let t in s){let e=s[t];e&&i.setRequestHeader(t,e)}if(this.options.binaryBody){for(let e of t)this.emit("sending",e,i);this.options.uploadMultiple&&this.emit("sendingmultiple",t,i),this.submitRequest(i,null,t)}else{let n=new FormData;if(this.options.params){let e=this.options.params;"function"==typeof e&&(e=e.call(this,t,i,t[0].upload.chunked?this._getChunk(t[0],i):null));for(let t in e){let i=e[t];if(Array.isArray(i))for(let e=0;e<i.length;e++)n.append(t,i[e]);else n.append(t,i)}}for(let e of t)this.emit("sending",e,i,n);this.options.uploadMultiple&&this.emit("sendingmultiple",t,i,n),this._addFormElementData(n);for(let t=0;t<e.length;t++){let i=e[t];n.append(i.name,i.data,i.filename)}this.submitRequest(i,n,t)}}_transformFiles(t,e){let i=[],n=0;for(let r=0;r<t.length;r++)this.options.transformFile.call(this,t[r],(s=>{i[r]=s,++n===t.length&&e(i)}))}_addFormElementData(t){if("FORM"===this.element.tagName)for(let e of this.element.querySelectorAll("input, textarea, select, button")){let i=e.getAttribute("name"),n=e.getAttribute("type");if(n&&(n=n.toLowerCase()),null!=i)if("SELECT"===e.tagName&&e.hasAttribute("multiple"))for(let n of e.options)n.selected&&t.append(i,n.value);else(!n||"checkbox"!==n&&"radio"!==n||e.checked)&&t.append(i,e.value)}}_updateFilesUploadProgress(t,e,i){if(t[0].upload.chunked){let n=t[0],r=this._getChunk(n,e);i?(r.progress=100*i.loaded/i.total,r.total=i.total,r.bytesSent=i.loaded):(r.progress=100,r.bytesSent=r.total),n.upload.progress=0,n.upload.total=0,n.upload.bytesSent=0;for(let t=0;t<n.upload.totalChunkCount;t++)n.upload.chunks[t]&&void 0!==n.upload.chunks[t].progress&&(n.upload.progress+=n.upload.chunks[t].progress,n.upload.total+=n.upload.chunks[t].total,n.upload.bytesSent+=n.upload.chunks[t].bytesSent);n.upload.progress=n.upload.progress/n.upload.totalChunkCount,this.emit("uploadprogress",n,n.upload.progress,n.upload.bytesSent)}else for(let e of t)e.upload.total&&e.upload.bytesSent&&e.upload.bytesSent==e.upload.total||(i?(e.upload.progress=100*i.loaded/i.total,e.upload.total=i.total,e.upload.bytesSent=i.loaded):(e.upload.progress=100,e.upload.bytesSent=e.upload.total),this.emit("uploadprogress",e,e.upload.progress,e.upload.bytesSent))}_finishedUploading(t,e,i){let n;if(t[0].status!==Yp.CANCELED&&4===e.readyState){if("arraybuffer"!==e.responseType&&"blob"!==e.responseType&&(n=e.responseText,e.getResponseHeader("content-type")&&~e.getResponseHeader("content-type").indexOf("application/json")))try{n=JSON.parse(n)}catch(t){i=t,n="Invalid JSON response from server."}this._updateFilesUploadProgress(t,e),200<=e.status&&e.status<300?t[0].upload.chunked?t[0].upload.finishedChunkUpload(this._getChunk(t[0],e),n):this._finished(t,n,i):this._handleUploadError(t,e,n)}}_handleUploadError(t,e,i){if(t[0].status!==Yp.CANCELED){if(t[0].upload.chunked&&this.options.retryChunks){let i=this._getChunk(t[0],e);if(i.retries++<this.options.retryChunksLimit)return void this._uploadData(t,[i.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(t,i||this.options.dictResponseError.replace("{{statusCode}}",e.status),e)}}submitRequest(t,e,i){if(1==t.readyState)if(this.options.binaryBody)if(i[0].upload.chunked){const e=this._getChunk(i[0],t);t.send(e.dataBlock.data)}else t.send(i[0]);else t.send(e);else console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.")}_finished(t,e,i){for(let n of t)n.status=Yp.SUCCESS,this.emit("success",n,e,i),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("successmultiple",t,e,i),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(t,e,i){for(let n of t)n.status=Yp.ERROR,this.emit("error",n,e,i),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("errormultiple",t,e,i),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}constructor(t,e){let i,n;if(super(),this.element=t,this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");Yp.instances.push(this),this.element.dropzone=this;let r=null!=(n=Yp.optionsForElement(this.element))?n:{};if(this.options=$p(!0,{},Zp,r,null!=e?e:{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!Yp.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),null!=this.options.renameFilename&&(this.options.renameFile=t=>this.options.renameFilename.call(this,t.name,t)),"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(i=this.getExistingFallback())&&i.parentNode&&i.parentNode.removeChild(i),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=Yp.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=Yp.getElements(this.options.clickable,"clickable")),this.init()}}Yp.initClass(),Yp.options={},Yp.optionsForElement=function(t){return t.getAttribute("id")?Yp.options[Kp(t.getAttribute("id"))]:void 0},Yp.instances=[],Yp.forElement=function(t){if("string"==typeof t&&(t=document.querySelector(t)),null==(null!=t?t.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return t.dropzone},Yp.discover=function(){let t;if(document.querySelectorAll)t=document.querySelectorAll(".dropzone");else{t=[];let e=e=>(()=>{let i=[];for(let n of e)/(^| )dropzone($| )/.test(n.className)?i.push(t.push(n)):i.push(void 0);return i})();e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return(()=>{let e=[];for(let i of t)!1!==Yp.optionsForElement(i)?e.push(new Yp(i)):e.push(void 0);return e})()},Yp.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],Yp.isBrowserSupported=function(){let t=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){void 0!==Yp.blacklistedBrowsers&&(Yp.blockedBrowsers=Yp.blacklistedBrowsers);for(let e of Yp.blockedBrowsers)if(e.test(navigator.userAgent)){t=!1;continue}}else t=!1;else t=!1;return t},Yp.dataURItoBlob=function(t){let e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),r=new Uint8Array(n);for(let t=0,i=e.length,n=0<=i;n?t<=i:t>=i;n?t++:t--)r[t]=e.charCodeAt(t);return new Blob([n],{type:i})};const Xp=(t,e)=>t.filter((t=>t!==e)).map((t=>t)),Kp=t=>t.replace(/[\-_](\w)/g,(t=>t.charAt(1).toUpperCase()));Yp.createElement=function(t){let e=document.createElement("div");return e.innerHTML=t,e.childNodes[0]},Yp.elementInside=function(t,e){if(t===e)return!0;for(;t=t.parentNode;)if(t===e)return!0;return!1},Yp.getElement=function(t,e){let i;if("string"==typeof t?i=document.querySelector(t):null!=t.nodeType&&(i=t),null==i)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector or a plain HTML element.`);return i},Yp.getElements=function(t,e){let i,n;if(t instanceof Array){n=[];try{for(i of t)n.push(this.getElement(i,e))}catch(t){n=null}}else if("string"==typeof t)for(i of(n=[],document.querySelectorAll(t)))n.push(i);else null!=t.nodeType&&(n=[t]);if(null==n||!n.length)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return n},Yp.confirm=function(t,e,i){return window.confirm(t)?e():null!=i?i():void 0},Yp.isValidFile=function(t,e){if(!e)return!0;e=e.split(",");let i=t.type,n=i.replace(/\/.*$/,"");for(let r of e)if(r=r.trim(),"."===r.charAt(0)){if(-1!==t.name.toLowerCase().indexOf(r.toLowerCase(),t.name.length-r.length))return!0}else if(/\/\*$/.test(r)){if(n===r.replace(/\/.*$/,""))return!0}else if(i===r)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(t){return this.each((function(){return new Yp(this,t)}))}),Yp.ADDED="added",Yp.QUEUED="queued",Yp.ACCEPTED=Yp.QUEUED,Yp.UPLOADING="uploading",Yp.PROCESSING=Yp.UPLOADING,Yp.CANCELED="canceled",Yp.ERROR="error",Yp.SUCCESS="success";var Qp=function(t,e,i,n,r,s,o,a,l,c){let h=function(t){t.naturalWidth;let e=t.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=e;let n=i.getContext("2d");n.drawImage(t,0,0);let{data:r}=n.getImageData(1,0,1,e),s=0,o=e,a=e;for(;a>s;)0===r[4*(a-1)+3]?o=a:s=a,a=o+s>>1;let l=a/e;return 0===l?1:l}(e);return t.drawImage(e,i,n,r,s,o,a,l,c/h)};class Jp{static initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}static encode64(t){let e,i,n,r,s,o="",a="",l="",c=0;for(;e=t[c++],i=t[c++],a=t[c++],n=e>>2,r=(3&e)<<4|i>>4,s=(15&i)<<2|a>>6,l=63&a,isNaN(i)?s=l=64:isNaN(a)&&(l=64),o=o+this.KEY_STR.charAt(n)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(l),e=i=a="",n=r=s=l="",c<t.length;);return o}static restore(t,e){if(!t.match("data:image/jpeg;base64,"))return e;let i=this.decode64(t.replace("data:image/jpeg;base64,","")),n=this.slice2Segments(i),r=this.exifManipulation(e,n);return`data:image/jpeg;base64,${this.encode64(r)}`}static exifManipulation(t,e){let i=this.getExifArray(e),n=this.insertExif(t,i);return new Uint8Array(n)}static getExifArray(t){let e,i=0;for(;i<t.length;){if(e=t[i],255===e[0]&225===e[1])return e;i++}return[]}static insertExif(t,e){let i=t.replace("data:image/jpeg;base64,",""),n=this.decode64(i),r=n.indexOf(255,3),s=n.slice(0,r),o=n.slice(r),a=s;return a=a.concat(e),a=a.concat(o),a}static slice2Segments(t){let e=0,i=[];for(;;){if(255===t[e]&218===t[e+1])break;if(255===t[e]&216===t[e+1])e+=2;else{let n=e+(256*t[e+2]+t[e+3])+2,r=t.slice(e,n);i.push(r),e=n}if(e>t.length)break}return i}static decode64(t){let e,i,n,r,s,o="",a="",l=0,c=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(t)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");n=this.KEY_STR.indexOf(t.charAt(l++)),r=this.KEY_STR.indexOf(t.charAt(l++)),s=this.KEY_STR.indexOf(t.charAt(l++)),a=this.KEY_STR.indexOf(t.charAt(l++)),e=n<<2|r>>4,i=(15&r)<<4|s>>2,o=(3&s)<<6|a,c.push(e),64!==s&&c.push(i),64!==a&&c.push(o),e=i=o="",n=r=s=a="",l<t.length;);return c}}Jp.initClass();function tf(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ef(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?tf(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tf(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function nf(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var rf={url:"/api/file",thumbnailWidth:null,thumbnailHeight:null,autoProcessQueue:!1},sf=new WeakMap,of=new WeakMap,af=new WeakMap;function lf(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var cf=new WeakMap,hf=new WeakMap;var uf=__webpack_require__(7860),df=__webpack_require__.n(uf);function pf(t){return"string"==typeof t||t instanceof String}function ff(t){return"object"==typeof t&&null!=t&&"Object"===t?.constructor?.name}function mf(t,e){return Array.isArray(e)?mf(t,((t,i)=>e.includes(i))):Object.entries(t).reduce(((t,i)=>{let[n,r]=i;return e(r,n)&&(t[n]=r),t}),{})}const gf="NONE",_f="LEFT",yf="FORCE_LEFT",vf="RIGHT",bf="FORCE_RIGHT";function xf(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function wf(t,e){if(e===t)return!0;const i=Array.isArray(e),n=Array.isArray(t);let r;if(i&&n){if(e.length!=t.length)return!1;for(r=0;r<e.length;r++)if(!wf(e[r],t[r]))return!1;return!0}if(i!=n)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=e instanceof Date,n=t instanceof Date;if(i&&n)return e.getTime()==t.getTime();if(i!=n)return!1;const s=e instanceof RegExp,o=t instanceof RegExp;if(s&&o)return e.toString()==t.toString();if(s!=o)return!1;const a=Object.keys(e);for(r=0;r<a.length;r++)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=0;r<a.length;r++)if(!wf(t[a[r]],e[a[r]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Ef{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?gf:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?_f:vf}}function Sf(t,e){return new Sf.InputMask(t,e)}function Tf(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?Sf.MaskedRegExp:pf(t)?Sf.MaskedPattern:t===Date?Sf.MaskedDate:t===Number?Sf.MaskedNumber:Array.isArray(t)||t===Array?Sf.MaskedDynamic:Sf.Masked&&t.prototype instanceof Sf.Masked?t:Sf.Masked&&t instanceof Sf.Masked?t.constructor:t instanceof Function?Sf.MaskedFunction:(console.warn("Mask not found for mask",t),Sf.Masked)}function Mf(t){if(!t)throw new Error("Options in not defined");if(Sf.Masked){if(t.prototype instanceof Sf.Masked)return{mask:t};const{mask:e,...i}=t instanceof Sf.Masked?{mask:t}:ff(t)&&t.mask instanceof Sf.Masked?t:{};if(e){const t=e.mask;return{...mf(e,((t,e)=>!e.startsWith("_"))),mask:e.constructor,_mask:t,...i}}}return ff(t)?{...t}:{mask:t}}function Af(t){if(Sf.Masked&&t instanceof Sf.Masked)return t;const e=Mf(t),i=Tf(e.mask);if(!i)throw new Error(`Masked class is not found for provided mask ${e.mask}, appropriate module needs to be imported manually before creating mask.`);return e.mask===i&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new i(e)}Sf.createMask=Af;class Cf{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}Sf.MaskElement=Cf;class kf extends Cf{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){return this.input.getRootNode?.()??document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}Sf.HTMLMaskElement=kf;class Pf extends kf{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}Sf.HTMLMaskElement=kf;class If extends kf{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==i||i<n?i:n}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,n=e&&e.focusOffset;return null==n||null==i||i>n?i:n}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,e);const n=this.rootElement,r=n.getSelection&&n.getSelection();r&&(r.removeAllRanges(),r.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}Sf.HTMLContenteditableMaskElement=If;class Df{static MAX_LENGTH=100;states=[];currentIndex=0;get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Df.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Sf.InputMask=class{constructor(t,e){this.el=t instanceof Cf?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new If(t):new Pf(t),this.masked=Af(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Df,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){return null==t||this.masked?.maskEquals(t)}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Sf.Masked)&&this.masked.constructor===Tf(t))return void this.masked.updateOptions({mask:t});const e=t instanceof Sf.Masked?t:Af({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const i=this._listeners[t];i&&i.forEach((t=>t(e)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(t){const e=this.masked.unmaskedValue,i=this.masked.value,n=this.masked.rawInputValue,r=this.displayValue,s=this.unmaskedValue!==e||this.value!==i||this._rawInputValue!==n;this._unmaskedValue=e,this._value=i,this._rawInputValue=n,this.el.value!==r&&(this.el.value=r),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),s&&this._fireChangeEvents(),this._historyChanging||!s&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...i}=t,n=!this.maskEquals(e),r=this.masked.optionsIsChanged(i);n&&(this.mask=e),r&&this.masked.updateOptions(i),(n||r)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,_f))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(e);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Ef({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,n=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,r=i===this.masked.rawInputValue?e.removeDirection:gf;let s=this.masked.nearestInputPos(e.startChangePos+n,r);r!==gf&&(s=this.masked.nearestInputPos(s,gf)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class Of{static normalize(t){return Array.isArray(t)?t:[t,new Of]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},t)}aggregate(t){return this.rawInserted+=t.rawInserted,this.skip=this.skip||t.skip,this.inserted+=t.inserted,this.tailShift+=t.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}Sf.ChangeDetails=Of;class Lf{constructor(t,e,i){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class zf{static DEFAULTS={skipInvalid:!0};static EMPTY_VALUES=[void 0,null,""];constructor(t){this._value="",this._update({...zf.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new Lf(this.extractInput(t,e),t)}appendTail(t){return pf(t)&&(t=new Lf(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new Of({inserted:t,rawInserted:t})):new Of}_appendChar(t,e,i){void 0===e&&(e={});const n=this.state;let r;if([t,r]=this.doPrepareChar(t,e),t&&(r=r.aggregate(this._appendCharRaw(t,e))),r.inserted){let t,s=!1!==this.doValidate(e);if(s&&null!=i){const e=this.state;if(!0===this.overwrite){t=i.state;for(let t=0;t<r.rawInserted.length;++t)i.unshift(this.displayValue.length-r.tailShift)}let n=this.appendTail(i);if(s=n.rawInserted.length===i.toString().length,!(s&&n.inserted||"shift"!==this.overwrite)){this.state=e,t=i.state;for(let t=0;t<r.rawInserted.length;++t)i.shift();n=this.appendTail(i),s=n.rawInserted.length===i.toString().length}s&&n.inserted&&(this.state=e)}s||(r=new Of,this.state=n,i&&t&&(i.state=t))}return r}_appendPlaceholder(){return new Of}_appendEager(){return new Of}append(t,e,i){if(!pf(t))throw new Error("value should be string");const n=pf(i)?new Lf(String(i)):i;let r;e?.tail&&(e._beforeTailState=this.state),[t,r]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const s=this._appendChar(t[i],e,n);if(!s.rawInserted&&!this.doSkipInvalid(t[i],e,n))break;r.aggregate(s)}return(!0===this.eager||"append"===this.eager)&&e?.input&&t&&r.aggregate(this._appendEager()),null!=n&&(r.tailShift+=this.appendTail(n).tailShift),r}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new Of}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,i=this.value,n=t();return this.rawInputValue=e,this.value&&this.value!==i&&0===i.indexOf(this.value)&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,i=t(this);return this.state=e,delete this._isolated,i}doSkipInvalid(t,e,i){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),Of.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),Of.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,i,n,r){void 0===n&&(n=gf),void 0===r&&(r={input:!0});const s=t+e,o=this.extractTail(s),a=!0===this.eager||"remove"===this.eager;let l;a&&(n=function(t){switch(t){case _f:return yf;case vf:return bf;default:return t}}(n),l=this.extractInput(0,s,{raw:!0}));let c=t;const h=new Of;if(n!==gf&&(c=this.nearestInputPos(t,e>1&&0!==t&&!a?gf:n),h.tailShift=c-t),h.aggregate(this.remove(c)),a&&n!==gf&&l===this.rawInputValue)if(n===yf){let t;for(;l===this.rawInputValue&&(t=this.displayValue.length);)h.aggregate(new Of({tailShift:-1})).aggregate(this.remove(t-1))}else n===bf&&o.unshift();return h.aggregate(this.append(i,r,o))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!wf(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||zf.EMPTY_VALUES.includes(t)&&zf.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}}Sf.Masked=zf;class Rf{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=pf(t)?new Lf(String(t)):t;const e=this.chunks[this.chunks.length-1],i=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof Lf)i?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof Rf){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Sf.MaskedPattern)){return new Lf(this.toString()).appendTo(t)}const e=new Of;for(let i=0;i<this.chunks.length&&!e.skip;++i){const n=this.chunks[i],r=t._mapPosToBlock(t.displayValue.length),s=n.stop;let o;if(null!=s&&(!r||r.index<=s)){if(n instanceof Rf||t._stops.indexOf(s)>=0){const i=t._appendPlaceholder(s);e.aggregate(i)}o=n instanceof Rf&&t._blocks[s]}if(o){const i=o.appendTail(n);i.skip=!1,e.aggregate(i),t._value+=i.inserted;const r=n.toString().slice(i.rawInserted.length);r&&e.aggregate(t.append(r,{tail:!0}))}else e.aggregate(t.append(n.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map((t=>t.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...i}=t;Object.assign(this,i),this.chunks=e.map((t=>{const e="chunks"in t?new Rf:new Lf;return e.state=t,e}))}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let i=0;for(;i<this.chunks.length;){const t=this.chunks[i],n=t.unshift(e);if(t.toString()){if(!n)break;++i}else this.chunks.splice(i,1);if(n)return n}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],i=e.shift();if(e.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class Ff{constructor(t,e){this.masked=t,this._log=[];const{offset:i,index:n}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=this.block?.displayValue.length||0)if(t())return this.ok=!0;return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,yf),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,_f),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,_f),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,bf),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,gf),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,gf),!0}))}}class Bf{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new Of}nearestInputPos(t,e){void 0===e&&(e=gf);const i=this._value.length;switch(e){case _f:case yf:return 0;default:return i}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===i&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){void 0===e&&(e={});const i=new Of;if(this.isFilled)return i;const n=!0===this.eager||"append"===this.eager,r=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!n)&&!e.tail;return r&&(i.rawInserted=this.char),this._value=i.inserted=this.char,this._isRawInput=r&&(e.raw||e.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new Of;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Lf("")}appendTail(t){return pf(t)&&(t=new Lf(String(t))),t.appendTo(this)}append(t,e,i){const n=this._appendChar(t[0],e);return null!=i&&(n.tailShift+=this.appendTail(i).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}}class Nf{static DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};constructor(t){const{parent:e,isOptional:i,placeholderChar:n,displayChar:r,lazy:s,eager:o,...a}=t;this.masked=Af(a),Object.assign(this,{parent:e,isOptional:i,placeholderChar:n,displayChar:r,lazy:s,eager:o})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new Of}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new Of;const i=this.masked.state,n=this.masked._appendChar(t,this.currentMaskFlags(e));return n.inserted&&!1===this.doValidate(e)&&(n.inserted=n.rawInserted="",this.masked.state=i),n.inserted||this.isOptional||this.lazy||e.input||(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=Boolean(n.inserted),n}append(t,e,i){return this.masked.append(t,this.currentMaskFlags(e),i)}_appendPlaceholder(){const t=new Of;return this.isFilled||this.isOptional||(this.isFilled=!0,t.inserted=this.placeholderChar),t}_appendEager(){return new Of}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,i)}nearestInputPos(t,e){void 0===e&&(e=gf);const i=this.value.length,n=Math.min(Math.max(t,0),i);switch(e){case _f:case yf:return this.isComplete?n:0;case vf:case bf:return this.isComplete?n:i;default:return n}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){return{...t,_beforeTailState:t?._beforeTailState?.masked||t?._beforeTailState}}}Sf.MaskedRegExp=class extends zf{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class jf extends zf{static DEFAULTS={lazy:!0,placeholderChar:"_"};static STOP_CHAR="`";static ESCAPE_CHAR="\\";static InputDefinition=Nf;static FixedDefinition=Bf;constructor(t){super({...jf.DEFAULTS,...t,definitions:Object.assign({},Nf.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let i=!1,n=!1;for(let r=0;r<e.length;++r){if(this.blocks){const t=e.slice(r),i=Object.keys(this.blocks).filter((e=>0===t.indexOf(e)));i.sort(((t,e)=>e.length-t.length));const n=i[0];if(n){const{expose:t,repeat:e,...i}=Mf(this.blocks[n]),s={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...i,repeat:e,parent:this},o=null!=e?new Sf.RepeatBlock(s):Af(s);o&&(this._blocks.push(o),t&&(this.exposeBlock=o),this._maskedBlocks[n]||(this._maskedBlocks[n]=[]),this._maskedBlocks[n].push(this._blocks.length-1)),r+=n.length-1;continue}}let s=e[r],o=s in t;if(s===jf.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===s||"}"===s){i=!i;continue}if("["===s||"]"===s){n=!n;continue}if(s===jf.ESCAPE_CHAR){if(++r,s=e[r],!s)break;o=!1}const a=o?new Nf({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Mf(t[s]),parent:this}):new Bf({char:s,eager:this.eager,isUnmasking:i});this._blocks.push(a)}}get state(){return{...super.state,_blocks:this._blocks.map((t=>t.state))}}set state(t){if(!t)return void this.reset();const{_blocks:e,...i}=t;this._blocks.forEach(((t,i)=>t.state=e[i])),super.state=i}reset(){super.reset(),this._blocks.forEach((t=>t.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((t=>t.isComplete))}get isFilled(){return this._blocks.every((t=>t.isFilled))}get isFixed(){return this._blocks.every((t=>t.isFixed))}get isOptional(){return this._blocks.every((t=>t.isOptional))}doCommit(){this._blocks.forEach((t=>t.doCommit())),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((t,e)=>t+e.unmaskedValue),"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((t,e)=>t+e.value),"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce(((t,e)=>t+e.displayValue),"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){const t=new Of;let e=this._mapPosToBlock(this.displayValue.length)?.index;if(null==e)return t;this._blocks[e].isFilled&&++e;for(let i=e;i<this._blocks.length;++i){const e=this._blocks[i]._appendEager();if(!e.inserted)break;t.aggregate(e)}return t}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._mapPosToBlock(this.displayValue.length),n=new Of;if(!i)return n;for(let r,s=i.index;r=this._blocks[s];++s){const i=r._appendChar(t,{...e,_beforeTailState:e._beforeTailState?._blocks?.[s]});if(n.aggregate(i),i.skip||i.rawInserted)break}return n}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=new Rf;return t===e||this._forEachBlocksInRange(t,e,((t,e,n,r)=>{const s=t.extractTail(n,r);s.stop=this._findStopBefore(e),s.from=this._blockStartPos(e),s instanceof Rf&&(s.blockIndex=e),i.extend(s)})),i}extractInput(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===i&&(i={}),t===e)return"";let n="";return this._forEachBlocksInRange(t,e,((t,e,r,s)=>{n+=t.extractInput(r,s,i)})),n}_findStopBefore(t){let e;for(let i=0;i<this._stops.length;++i){const n=this._stops[i];if(!(n<=t))break;e=n}return e}_appendPlaceholder(t){const e=new Of;if(this.lazy&&null==t)return e;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return e;const n=i.index,r=null!=t?t:this._blocks.length;return this._blocks.slice(n,r).forEach((i=>{if(!i.lazy||null!=t){const t=i._appendPlaceholder(i._blocks?.length);this._value+=t.inserted,e.aggregate(t)}})),e}_mapPosToBlock(t){let e="";for(let i=0;i<this._blocks.length;++i){const n=this._blocks[i],r=e.length;if(e+=n.displayValue,t<=e.length)return{index:i,offset:t-r}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce(((t,e)=>t+e.displayValue.length),0)}_forEachBlocksInRange(t,e,i){void 0===e&&(e=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const t=this._mapPosToBlock(e),r=t&&n.index===t.index,s=n.offset,o=t&&r?t.offset:this._blocks[n.index].displayValue.length;if(i(this._blocks[n.index],n.index,s,o),t&&!r){for(let e=n.index+1;e<t.index;++e)i(this._blocks[e],e,0,this._blocks[e].displayValue.length);i(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._forEachBlocksInRange(t,e,((t,e,n,r)=>{i.aggregate(t.remove(n,r))})),i}nearestInputPos(t,e){if(void 0===e&&(e=gf),!this._blocks.length)return 0;const i=new Ff(this,t);if(e===gf)return i.pushRightBeforeInput()?i.pos:(i.popState(),i.pushLeftBeforeInput()?i.pos:this.displayValue.length);if(e===_f||e===yf){if(e===_f){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),e===_f){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t)return i.pos;if(i.popState(),i.ok&&i.pos<=t)return i.pos;i.popState()}return i.ok?i.pos:e===yf?0:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:0))}return e===vf||e===bf?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:e===bf?this.displayValue.length:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:this.nearestInputPos(t,_f)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,e,((t,e,n,r)=>{i+=t.totalInputPositions(n,r)})),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map((t=>this._blocks[t])):[]}}Sf.MaskedPattern=jf;class Vf extends jf{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:i=this.from||0,maxLength:n=this.maxLength||0,autofix:r=this.autofix,...s}=t;this.to=e,this.from=i,this.maxLength=Math.max(String(e).length,n),this.autofix=r;const o=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<a.length&&a[l]===o[l];)++l;s.mask=a.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(s)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",i="";const[,n,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];return r&&(e="0".repeat(n.length)+r,i="9".repeat(n.length)+r),e=e.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[e,i]}doPrepareChar(t,e){let i;if(void 0===e&&(e={}),[t,i]=super.doPrepareChar(t.replace(/\D/g,""),e),!this.autofix||!t)return i.skip=!this.isComplete,[t,i];const n=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),s=this.value+t;if(s.length>this.maxLength)return["",i];const[o,a]=this.boundaries(s);return Number(a)<this.from?[n[s.length-1],i]:Number(o)>this.to?"pad"===this.autofix&&s.length<this.maxLength?["",i.aggregate(this.append(n[s.length-1]+t,e))]:[r[s.length-1],i]:[t,i]}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[i,n]=this.boundaries(e);return this.from<=Number(n)&&Number(i)<=this.to&&super.doValidate(t)}}Sf.MaskedRange=Vf;class Uf extends jf{static GET_DEFAULT_BLOCKS=()=>({d:{mask:Vf,from:1,to:31,maxLength:2},m:{mask:Vf,from:1,to:12,maxLength:2},Y:{mask:Vf,from:1900,to:9999}});static DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[i,n,r]=t.split(".").map(Number);return new Date(r,n-1,i)}};static extractPatternOptions(t){const{mask:e,pattern:i,...n}=t;return{...n,mask:pf(e)?e:i}}constructor(t){super(Uf.extractPatternOptions({...Uf.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:i,blocks:n,...r}={...Uf.DEFAULTS,...t},s=Object.assign({},Uf.GET_DEFAULT_BLOCKS());t.min&&(s.Y.from=t.min.getFullYear()),t.max&&(s.Y.to=t.max.getFullYear()),t.min&&t.max&&s.Y.from===s.Y.to&&(s.m.from=t.min.getMonth()+1,s.m.to=t.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=t.min.getDate(),s.d.to=t.max.getDate())),Object.assign(s,this.blocks,n),Object.keys(s).forEach((e=>{const i=s[e];!("autofix"in i)&&"autofix"in t&&(i.autofix=t.autofix)})),super._update({...r,mask:pf(e)?e:i,blocks:s})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(Uf.extractPatternOptions(t))}}Sf.MaskedDate=Uf;class $f extends zf{static DEFAULTS;constructor(t){super({...$f.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map((t=>{const{expose:e,...i}=Mf(t),n=Af({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return e&&(this.exposeMask=n),n})):[])}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._applyDispatch(t,e);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),i}_applyDispatch(t,e,i){void 0===t&&(t=""),void 0===e&&(e={}),void 0===i&&(i="");const n=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,r=this.rawInputValue,s=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:r,o=r.slice(s.length),a=this.currentMask,l=new Of,c=a?.state;if(this.currentMask=this.doDispatch(t,{...e},i),this.currentMask)if(this.currentMask!==a){if(this.currentMask.reset(),s){const t=this.currentMask.append(s,{raw:!0});l.tailShift=t.inserted.length-n.length}o&&(l.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift)}else c&&(this.currentMask.state=c);return l}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new Of;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){return{...t,_beforeTailState:t._beforeTailState?.currentMaskRef===this.currentMask&&t._beforeTailState?.currentMask||t._beforeTailState}}doDispatch(t,e,i){return void 0===e&&(e={}),void 0===i&&(i=""),this.dispatch(t,this,e,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[i,n]=super.doPrepare(t,e);if(this.currentMask){let t;[i,t]=super.doPrepare(i,this.currentMaskFlags(e)),n=n.aggregate(t)}return[i,n]}doPrepareChar(t,e){void 0===e&&(e={});let[i,n]=super.doPrepareChar(t,e);if(this.currentMask){let t;[i,t]=super.doPrepareChar(i,this.currentMaskFlags(e)),n=n.aggregate(t)}return[i,n]}reset(){this.currentMask?.reset(),this.compiledMasks.forEach((t=>t.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){return Boolean(this.currentMask?.isComplete)}get isFilled(){return Boolean(this.currentMask?.isFilled)}remove(t,e){const i=new Of;return this.currentMask&&i.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),i}get state(){return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((t=>t.state)),currentMaskRef:this.currentMask,currentMask:this.currentMask?.state}}set state(t){const{compiledMasks:e,currentMaskRef:i,currentMask:n,...r}=t;e&&this.compiledMasks.forEach(((t,i)=>t.state=e[i])),null!=i&&(this.currentMask=i,this.currentMask.state=n),super.state=r}extractInput(t,e,i){return this.currentMask?this.currentMask.extractInput(t,e,i):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every(((e,i)=>{if(!t[i])return;const{mask:n,...r}=t[i];return wf(e,r)&&e.maskEquals(n)})):super.maskEquals(t)}typedValueEquals(t){return Boolean(this.currentMask?.typedValueEquals(t))}}$f.DEFAULTS={dispatch:(t,e,i,n)=>{if(!e.compiledMasks.length)return;const r=e.rawInputValue,s=e.compiledMasks.map(((s,o)=>{const a=e.currentMask===s,l=a?s.displayValue.length:s.nearestInputPos(s.displayValue.length,yf);return s.rawInputValue!==r?(s.reset(),s.append(r,{raw:!0})):a||s.remove(l),s.append(t,e.currentMaskFlags(i)),s.appendTail(n),{index:o,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(l,s.nearestInputPos(s.displayValue.length,yf)))}}));return s.sort(((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions)),e.compiledMasks[s[0].index]}},Sf.MaskedDynamic=$f;Sf.MaskedEnum=class extends jf{constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...i}=t;if(e){const t=e.map((t=>t.length)),n=Math.min(...t),r=Math.max(...t)-n;i.mask="*".repeat(n),r&&(i.mask+="["+"*".repeat(r)+"]"),this.enum=e}super._update(i)}doValidate(t){return this.enum.some((t=>0===t.indexOf(this.unmaskedValue)))&&super.doValidate(t)}};Sf.MaskedFunction=class extends zf{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class Hf extends zf{static UNMASKED_RADIX=".";static EMPTY_VALUES=[...zf.EMPTY_VALUES,0];static DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Hf.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};constructor(t){super({...Hf.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?`(${xf(this.radix)}\\d{0,${this.scale}})?`:"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp(`[${this.mapToRadix.map(xf).join("")}]`,"g"),this._thousandsSeparatorRegExp=new RegExp(xf(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[i,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!i&&(n.skip=!0),!i||this.allowPositive||this.value||"-"===i||n.aggregate(this._appendChar("-")),[i,n]}_separatorsCount(t,e){void 0===e&&(e=!1);let i=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++i,e&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,i))}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.thousandsSeparator)return super._appendCharRaw(t,e);const i=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const r=super._appendCharRaw(t,e);this._value=this._insertThousandsSeparators(this._value);const s=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(s);return r.tailShift+=(o-n)*this.thousandsSeparator.length,r.skip=!r.rawInserted&&t===this.thousandsSeparator,r}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,e);if(i<=t)return i}return-1}_adjustRangeWithSeparators(t,e){const i=this._findSeparatorAround(t);i>=0&&(t=i);const n=this._findSeparatorAround(e);return n>=0&&(e=n+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const i=this.value.slice(0,t),n=this.value.slice(e),r=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+n));const s=this._separatorsCountFromSlice(i);return new Of({tailShift:(s-r)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case gf:case _f:case yf:{const i=this._findSeparatorAround(t-1);if(i>=0){const n=i+this.thousandsSeparator.length;if(t<n||this.value.length<=n||e===yf)return i}break}case vf:case bf:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doValidate(t){let e=Boolean(this._removeThousandsSeparators(this.value).match(this._numberRegExp));if(e){const t=this.number;e=e&&!isNaN(t)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return e&&super.doValidate(t)}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,((t,e,i,n)=>e+n)),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,i){void 0===e&&(e={});const n=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===Hf.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,i)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Hf.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(Hf.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||Hf.EMPTY_VALUES.includes(t)&&Hf.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}Sf.MaskedNumber=Hf;const qf={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Wf(t,e,i){void 0===e&&(e=qf.MASKED),void 0===i&&(i=qf.MASKED);const n=Af(t);return t=>n.runIsolated((n=>(n[e]=t,n[i])))}Sf.PIPE_TYPE=qf,Sf.createPipe=Wf,Sf.pipe=function(t,e,i,n){return Wf(e,i,n)(t)};Sf.RepeatBlock=class extends jf{get repeatFrom(){return(Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)??0}get repeatTo(){return(Array.isArray(this.repeat)?this.repeat[1]:this.repeat)??1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{repeat:e,...i}=Mf(t);this._blockOpts=Object.assign({},this._blockOpts,i);const n=Af(this._blockOpts);this.repeat=e??n.repeat??this.repeat??1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&this._blocks?.length||0,this.repeatFrom)),blocks:{m:n},eager:n.eager,overwrite:n.overwrite,skipInvalid:n.skipInvalid,lazy:n.lazy,placeholderChar:n.placeholderChar,displayChar:n.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(Af(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const i=new Of;for(let n,r,s=this._mapPosToBlock(this.displayValue.length)?.index??Math.max(this._blocks.length-1,0);n=this._blocks[s]??(r=!r&&this._allocateBlock(s));++s){const o=n._appendChar(t,{...e,_beforeTailState:e._beforeTailState?._blocks?.[s]});if(o.skip&&r){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(o),o.skip||o.rawInserted)break}return i}_trimEmptyTail(t,e){void 0===t&&(t=0);const i=Math.max(this._mapPosToBlock(t)?.index||0,this.repeatFrom,0);let n;null!=e&&(n=this._mapPosToBlock(e)?.index),null==n&&(n=this._blocks.length-1);let r=0;for(let t=n;i<=t&&!this._blocks[t].unmaskedValue;--t,++r);r&&(this._blocks.splice(n-r+1,r),this.mask=this.mask.slice(r))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._trimEmptyTail(t,e),i}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=Sf}catch{}function Gf(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Zf=new WeakMap;var Yf,Xf,Kf=new WeakMap;function Qf(t){return"object"==typeof t&&"function"==typeof t.to}function Jf(t){t.parentElement.removeChild(t)}function tm(t){return null!=t}function em(t){t.preventDefault()}function im(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function nm(t,e,i){i>0&&(am(t,e),setTimeout((function(){lm(t,e)}),i))}function rm(t){return Math.max(Math.min(t,100),0)}function sm(t){return Array.isArray(t)?t:[t]}function om(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function am(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function lm(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function cm(t){var e=void 0!==window.pageXOffset,i="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:i?t.documentElement.scrollLeft:t.body.scrollLeft,y:e?window.pageYOffset:i?t.documentElement.scrollTop:t.body.scrollTop}}function hm(t,e){return 100/(e-t)}function um(t,e,i){return 100*e/(t[i+1]-t[i])}function dm(t,e){for(var i=1;t>=e[i];)i+=1;return i}function pm(t,e,i){if(i>=t.slice(-1)[0])return 100;var n=dm(i,t),r=t[n-1],s=t[n],o=e[n-1],a=e[n];return o+function(t,e){return um(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([r,s],i)/hm(o,a)}function fm(t,e,i,n){if(100===n)return n;var r=dm(n,t),s=t[r-1],o=t[r];return i?n-s>(o-s)/2?o:s:e[r-1]?t[r-1]+function(t,e){return Math.round(t/e)*e}(n-t[r-1],e[r-1]):n}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(Yf||(Yf={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(Xf||(Xf={}));var mm=function(){function t(t,e,i){var n;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[i||!1],this.xNumSteps=[!1],this.snap=e;var r=[];for(Object.keys(t).forEach((function(e){r.push([sm(t[e]),e])})),r.sort((function(t,e){return t[0][0]-e[0][0]})),n=0;n<r.length;n++)this.handleEntryPoint(r[n][1],r[n][0]);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)this.handleStepPoint(n,this.xNumSteps[n])}return t.prototype.getDistance=function(t){for(var e=[],i=0;i<this.xNumSteps.length-1;i++)e[i]=um(this.xVal,t,i);return e},t.prototype.getAbsoluteDistance=function(t,e,i){var n,r=0;if(t<this.xPct[this.xPct.length-1])for(;t>this.xPct[r+1];)r++;else t===this.xPct[this.xPct.length-1]&&(r=this.xPct.length-2);i||t!==this.xPct[r+1]||r++,null===e&&(e=[]);var s=1,o=e[r],a=0,l=0,c=0,h=0;for(n=i?(t-this.xPct[r])/(this.xPct[r+1]-this.xPct[r]):(this.xPct[r+1]-t)/(this.xPct[r+1]-this.xPct[r]);o>0;)a=this.xPct[r+1+h]-this.xPct[r+h],e[r+h]*s+100-100*n>100?(l=a*n,s=(o-100*n)/e[r+h],n=1):(l=e[r+h]*a/100*s,s=0),i?(c-=l,this.xPct.length+h>=1&&h--):(c+=l,this.xPct.length-h>=1&&h++),o=e[r+h]*s;return t+c},t.prototype.toStepping=function(t){return t=pm(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,i){if(i>=100)return t.slice(-1)[0];var n=dm(i,e),r=t[n-1],s=t[n],o=e[n-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([r,s],(i-o)*hm(o,e[n]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=fm(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,i){var n=dm(t,this.xPct);return(100===t||e&&t===this.xPct[n-1])&&(n=Math.max(n-1,1)),(this.xVal[n]-this.xVal[n-1])/i},t.prototype.getNearbySteps=function(t){var e=dm(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(om);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var i;if(!im(i="min"===t?0:"max"===t?100:parseFloat(t))||!im(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(i),this.xVal.push(e[0]);var n=Number(e[1]);i?this.xSteps.push(!isNaN(n)&&n):isNaN(n)||(this.xSteps[0]=n),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=um([this.xVal[t],this.xVal[t+1]],e,0)/hm(this.xPct[t],this.xPct[t+1]);var i=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],n=Math.ceil(Number(i.toFixed(3))-1),r=this.xVal[t]+this.xNumSteps[t]*n;this.xHighestCompleteStep[t]=r}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),gm={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},_m={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},ym={tooltips:".__tooltips",aria:".__aria"};function vm(t,e){if(!im(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function bm(t,e){if(!im(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function xm(t,e){if(!im(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function wm(t,e){if(!im(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function Em(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");t.spectrum=new mm(e,t.snap||!1,t.singleStep)}function Sm(t,e){if(e=sm(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function Tm(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function Mm(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function Am(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function Cm(t,e){var i,n=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(i=1;i<t.handles;i++)n.push(e);n.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");n=e}t.connect=n}function km(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function Pm(t,e){if(!im(e))throw new Error("noUiSlider: 'margin' option must be numeric.");0!==e&&(t.margin=t.spectrum.getDistance(e))}function Im(t,e){if(!im(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getDistance(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function Dm(t,e){var i;if(!im(e)&&!Array.isArray(e))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&2!==e.length&&!im(e[0])&&!im(e[1]))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==e){for(Array.isArray(e)||(e=[e,e]),t.padding=[t.spectrum.getDistance(e[0]),t.spectrum.getDistance(e[1])],i=0;i<t.spectrum.xNumSteps.length-1;i++)if(t.padding[0][i]<0||t.padding[1][i]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var n=e[0]+e[1],r=t.spectrum.xVal[0];if(n/(t.spectrum.xVal[t.spectrum.xVal.length-1]-r)>1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function Om(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function Lm(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var i=e.indexOf("tap")>=0,n=e.indexOf("drag")>=0,r=e.indexOf("fixed")>=0,s=e.indexOf("snap")>=0,o=e.indexOf("hover")>=0,a=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,c=e.indexOf("smooth-steps")>=0;if(r){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");Pm(t,t.start[1]-t.start[0])}if(a&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:i||s,drag:n,dragAll:l,smoothSteps:c,fixed:r,snap:s,hover:o,unconstrained:a}}function zm(t,e){if(!1!==e)if(!0===e||Qf(e)){t.tooltips=[];for(var i=0;i<t.handles;i++)t.tooltips.push(e)}else{if((e=sm(e)).length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");e.forEach((function(t){if("boolean"!=typeof t&&!Qf(t))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})),t.tooltips=e}}function Rm(t,e){if(e.length!==t.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");t.handleAttributes=e}function Fm(t,e){if(!Qf(e))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");t.ariaFormat=e}function Bm(t,e){if(!function(t){return Qf(t)&&"function"==typeof t.from}(e))throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");t.format=e}function Nm(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");t.keyboardSupport=e}function jm(t,e){t.documentElement=e}function Vm(t,e){if("string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function Um(t,e){if("object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");"string"==typeof t.cssPrefix?(t.cssClasses={},Object.keys(e).forEach((function(i){t.cssClasses[i]=t.cssPrefix+e[i]}))):t.cssClasses=e}function $m(t){var e={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:gm,format:gm},i={step:{r:!1,t:vm},keyboardPageMultiplier:{r:!1,t:bm},keyboardMultiplier:{r:!1,t:xm},keyboardDefaultStep:{r:!1,t:wm},start:{r:!0,t:Sm},connect:{r:!0,t:Cm},direction:{r:!0,t:Om},snap:{r:!1,t:Tm},animate:{r:!1,t:Mm},animationDuration:{r:!1,t:Am},range:{r:!0,t:Em},orientation:{r:!1,t:km},margin:{r:!1,t:Pm},limit:{r:!1,t:Im},padding:{r:!1,t:Dm},behaviour:{r:!0,t:Lm},ariaFormat:{r:!1,t:Fm},format:{r:!1,t:Bm},tooltips:{r:!1,t:zm},keyboardSupport:{r:!0,t:Nm},documentElement:{r:!1,t:jm},cssPrefix:{r:!0,t:Vm},cssClasses:{r:!0,t:Um},handleAttributes:{r:!1,t:Rm}},n={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:_m,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};t.format&&!t.ariaFormat&&(t.ariaFormat=t.format),Object.keys(i).forEach((function(r){if(tm(t[r])||void 0!==n[r])i[r].t(e,tm(t[r])?t[r]:n[r]);else if(i[r].r)throw new Error("noUiSlider: '"+r+"' is required.")})),e.pips=t.pips;var r=document.createElement("div"),s=void 0!==r.style.msTransform,o=void 0!==r.style.transform;e.transformRule=o?"transform":s?"msTransform":"webkitTransform";return e.style=[["left","top"],["right","bottom"]][e.dir][e.ort],e}function Hm(t,e,i){var n,r,s,o,a,l,c,h=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},u=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),d=t,p=e.spectrum,f=[],m=[],g=[],_=0,y={},v=t.ownerDocument,b=e.documentElement||v.documentElement,x=v.body,w="rtl"===v.dir||1===e.ort?0:100;function E(t,e){var i=v.createElement("div");return e&&am(i,e),t.appendChild(i),i}function S(t,i){var n=E(t,e.cssClasses.origin),r=E(n,e.cssClasses.handle);if(E(r,e.cssClasses.touchArea),r.setAttribute("data-handle",String(i)),e.keyboardSupport&&(r.setAttribute("tabindex","0"),r.addEventListener("keydown",(function(t){return function(t,i){if(A()||C(i))return!1;var n=["Left","Right"],r=["Down","Up"],s=["PageDown","PageUp"],o=["Home","End"];e.dir&&!e.ort?n.reverse():e.ort&&!e.dir&&(r.reverse(),s.reverse());var a,l=t.key.replace("Arrow",""),c=l===s[0],h=l===s[1],u=l===r[0]||l===n[0]||c,d=l===r[1]||l===n[1]||h,g=l===o[0],_=l===o[1];if(!(u||d||g||_))return!0;if(t.preventDefault(),d||u){var y=u?0:1,v=rt(i)[y];if(null===v)return!1;!1===v&&(v=p.getDefaultStep(m[i],u,e.keyboardDefaultStep)),v*=h||c?e.keyboardPageMultiplier:e.keyboardMultiplier,v=Math.max(v,1e-7),v*=u?-1:1,a=f[i]+v}else a=_?e.spectrum.xVal[e.spectrum.xVal.length-1]:e.spectrum.xVal[0];return J(i,p.toStepping(a),!0,!0),G("slide",i),G("update",i),G("change",i),G("set",i),!1}(t,i)}))),void 0!==e.handleAttributes){var s=e.handleAttributes[i];Object.keys(s).forEach((function(t){r.setAttribute(t,s[t])}))}return r.setAttribute("role","slider"),r.setAttribute("aria-orientation",e.ort?"vertical":"horizontal"),0===i?am(r,e.cssClasses.handleLower):i===e.handles-1&&am(r,e.cssClasses.handleUpper),n.handle=r,n}function T(t,i){return!!i&&E(t,e.cssClasses.connect)}function M(t,i){return!(!e.tooltips||!e.tooltips[i])&&E(t.firstChild,e.cssClasses.tooltip)}function A(){return d.hasAttribute("disabled")}function C(t){return r[t].hasAttribute("disabled")}function k(){a&&(W("update"+ym.tooltips),a.forEach((function(t){t&&Jf(t)})),a=null)}function P(){k(),a=r.map(M),q("update"+ym.tooltips,(function(t,i,n){if(a&&e.tooltips&&!1!==a[i]){var r=t[i];!0!==e.tooltips[i]&&(r=e.tooltips[i].to(n[i])),a[i].innerHTML=r}}))}function I(t,e){return t.map((function(t){return p.fromStepping(e?p.getStep(t):t)}))}function D(t){var e,i=function(t){if(t.mode===Yf.Range||t.mode===Yf.Steps)return p.xVal;if(t.mode===Yf.Count){if(t.values<2)throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");for(var e=t.values-1,i=100/e,n=[];e--;)n[e]=e*i;return n.push(100),I(n,t.stepped)}return t.mode===Yf.Positions?I(t.values,t.stepped):t.mode===Yf.Values?t.stepped?t.values.map((function(t){return p.fromStepping(p.getStep(p.toStepping(t)))})):t.values:[]}(t),n={},r=p.xVal[0],s=p.xVal[p.xVal.length-1],o=!1,a=!1,l=0;return e=i.slice().sort((function(t,e){return t-e})),i=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}),i[0]!==r&&(i.unshift(r),o=!0),i[i.length-1]!==s&&(i.push(s),a=!0),i.forEach((function(e,r){var s,c,h,u,d,f,m,g,_,y,v=e,b=i[r+1],x=t.mode===Yf.Steps;for(x&&(s=p.xNumSteps[r]),s||(s=b-v),void 0===b&&(b=v),s=Math.max(s,1e-7),c=v;c<=b;c=Number((c+s).toFixed(7))){for(g=(d=(u=p.toStepping(c))-l)/(t.density||1),y=d/(_=Math.round(g)),h=1;h<=_;h+=1)n[(f=l+h*y).toFixed(5)]=[p.fromStepping(f),0];m=i.indexOf(c)>-1?Xf.LargeValue:x?Xf.SmallValue:Xf.NoValue,!r&&o&&c!==b&&(m=0),c===b&&a||(n[u.toFixed(5)]=[c,m]),l=u}})),n}function O(t,i,n){var r,s,o=v.createElement("div"),a=((r={})[Xf.None]="",r[Xf.NoValue]=e.cssClasses.valueNormal,r[Xf.LargeValue]=e.cssClasses.valueLarge,r[Xf.SmallValue]=e.cssClasses.valueSub,r),l=((s={})[Xf.None]="",s[Xf.NoValue]=e.cssClasses.markerNormal,s[Xf.LargeValue]=e.cssClasses.markerLarge,s[Xf.SmallValue]=e.cssClasses.markerSub,s),c=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],h=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function u(t,i){var n=i===e.cssClasses.value,r=n?a:l;return i+" "+(n?c:h)[e.ort]+" "+r[t]}return am(o,e.cssClasses.pips),am(o,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(r){!function(t,r,s){if((s=i?i(r,s):s)!==Xf.None){var a=E(o,!1);a.className=u(s,e.cssClasses.marker),a.style[e.style]=t+"%",s>Xf.NoValue&&((a=E(o,!1)).className=u(s,e.cssClasses.value),a.setAttribute("data-value",String(r)),a.style[e.style]=t+"%",a.innerHTML=String(n.to(r)))}}(r,t[r][0],t[r][1])})),o}function L(){o&&(Jf(o),o=null)}function z(t){L();var e=D(t),i=t.filter,n=t.format||{to:function(t){return String(Math.round(t))}};return o=d.appendChild(O(e,i,n))}function R(){var t=n.getBoundingClientRect(),i="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||n[i]:t.height||n[i]}function F(t,i,n,r){var s=function(s){var o,a,l=function(t,e,i){var n=0===t.type.indexOf("touch"),r=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer"),o=0,a=0;0===t.type.indexOf("MSPointer")&&(s=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(n){var l=function(e){var n=e.target;return n===i||i.contains(n)||t.composed&&t.composedPath().shift()===i};if("touchstart"===t.type){var c=Array.prototype.filter.call(t.touches,l);if(c.length>1)return!1;o=c[0].pageX,a=c[0].pageY}else{var h=Array.prototype.find.call(t.changedTouches,l);if(!h)return!1;o=h.pageX,a=h.pageY}}e=e||cm(v),(r||s)&&(o=t.clientX+e.x,a=t.clientY+e.y);return t.pageOffset=e,t.points=[o,a],t.cursor=r||s,t}(s,r.pageOffset,r.target||i);return!!l&&(!(A()&&!r.doNotReject)&&(o=d,a=e.cssClasses.tap,!((o.classList?o.classList.contains(a):new RegExp("\\b"+a+"\\b").test(o.className))&&!r.doNotReject)&&(!(t===h.start&&void 0!==l.buttons&&l.buttons>1)&&((!r.hover||!l.buttons)&&(u||l.preventDefault(),l.calcPoint=l.points[e.ort],void n(l,r))))))},o=[];return t.split(" ").forEach((function(t){i.addEventListener(t,s,!!u&&{passive:!0}),o.push([t,s])})),o}function B(t){var i,r,s,o,a,l,c=100*(t-(i=n,r=e.ort,s=i.getBoundingClientRect(),o=i.ownerDocument,a=o.documentElement,l=cm(o),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),r?s.top+l.y-a.clientTop:s.left+l.x-a.clientLeft))/R();return c=rm(c),e.dir?100-c:c}function N(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&V(t,e)}function j(t,i){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==i.buttonsProperty)return V(t,i);var n=(e.dir?-1:1)*(t.calcPoint-i.startCalcPoint);X(n>0,100*n/i.baseSize,i.locations,i.handleNumbers,i.connect)}function V(t,i){i.handle&&(lm(i.handle,e.cssClasses.active),_-=1),i.listeners.forEach((function(t){b.removeEventListener(t[0],t[1])})),0===_&&(lm(d,e.cssClasses.drag),Q(),t.cursor&&(x.style.cursor="",x.removeEventListener("selectstart",em))),e.events.smoothSteps&&(i.handleNumbers.forEach((function(t){J(t,m[t],!0,!0,!1,!1)})),i.handleNumbers.forEach((function(t){G("update",t)}))),i.handleNumbers.forEach((function(t){G("change",t),G("set",t),G("end",t)}))}function U(t,i){if(!i.handleNumbers.some(C)){var n;if(1===i.handleNumbers.length)n=r[i.handleNumbers[0]].children[0],_+=1,am(n,e.cssClasses.active);t.stopPropagation();var s=[],o=F(h.move,b,j,{target:t.target,handle:n,connect:i.connect,listeners:s,startCalcPoint:t.calcPoint,baseSize:R(),pageOffset:t.pageOffset,handleNumbers:i.handleNumbers,buttonsProperty:t.buttons,locations:m.slice()}),a=F(h.end,b,V,{target:t.target,handle:n,listeners:s,doNotReject:!0,handleNumbers:i.handleNumbers}),l=F("mouseout",b,N,{target:t.target,handle:n,listeners:s,doNotReject:!0,handleNumbers:i.handleNumbers});s.push.apply(s,o.concat(a,l)),t.cursor&&(x.style.cursor=getComputedStyle(t.target).cursor,r.length>1&&am(d,e.cssClasses.drag),x.addEventListener("selectstart",em,!1)),i.handleNumbers.forEach((function(t){G("start",t)}))}}function $(t){t.stopPropagation();var i=B(t.calcPoint),n=function(t){var e=100,i=!1;return r.forEach((function(n,r){if(!C(r)){var s=m[r],o=Math.abs(s-t);(o<e||o<=e&&t>s||100===o&&100===e)&&(i=r,e=o)}})),i}(i);!1!==n&&(e.events.snap||nm(d,e.cssClasses.tap,e.animationDuration),J(n,i,!0,!0),Q(),G("slide",n,!0),G("update",n,!0),e.events.snap?U(t,{handleNumbers:[n]}):(G("change",n,!0),G("set",n,!0)))}function H(t){var e=B(t.calcPoint),i=p.getStep(e),n=p.fromStepping(i);Object.keys(y).forEach((function(t){"hover"===t.split(".")[0]&&y[t].forEach((function(t){t.call(st,n)}))}))}function q(t,e){y[t]=y[t]||[],y[t].push(e),"update"===t.split(".")[0]&&r.forEach((function(t,e){G("update",e)}))}function W(t){var e=t&&t.split(".")[0],i=e?t.substring(e.length):t;Object.keys(y).forEach((function(t){var n=t.split(".")[0],r=t.substring(n.length);e&&e!==n||i&&i!==r||function(t){return t===ym.aria||t===ym.tooltips}(r)&&i!==r||delete y[t]}))}function G(t,i,n){Object.keys(y).forEach((function(r){var s=r.split(".")[0];t===s&&y[r].forEach((function(t){t.call(st,f.map(e.format.to),i,f.slice(),n||!1,m.slice(),st)}))}))}function Z(t,i,n,s,o,a,l){var c;return r.length>1&&!e.events.unconstrained&&(s&&i>0&&(c=p.getAbsoluteDistance(t[i-1],e.margin,!1),n=Math.max(n,c)),o&&i<r.length-1&&(c=p.getAbsoluteDistance(t[i+1],e.margin,!0),n=Math.min(n,c))),r.length>1&&e.limit&&(s&&i>0&&(c=p.getAbsoluteDistance(t[i-1],e.limit,!1),n=Math.min(n,c)),o&&i<r.length-1&&(c=p.getAbsoluteDistance(t[i+1],e.limit,!0),n=Math.max(n,c))),e.padding&&(0===i&&(c=p.getAbsoluteDistance(0,e.padding[0],!1),n=Math.max(n,c)),i===r.length-1&&(c=p.getAbsoluteDistance(100,e.padding[1],!0),n=Math.min(n,c))),l||(n=p.getStep(n)),!((n=rm(n))===t[i]&&!a)&&n}function Y(t,i){var n=e.ort;return(n?i:t)+", "+(n?t:i)}function X(t,i,n,r,s){var o=n.slice(),a=r[0],l=e.events.smoothSteps,c=[!t,t],h=[t,!t];r=r.slice(),t&&r.reverse(),r.length>1?r.forEach((function(t,e){var n=Z(o,t,o[t]+i,c[e],h[e],!1,l);!1===n?i=0:(i=n-o[t],o[t]=n)})):c=h=[!0];var u=!1;r.forEach((function(t,e){u=J(t,n[t]+i,c[e],h[e],!1,l)||u})),u&&(r.forEach((function(t){G("update",t),G("slide",t)})),null!=s&&G("drag",a))}function K(t,i){return e.dir?100-t-i:t}function Q(){g.forEach((function(t){var e=m[t]>50?-1:1,i=3+(r.length+e*t);r[t].style.zIndex=String(i)}))}function J(t,i,n,s,o,a){return o||(i=Z(m,t,i,n,s,!1,a)),!1!==i&&(function(t,i){m[t]=i,f[t]=p.fromStepping(i);var n="translate("+Y(K(i,0)-w+"%","0")+")";r[t].style[e.transformRule]=n,tt(t),tt(t+1)}(t,i),!0)}function tt(t){if(s[t]){var i=0,n=100;0!==t&&(i=m[t-1]),t!==s.length-1&&(n=m[t]);var r=n-i,o="translate("+Y(K(i,r)+"%","0")+")",a="scale("+Y(r/100,"1")+")";s[t].style[e.transformRule]=o+" "+a}}function et(t,i){return null===t||!1===t||void 0===t?m[i]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=p.toStepping(t)),!1===t||isNaN(t)?m[i]:t)}function it(t,i,n){var r=sm(t),s=void 0===m[0];i=void 0===i||i,e.animate&&!s&&nm(d,e.cssClasses.tap,e.animationDuration),g.forEach((function(t){J(t,et(r[t],t),!0,!1,n)}));var o=1===g.length?0:1;if(s&&p.hasNoSize()&&(n=!0,m[0]=0,g.length>1)){var a=100/(g.length-1);g.forEach((function(t){m[t]=t*a}))}for(;o<g.length;++o)g.forEach((function(t){J(t,m[t],!0,!0,n)}));Q(),g.forEach((function(t){G("update",t),null!==r[t]&&i&&G("set",t)}))}function nt(t){if(void 0===t&&(t=!1),t)return 1===f.length?f[0]:f.slice(0);var i=f.map(e.format.to);return 1===i.length?i[0]:i}function rt(t){var i=m[t],n=p.getNearbySteps(i),r=f[t],s=n.thisStep.step,o=null;if(e.snap)return[r-n.stepBefore.startValue||null,n.stepAfter.startValue-r||null];!1!==s&&r+s>n.stepAfter.startValue&&(s=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===i?s=null:0===i&&(o=null);var a=p.countStepDecimals();return null!==s&&!1!==s&&(s=Number(s.toFixed(a))),null!==o&&!1!==o&&(o=Number(o.toFixed(a))),[o,s]}am(l=d,e.cssClasses.target),0===e.dir?am(l,e.cssClasses.ltr):am(l,e.cssClasses.rtl),0===e.ort?am(l,e.cssClasses.horizontal):am(l,e.cssClasses.vertical),am(l,"rtl"===getComputedStyle(l).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),n=E(l,e.cssClasses.base),function(t,i){var n=E(i,e.cssClasses.connects);r=[],(s=[]).push(T(n,t[0]));for(var o=0;o<e.handles;o++)r.push(S(i,o)),g[o]=o,s.push(T(n,t[o+1]))}(e.connect,n),(c=e.events).fixed||r.forEach((function(t,e){F(h.start,t.children[0],U,{handleNumbers:[e]})})),c.tap&&F(h.start,n,$,{}),c.hover&&F(h.move,n,H,{hover:!0}),c.drag&&s.forEach((function(t,i){if(!1!==t&&0!==i&&i!==s.length-1){var n=r[i-1],o=r[i],a=[t],l=[n,o],u=[i-1,i];am(t,e.cssClasses.draggable),c.fixed&&(a.push(n.children[0]),a.push(o.children[0])),c.dragAll&&(l=r,u=g),a.forEach((function(e){F(h.start,e,U,{handles:l,handleNumbers:u,connect:t})}))}})),it(e.start),e.pips&&z(e.pips),e.tooltips&&P(),W("update"+ym.aria),q("update"+ym.aria,(function(t,i,n,s,o){g.forEach((function(t){var i=r[t],s=Z(m,t,0,!0,!0,!0),a=Z(m,t,100,!0,!0,!0),l=o[t],c=String(e.ariaFormat.to(n[t]));s=p.fromStepping(s).toFixed(1),a=p.fromStepping(a).toFixed(1),l=p.fromStepping(l).toFixed(1),i.children[0].setAttribute("aria-valuemin",s),i.children[0].setAttribute("aria-valuemax",a),i.children[0].setAttribute("aria-valuenow",l),i.children[0].setAttribute("aria-valuetext",c)}))}));var st={destroy:function(){for(W(ym.aria),W(ym.tooltips),Object.keys(e.cssClasses).forEach((function(t){lm(d,e.cssClasses[t])}));d.firstChild;)d.removeChild(d.firstChild);delete d.noUiSlider},steps:function(){return g.map(rt)},on:q,off:W,get:nt,set:it,setHandle:function(t,e,i,n){if(!((t=Number(t))>=0&&t<g.length))throw new Error("noUiSlider: invalid handle number, got: "+t);J(t,et(e,t),!0,!0,n),G("update",t),i&&G("set",t)},reset:function(t){it(e.start,t)},disable:function(t){null!=t?(r[t].setAttribute("disabled",""),r[t].handle.removeAttribute("tabindex")):(d.setAttribute("disabled",""),r.forEach((function(t){t.handle.removeAttribute("tabindex")})))},enable:function(t){null!=t?(r[t].removeAttribute("disabled"),r[t].handle.setAttribute("tabindex","0")):(d.removeAttribute("disabled"),r.forEach((function(t){t.removeAttribute("disabled"),t.handle.setAttribute("tabindex","0")})))},__moveHandles:function(t,e,i){X(t,e,m,i)},options:i,updateOptions:function(t,n){var r=nt(),s=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];s.forEach((function(e){void 0!==t[e]&&(i[e]=t[e])}));var o=$m(i);s.forEach((function(i){void 0!==t[i]&&(e[i]=o[i])})),p=o.spectrum,e.margin=o.margin,e.limit=o.limit,e.padding=o.padding,e.pips?z(e.pips):L(),e.tooltips?P():k(),m=[],it(tm(t.start)?t.start:r,n)},target:d,removePips:L,removeTooltips:k,getPositions:function(){return m.slice()},getTooltips:function(){return a},getOrigins:function(){return r},pips:z};return st}function qm(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var i=Hm(t,$m(e),e);return t.noUiSlider=i,i}function Wm(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Gm=new WeakMap,Zm=new WeakMap,Ym=new WeakMap;function Xm(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var Km=new WeakMap,Qm=new WeakMap,Jm=new WeakMap;function tg(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var eg=new WeakMap;function ig(t){return t+.5|0}const ng=(t,e,i)=>Math.max(Math.min(t,i),e);function rg(t){return ng(ig(2.55*t),0,255)}function sg(t){return ng(ig(255*t),0,255)}function og(t){return ng(ig(t/2.55)/100,0,1)}function ag(t){return ng(ig(100*t),0,100)}const lg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},cg=[..."0123456789ABCDEF"],hg=t=>cg[15&t],ug=t=>cg[(240&t)>>4]+cg[15&t],dg=t=>(240&t)>>4==(15&t);function pg(t){var e=(t=>dg(t.r)&&dg(t.g)&&dg(t.b)&&dg(t.a))(t)?hg:ug;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const fg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function mg(t,e,i){const n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function gg(t,e,i){const n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function _g(t,e,i){const n=mg(t,1,.5);let r;for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function yg(t){const e=t.r/255,i=t.g/255,n=t.b/255,r=Math.max(e,i,n),s=Math.min(e,i,n),o=(r+s)/2;let a,l,c;return r!==s&&(c=r-s,l=o>.5?c/(2-r-s):c/(r+s),a=function(t,e,i,n,r){return t===r?(e-i)/n+(e<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(e,i,n,c,r),a=60*a+.5),[0|a,l||0,o]}function vg(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(sg)}function bg(t,e,i){return vg(mg,t,e,i)}function xg(t){return(t%360+360)%360}function wg(t){const e=fg.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?rg(+e[5]):sg(+e[5]));const r=xg(+e[2]),s=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return vg(_g,t,e,i)}(r,s,o):"hsv"===e[1]?function(t,e,i){return vg(gg,t,e,i)}(r,s,o):bg(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}const Eg={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Sg={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Tg;function Mg(t){Tg||(Tg=function(){const t={},e=Object.keys(Sg),i=Object.keys(Eg);let n,r,s,o,a;for(n=0;n<e.length;n++){for(o=a=e[n],r=0;r<i.length;r++)s=i[r],a=a.replace(s,Eg[s]);s=parseInt(Sg[o],16),t[a]=[s>>16&255,s>>8&255,255&s]}return t}(),Tg.transparent=[0,0,0,0]);const e=Tg[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const Ag=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Cg=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,kg=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Pg(t,e,i){if(t){let n=yg(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=bg(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function Ig(t,e){return t?Object.assign(e||{},t):t}function Dg(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=sg(t[3]))):(e=Ig(t,{r:0,g:0,b:0,a:1})).a=sg(e.a),e}function Og(t){return"r"===t.charAt(0)?function(t){const e=Ag.exec(t);let i,n,r,s=255;if(e){if(e[7]!==i){const t=+e[7];s=e[8]?rg(t):ng(255*t,0,255)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?rg(i):ng(i,0,255)),n=255&(e[4]?rg(n):ng(n,0,255)),r=255&(e[6]?rg(r):ng(r,0,255)),{r:i,g:n,b:r,a:s}}}(t):wg(t)}class Lg{constructor(t){if(t instanceof Lg)return t;const e=typeof t;let i;var n,r,s;"object"===e?i=Dg(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*lg[n[1]],g:255&17*lg[n[2]],b:255&17*lg[n[3]],a:5===s?17*lg[n[4]]:255}:7!==s&&9!==s||(r={r:lg[n[1]]<<4|lg[n[2]],g:lg[n[3]]<<4|lg[n[4]],b:lg[n[5]]<<4|lg[n[6]],a:9===s?lg[n[7]]<<4|lg[n[8]]:255})),i=r||Mg(t)||Og(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ig(this._rgb);return t&&(t.a=og(t.a)),t}set rgb(t){this._rgb=Dg(t)}rgbString(){return this._valid?function(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${og(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}(this._rgb):void 0}hexString(){return this._valid?pg(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=yg(t),i=e[0],n=ag(e[1]),r=ag(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${og(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let r;const s=e===r?.5:e,o=2*s-1,a=i.a-n.a,l=((o*a==-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,i.r=255&l*i.r+r*n.r+.5,i.g=255&l*i.g+r*n.g+.5,i.b=255&l*i.b+r*n.b+.5,i.a=s*i.a+(1-s)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=kg(og(t.r)),r=kg(og(t.g)),s=kg(og(t.b));return{r:sg(Cg(n+i*(kg(og(e.r))-n))),g:sg(Cg(r+i*(kg(og(e.g))-r))),b:sg(Cg(s+i*(kg(og(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Lg(this.rgb)}alpha(t){return this._rgb.a=sg(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=ig(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Pg(this._rgb,2,t),this}darken(t){return Pg(this._rgb,2,-t),this}saturate(t){return Pg(this._rgb,1,t),this}desaturate(t){return Pg(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=yg(t);i[0]=xg(i[0]+e),i=bg(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zg(){}const Rg=(()=>{let t=0;return()=>t++})();function Fg(t){return null==t}function Bg(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Ng(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function jg(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Vg(t,e){return jg(t)?t:e}function Ug(t,e){return void 0===t?e:t}const $g=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Hg(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function qg(t,e,i,n){let r,s,o;if(Bg(t))if(s=t.length,n)for(r=s-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<s;r++)e.call(i,t[r],r);else if(Ng(t))for(o=Object.keys(t),s=o.length,r=0;r<s;r++)e.call(i,t[o[r]],o[r])}function Wg(t,e){let i,n,r,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],s=e[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Gg(t){if(Bg(t))return t.map(Gg);if(Ng(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let r=0;for(;r<n;++r)e[i[r]]=Gg(t[i[r]]);return e}return t}function Zg(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Yg(t,e,i,n){if(!Zg(t))return;const r=e[t],s=i[t];Ng(r)&&Ng(s)?Xg(r,s,n):e[t]=Gg(s)}function Xg(t,e,i){const n=Bg(e)?e:[e],r=n.length;if(!Ng(t))return t;const s=(i=i||{}).merger||Yg;let o;for(let e=0;e<r;++e){if(o=n[e],!Ng(o))continue;const r=Object.keys(o);for(let e=0,n=r.length;e<n;++e)s(r[e],t,o,i)}return t}function Kg(t,e){return Xg(t,e,{merger:Qg})}function Qg(t,e,i){if(!Zg(t))return;const n=e[t],r=i[t];Ng(n)&&Ng(r)?Kg(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Gg(r))}const Jg={"":t=>t,x:t=>t.x,y:t=>t.y};function t_(t,e){const i=Jg[e]||(Jg[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function e_(t){return t.charAt(0).toUpperCase()+t.slice(1)}const i_=t=>void 0!==t,n_=t=>"function"==typeof t,r_=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const s_=Math.PI,o_=2*s_,a_=o_+s_,l_=Number.POSITIVE_INFINITY,c_=s_/180,h_=s_/2,u_=s_/4,d_=2*s_/3,p_=Math.log10,f_=Math.sign;function m_(t,e,i){return Math.abs(t-e)<i}function g_(t){const e=Math.round(t);t=m_(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(p_(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function __(t){return!isNaN(parseFloat(t))&&isFinite(t)}function y_(t,e,i){let n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function v_(t){return t*(s_/180)}function b_(t){return t*(180/s_)}function x_(t){if(!jg(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function w_(t,e){const i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*s_&&(s+=o_),{angle:s,distance:r}}function E_(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function S_(t,e){return(t-e+a_)%o_-s_}function T_(t){return(t%o_+o_)%o_}function M_(t,e,i,n){const r=T_(t),s=T_(e),o=T_(i),a=T_(s-r),l=T_(o-r),c=T_(r-s),h=T_(r-o);return r===s||r===o||n&&s===o||a>l&&c<h}function A_(t,e,i){return Math.max(e,Math.min(i,t))}function C_(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function k_(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const P_=(t,e,i,n)=>k_(t,i,n?n=>{const r=t[n][e];return r<i||r===i&&t[n+1][e]===i}:n=>t[n][e]<i),I_=(t,e,i)=>k_(t,i,(n=>t[n][e]>=i));const D_=["push","pop","shift","splice","unshift"];function O_(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(D_.forEach((e=>{delete t[e]})),delete t._chartjs)}function L_(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const z_="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function R_(t,e){let i=[],n=!1;return function(...r){i=r,n||(n=!0,z_.call(window,(()=>{n=!1,t.apply(e,i)})))}}const F_=t=>"start"===t?"left":"end"===t?"right":"center",B_=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function N_(t,e,i){const n=e.length;let r=0,s=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(r=A_(Math.min(P_(a,l,c).lo,i?n:P_(e,l,o.getPixelForValue(c)).lo),0,n-1)),s=d?A_(Math.max(P_(a,o.axis,h,!0).hi+1,i?0:P_(e,l,o.getPixelForValue(h),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function j_(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}const V_=t=>0===t||1===t,U_=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*o_/i),$_=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*o_/i)+1,H_={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*h_),easeOutSine:t=>Math.sin(t*h_),easeInOutSine:t=>-.5*(Math.cos(s_*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>V_(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>V_(t)?t:U_(t,.075,.3),easeOutElastic:t=>V_(t)?t:$_(t,.075,.3),easeInOutElastic(t){const e=.1125;return V_(t)?t:t<.5?.5*U_(2*t,e,.45):.5+.5*$_(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-H_.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*H_.easeInBounce(2*t):.5*H_.easeOutBounce(2*t-1)+.5};function q_(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function W_(t){return q_(t)?t:new Lg(t)}function G_(t){return q_(t)?t:new Lg(t).saturate(.5).darken(.1).hexString()}const Z_=["x","y","borderWidth","radius","tension"],Y_=["color","borderColor","backgroundColor"];const X_=new Map;function K_(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=X_.get(i);return n||(n=new Intl.NumberFormat(t,e),X_.set(i,n)),n}(e,i).format(t)}const Q_={values(t){return Bg(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let r,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const o=p_(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),K_(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(p_(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Q_.numeric.call(this,t,e,i):""}};var J_={formatters:Q_};const ty=Object.create(null),ey=Object.create(null);function iy(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function ny(t,e,i){return"string"==typeof e?Xg(iy(t,e),i):Xg(iy(t,""),e)}class ry{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>G_(e.backgroundColor),this.hoverBorderColor=(t,e)=>G_(e.borderColor),this.hoverColor=(t,e)=>G_(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ny(this,t,e)}get(t){return iy(this,t)}describe(t,e){return ny(ey,t,e)}override(t,e){return ny(ty,t,e)}route(t,e,i,n){const r=iy(this,t),s=iy(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=s[n];return Ng(t)?Object.assign({},e,t):Ug(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var sy=new ry({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Y_},numbers:{type:"number",properties:Z_}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:J_.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function oy(t,e,i,n,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,i.push(r)),s>n&&(n=s),n}function ay(t,e,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,u,d;for(l=0;l<a;l++)if(u=i[l],null==u||Bg(u)){if(Bg(u))for(c=0,h=u.length;c<h;c++)d=u[c],null==d||Bg(d)||(o=oy(t,r,s,o,d))}else o=oy(t,r,s,o,u);t.restore();const p=s.length/2;if(p>i.length){for(l=0;l<p;l++)delete r[s[l]];s.splice(0,p)}return o}function ly(t,e,i){const n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function cy(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function hy(t,e,i,n){uy(t,e,i,n,null)}function uy(t,e,i,n,r){let s,o,a,l,c,h,u,d;const p=e.pointStyle,f=e.rotation,m=e.radius;let g=(f||0)*c_;if(p&&"object"==typeof p&&(s=p.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,n),t.rotate(g),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void t.restore();if(!(isNaN(m)||m<=0)){switch(t.beginPath(),p){default:r?t.ellipse(i,n,r/2,m,0,0,o_):t.arc(i,n,m,0,o_),t.closePath();break;case"triangle":h=r?r/2:m,t.moveTo(i+Math.sin(g)*h,n-Math.cos(g)*m),g+=d_,t.lineTo(i+Math.sin(g)*h,n-Math.cos(g)*m),g+=d_,t.lineTo(i+Math.sin(g)*h,n-Math.cos(g)*m),t.closePath();break;case"rectRounded":c=.516*m,l=m-c,o=Math.cos(g+u_)*l,u=Math.cos(g+u_)*(r?r/2-c:l),a=Math.sin(g+u_)*l,d=Math.sin(g+u_)*(r?r/2-c:l),t.arc(i-u,n-a,c,g-s_,g-h_),t.arc(i+d,n-o,c,g-h_,g),t.arc(i+u,n+a,c,g,g+h_),t.arc(i-d,n+o,c,g+h_,g+s_),t.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*m,h=r?r/2:l,t.rect(i-h,n-l,2*h,2*l);break}g+=u_;case"rectRot":u=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(i-u,n-a),t.lineTo(i+d,n-o),t.lineTo(i+u,n+a),t.lineTo(i-d,n+o),t.closePath();break;case"crossRot":g+=u_;case"cross":u=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+d,n-o),t.lineTo(i-d,n+o);break;case"star":u=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+d,n-o),t.lineTo(i-d,n+o),g+=u_,u=Math.cos(g)*(r?r/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+d,n-o),t.lineTo(i-d,n+o);break;case"line":o=r?r/2:Math.cos(g)*m,a=Math.sin(g)*m,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(g)*(r?r/2:m),n+Math.sin(g)*m);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function dy(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function py(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function fy(t){t.restore()}function my(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function gy(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function _y(t,e,i,n,r){if(r.strikethrough||r.underline){const s=t.measureText(n),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,c=i+s.actualBoundingBoxDescent,h=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,h),t.lineTo(a,h),t.stroke()}}function yy(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function vy(t,e,i,n,r,s={}){const o=Bg(e)?e:[e],a=s.strokeWidth>0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Fg(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&yy(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Fg(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(c,i,n,s.maxWidth)),t.fillText(c,i,n,s.maxWidth),_y(t,i,n,c,s),n+=Number(r.lineHeight);t.restore()}function by(t,e){const{x:i,y:n,w:r,h:s,radius:o}=e;t.arc(i+o.topLeft,n+o.topLeft,o.topLeft,1.5*s_,s_,!0),t.lineTo(i,n+s-o.bottomLeft),t.arc(i+o.bottomLeft,n+s-o.bottomLeft,o.bottomLeft,s_,h_,!0),t.lineTo(i+r-o.bottomRight,n+s),t.arc(i+r-o.bottomRight,n+s-o.bottomRight,o.bottomRight,h_,0,!0),t.lineTo(i+r,n+o.topRight),t.arc(i+r-o.topRight,n+o.topRight,o.topRight,0,-h_,!0),t.lineTo(i+o.topLeft,n)}const xy=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,wy=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ey(t,e){const i=(""+t).match(xy);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const Sy=t=>+t||0;function Ty(t,e){const i={},n=Ng(e),r=n?Object.keys(e):e,s=Ng(t)?n?i=>Ug(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of r)i[t]=Sy(s(t));return i}function My(t){return Ty(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ay(t){return Ty(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Cy(t){const e=My(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ky(t,e){t=t||{},e=e||sy.font;let i=Ug(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Ug(t.style,e.style);n&&!(""+n).match(wy)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:Ug(t.family,e.family),lineHeight:Ey(Ug(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Ug(t.weight,e.weight),string:""};return r.string=function(t){return!t||Fg(t.size)||Fg(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function Py(t,e,i,n){let r,s,o,a=!0;for(r=0,s=t.length;r<s;++r)if(o=t[r],void 0!==o&&(void 0!==e&&"function"==typeof o&&(o=o(e),a=!1),void 0!==i&&Bg(o)&&(o=o[i%o.length],a=!1),void 0!==o))return n&&!a&&(n.cacheable=!1),o}function Iy(t,e){return Object.assign(Object.create(t),e)}function Dy(t,e=[""],i,n,r=(()=>t[0])){const s=i||t;void 0===n&&(n=$y("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:n,_getTarget:r,override:i=>Dy([i,...t],e,s,n)};return new Proxy(o,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return Fy(i,n,(()=>function(t,e,i,n){let r;for(const s of e)if(r=$y(zy(s,t),i),void 0!==r)return Ry(t,r)?Vy(i,n,t,r):r}(n,e,t,i)))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return Hy(t).includes(e)},ownKeys(t){return Hy(t)},set(t,e,i){const n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Oy(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ly(t,n),setContext:e=>Oy(t,e,i,n),override:r=>Oy(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return Fy(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=t;let a=n[e];n_(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(s,o||n);a.delete(t),Ry(t,l)&&(l=Vy(r._scopes,r,t,l));return l}(e,a,t,i));Bg(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(void 0!==s.index&&n(t))return e[s.index%e.length];if(Ng(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Vy(n,r,t,l);e.push(Oy(i,s,o&&o[t],a))}}return e}(e,a,t,o.isIndexable));Ry(e,a)&&(a=Oy(a,r,s&&s[e],o));return a}(t,e,i)))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function Ly(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:n_(i)?i:()=>i,isIndexable:n_(n)?n:()=>n}}const zy=(t,e)=>t?t+e_(e):e,Ry=(t,e)=>Ng(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Fy(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function By(t,e,i){return n_(t)?t(e,i):t}const Ny=(t,e)=>!0===t?e:"string"==typeof t?t_(e,t):void 0;function jy(t,e,i,n,r){for(const s of e){const e=Ny(i,s);if(e){t.add(e);const s=By(e._fallback,i,r);if(void 0!==s&&s!==i&&s!==n)return s}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Vy(t,e,i,n){const r=e._rootScopes,s=By(e._fallback,i,n),o=[...t,...r],a=new Set;a.add(n);let l=Uy(a,o,i,s||i,n);return null!==l&&((void 0===s||s===i||(l=Uy(a,o,s,l,n),null!==l))&&Dy(Array.from(a),[""],r,s,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];if(Bg(r)&&Ng(i))return i;return r||{}}(e,i,n))))}function Uy(t,e,i,n,r){for(;i;)i=jy(t,e,i,n,r);return i}function $y(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Hy(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function qy(t,e,i,n){const{iScale:r}=t,{key:s="r"}=this._parsing,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],o[a]={r:r.parse(t_(h,s),c)};return o}const Wy=Number.EPSILON||1e-14,Gy=(t,e)=>e<t.length&&!t[e].skip&&t[e],Zy=t=>"x"===t?"y":"x";function Yy(t,e,i,n){const r=t.skip?e:t,s=e,o=i.skip?e:i,a=E_(s,r),l=E_(o,s);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=n*c,d=n*h;return{previous:{x:s.x-u*(o.x-r.x),y:s.y-u*(o.y-r.y)},next:{x:s.x+d*(o.x-r.x),y:s.y+d*(o.y-r.y)}}}function Xy(t,e="x"){const i=Zy(e),n=t.length,r=Array(n).fill(0),s=Array(n);let o,a,l,c=Gy(t,0);for(o=0;o<n;++o)if(a=l,l=c,c=Gy(t,o+1),l){if(c){const t=c[e]-l[e];r[o]=0!==t?(c[i]-l[i])/t:0}s[o]=a?c?f_(r[o-1])!==f_(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}!function(t,e,i){const n=t.length;let r,s,o,a,l,c=Gy(t,0);for(let h=0;h<n-1;++h)l=c,c=Gy(t,h+1),l&&c&&(m_(e[h],0,Wy)?i[h]=i[h+1]=0:(r=i[h]/e[h],s=i[h+1]/e[h],a=Math.pow(r,2)+Math.pow(s,2),a<=9||(o=3/Math.sqrt(a),i[h]=r*o*e[h],i[h+1]=s*o*e[h])))}(t,r,s),function(t,e,i="x"){const n=Zy(i),r=t.length;let s,o,a,l=Gy(t,0);for(let c=0;c<r;++c){if(o=a,a=l,l=Gy(t,c+1),!a)continue;const r=a[i],h=a[n];o&&(s=(r-o[i])/3,a[`cp1${i}`]=r-s,a[`cp1${n}`]=h-s*e[c]),l&&(s=(l[i]-r)/3,a[`cp2${i}`]=r+s,a[`cp2${n}`]=h+s*e[c])}}(t,s,e)}function Ky(t,e,i){return Math.max(Math.min(t,i),e)}function Qy(t,e,i,n,r){let s,o,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Xy(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,o=t.length;s<o;++s)a=t[s],l=Yy(i,a,t[Math.min(s+1,o-(n?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,r,s,o,a=dy(t[0],e);for(i=0,n=t.length;i<n;++i)o=s,s=a,a=i<n-1&&dy(t[i+1],e),s&&(r=t[i],o&&(r.cp1x=Ky(r.cp1x,e.left,e.right),r.cp1y=Ky(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=Ky(r.cp2x,e.left,e.right),r.cp2y=Ky(r.cp2y,e.top,e.bottom)))}(t,i)}function Jy(){return"undefined"!=typeof window&&"undefined"!=typeof document}function tv(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ev(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const iv=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const nv=["top","right","bottom","left"];function rv(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=nv[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const sv=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ov(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,r=iv(i),s="border-box"===r.boxSizing,o=rv(r,"padding"),a=rv(r,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:r,offsetY:s}=n;let o,a,l=!1;if(sv(r,s,t.target))o=r,a=s;else{const t=e.getBoundingClientRect();o=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:o,y:a,box:l}}(t,i),u=o.left+(h&&a.left),d=o.top+(h&&a.top);let{width:p,height:f}=e;return s&&(p-=o.width+a.width,f-=o.height+a.height),{x:Math.round((l-u)/p*i.width/n),y:Math.round((c-d)/f*i.height/n)}}const av=t=>Math.round(10*t)/10;function lv(t,e,i,n){const r=iv(t),s=rv(r,"margin"),o=ev(r.maxWidth,t,"clientWidth")||l_,a=ev(r.maxHeight,t,"clientHeight")||l_,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const s=tv(t);if(s){const t=s.getBoundingClientRect(),o=iv(s),a=rv(o,"border","width"),l=rv(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=ev(o.maxWidth,s,"clientWidth"),r=ev(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||l_,maxHeight:r||l_}}(t,e,i);let{width:c,height:h}=l;if("content-box"===r.boxSizing){const t=rv(r,"border","width"),e=rv(r,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-s.width),h=Math.max(0,n?c/n:h-s.height),c=av(Math.min(c,o,l.maxWidth)),h=av(Math.min(h,a,l.maxHeight)),c&&!h&&(h=av(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=av(Math.floor(h*n))),{width:c,height:h}}function cv(t,e,i){const n=e||1,r=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||o.height!==r||o.width!==s)&&(t.currentDevicePixelRatio=n,o.height=r,o.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const hv=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Jy()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function uv(t,e){const i=function(t,e){return iv(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function dv(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function pv(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function fv(t,e,i,n){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=dv(t,r,i),a=dv(r,s,i),l=dv(s,e,i),c=dv(o,a,i),h=dv(a,l,i);return dv(c,h,i)}function mv(t,e,i){return t?function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}}(e,i):{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}}function gv(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function _v(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function yv(t){return"angle"===t?{between:M_,compare:S_,normalize:T_}:{between:C_,compare:(t,e)=>t-e,normalize:t=>t}}function vv({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function bv(t,e,i){if(!i)return[t];const{property:n,start:r,end:s}=i,o=e.length,{compare:a,between:l,normalize:c}=yv(n),{start:h,end:u,loop:d,style:p}=function(t,e,i){const{property:n,start:r,end:s}=i,{between:o,normalize:a}=yv(n),l=e.length;let c,h,{start:u,end:d,loop:p}=t;if(p){for(u+=l,d+=l,c=0,h=l;c<h&&o(a(e[u%l][n]),r,s);++c)u--,d--;u%=l,d%=l}return d<u&&(d+=l),{start:u,end:d,loop:p,style:t.style}}(t,e,i),f=[];let m,g,_,y=!1,v=null;const b=()=>y||l(r,_,m)&&0!==a(r,_),x=()=>!y||0===a(s,m)||l(s,_,m);for(let t=h,i=h;t<=u;++t)g=e[t%o],g.skip||(m=c(g[n]),m!==_&&(y=l(m,r,s),null===v&&b()&&(v=0===a(m,r)?t:i),null!==v&&x()&&(f.push(vv({start:v,end:t,loop:d,count:o,style:p})),v=null),i=t,_=m));return null!==v&&f.push(vv({start:v,end:u,loop:d,count:o,style:p})),f}function xv(t,e){const i=[],n=t.segments;for(let r=0;r<n.length;r++){const s=bv(n[r],t.points,e);s.length&&i.push(...s)}return i}function wv(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const r=t._chart.getContext(),s=Ev(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=s,u=e[0].start,d=u;function p(t,e,n,r){const s=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:r}),h=r,u=e%l)}}for(const t of e){u=a?u:t.start;let e,s=i[u%l];for(d=u+1;d<=t.end;d++){const a=i[d%l];e=Ev(n.setContext(Iy(r,{type:"segment",p0:s,p1:a,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),Sv(e,h)&&p(u,d-1,t.loop,h),s=a,h=e}u<d-1&&p(u,d-1,t.loop,h)}return c}(t,e,i,n):e}function Ev(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Sv(t,e){if(!e)return!1;const i=[],n=function(t,e){return q_(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}class Tv{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const r=e.listeners[n],s=e.duration;r.forEach((n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=z_.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const r=i.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Mv=new Tv;const Av="transparent",Cv={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const n=W_(t||Av),r=n.valid&&W_(e||Av);return r&&r.valid?r.mix(n,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class kv{constructor(t,e,i,n){const r=e[i];n=Py([t.to,n,r,t.from]);const s=Py([t.from,r,n]);this._active=!0,this._fn=t.fn||Cv[t.type||typeof s],this._easing=H_[t.easing]||H_.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Py([t.to,e,n,t.from]),this._from=Py([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||e<i),!this._active)return this._target[n]=o,void this._notify(!0);e<0?this._target[n]=r:(a=e/i%2,a=s&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(r,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class Pv{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Ng(t))return;const e=Object.keys(sy.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const r=t[n];if(!Ng(r))return;const s={};for(const t of e)s[t]=r[t];(Bg(r.properties)&&r.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,s)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const r=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const r=t[n[e]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),r}_createAnimations(t,e){const i=this._properties,n=[],r=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=r[l];const u=i.get(l);if(h){if(u&&h.active()){h.update(u,c,o);continue}h.cancel()}u&&u.duration?(r[l]=h=new kv(u,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Mv.add(this._chart,i),!0):void 0}}function Iv(t,e){const i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:r,end:n?r:s}}function Dv(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=n.length;r<s;++r)i.push(n[r].index);return i}function Ov(t,e,i,n={}){const r=t.keys,s="single"===n.mode;let o,a,l,c;if(null!==e){for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===i){if(n.all)continue;break}c=t.values[l],jg(c)&&(s||0===e||f_(e)===f_(c))&&(e+=c)}return e}}function Lv(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function zv(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Rv(t,e,i,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function Fv(t,e){const{chart:i,_cachedMeta:n}=t,r=i._stacks||(i._stacks={}),{iScale:s,vScale:o,index:a}=n,l=s.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,o,n),u=e.length;let d;for(let t=0;t<u;++t){const i=e[t],{[l]:s,[c]:u}=i;d=(i._stacks||(i._stacks={}))[c]=zv(r,h,s),d[a]=u,d._top=Rv(d,o,!0,n.type),d._bottom=Rv(d,o,!1,n.type);(d._visualValues||(d._visualValues={}))[a]=u}}function Bv(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Nv(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const jv=t=>"reset"===t||"none"===t,Vv=(t,e)=>e?t:Object.assign({},t);class Uv{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Lv(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Nv(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=Ug(i.xAxisID,Bv(t,"x")),s=e.yAxisID=Ug(i.yAxisID,Bv(t,"y")),o=e.rAxisID=Ug(i.rAxisID,Bv(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,r,s,o),c=e.vAxisID=n(a,s,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&O_(this._data,this),t._stacked&&Nv(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Ng(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],i[n]={x:s,y:t[s]};return i}(e);else if(i!==e){if(i){O_(i,this);const t=this._cachedMeta;Nv(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(n=e)._chartjs?n._chartjs.listeners.push(r):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),D_.forEach((t=>{const e="_onData"+e_(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const r=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),r}})})))),this._syncList=[],this._data=e}var n,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const r=e._stacked;e._stacked=Lv(e.vScale,e),e.stack!==i.stack&&(n=!0,Nv(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&Fv(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:s}=i,o=r.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Bg(n[t])?this.parseArrayData(i,n,t,e):Ng(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[o]||u&&l[o]<u[o];for(a=0;a<e;++a)i._parsed[a+t]=l=c[a],h&&(r()&&(h=!1),u=l);i._sorted=h}s&&Fv(this,c)}parsePrimitiveData(t,e,i,n){const{iScale:r,vScale:s}=t,o=r.axis,a=s.axis,l=r.getLabels(),c=r===s,h=new Array(n);let u,d,p;for(u=0,d=n;u<d;++u)p=u+i,h[u]={[o]:c||r.parse(l[p],p),[a]:s.parse(e[p],p)};return h}parseArrayData(t,e,i,n){const{xScale:r,yScale:s}=t,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],o[a]={x:r.parse(h[0],c),y:s.parse(h[1],c)};return o}parseObjectData(t,e,i,n){const{xScale:r,yScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let c,h,u,d;for(c=0,h=n;c<h;++c)u=c+i,d=e[u],l[c]={x:r.parse(t_(d,o),u),y:s.parse(t_(d,a),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,r=this._cachedMeta,s=e[t.axis];return Ov({keys:Dv(n,!0),values:e._stacks[t.axis]._visualValues},s,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const r=i[e.axis];let s=null===r?NaN:r;const o=n&&i._stacks[e.axis];n&&o&&(n.values=o,s=Ov(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,r=i._sorted&&t===i.iScale,s=n.length,o=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Dv(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(o);let u,d;function p(){d=n[u];const e=d[o.axis];return!jg(d[t.axis])||c>e||h<e}for(u=0;u<s&&(p()||(this.updateRangeFromParsed(l,t,d,a),!r));++u);if(r)for(u=s-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(l,t,d,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n][t.axis],jg(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,r;return Ng(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(Ug(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=Iv(t,i),r=Iv(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],r=e.chartArea,s=[],o=this._drawStart||0,a=this._drawCount||n.length-o,l=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(t,r,o,a),c=o;c<o+a;++c){const e=n[c];e.hidden||(e.active&&l?s.push(e):e.draw(t,r))}for(c=0;c<s.length;++c)s[c].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,i){return Iy(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return Iy(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,r=this._cachedDataOpts,s=t+"-"+e,o=r[s],a=this.enableOptionSharing&&i_(i);if(o)return Vv(o,a);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),h=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),c),d=Object.keys(sy.elements[t]),p=l.resolveNamedOptions(u,d,(()=>this.getContext(i,n,e)),h);return p.$shared&&(p.$shared=a,r[s]=Object.freeze(Vv(p,a))),p}_resolveAnimations(t,e,i){const n=this.chart,r=this._cachedDataOpts,s=`animation-${e}`,o=r[s];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,r=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),r);a=n.createResolver(s,this.getContext(t,i,e))}const l=new Pv(n,a&&a.animations);return a&&a._cacheable&&(r[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||jv(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:s}}updateElement(t,e,i,n){jv(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!jv(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,r=e.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){const n=this._cachedMeta,r=n.data,s=t+e;let o;const a=t=>{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;o<s;++o)r[o]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&Nv(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function $v(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=L_(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(i_(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;n<r;++n)s=e.getPixelForValue(i[n]),l();for(o=void 0,n=0,r=e.ticks.length;n<r;++n)s=e.getPixelForTick(n),l();return a}function Hv(t,e,i,n){return Bg(t)?function(t,e,i,n){const r=i.parse(t[0],n),s=i.parse(t[1],n),o=Math.min(r,s),a=Math.max(r,s);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:s,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function qv(t,e,i,n){const r=t.iScale,s=t.vScale,o=r.getLabels(),a=r===s,l=[];let c,h,u,d;for(c=i,h=i+n;c<h;++c)d=e[c],u={},u[r.axis]=a||r.parse(o[c],c),l.push(Hv(d,u,s,c));return l}function Wv(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Gv(t,e,i,n){let r=e.borderSkipped;const s={};if(!r)return void(t.borderSkipped=s);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:l,top:c,bottom:h}=function(t){let e,i,n,r,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:e,top:r,bottom:s}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=c:(i._bottom||0)===n?r=h:(s[Zv(h,o,a,l)]=!0,r=c)),s[Zv(r,o,a,l)]=!0,t.borderSkipped=s}function Zv(t,e,i,n){var r,s,o;return n?(o=i,t=Yv(t=(r=t)===(s=e)?o:r===o?s:r,i,e)):t=Yv(t,e,i),t}function Yv(t,e,i){return"start"===t?e:"end"===t?i:t}function Xv(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class Kv extends Uv{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,o=t=>+i[t];if(Ng(i[t])){const{key:t="value"}=this._parsing;o=e=>+t_(i[e],t)}for(r=t,s=t+e;r<s;++r)n._parsed[r]=o(r)}}_getRotation(){return v_(this.options.rotation-90)}_getCircumference(){return v_(this.options.circumference)}_getRotationExtents(){let t=o_,e=-o_;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),a=Math.min((l=this.options.cutout,c=o,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const h=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(t,e,i){let n=1,r=1,s=0,o=0;if(e<o_){const a=t,l=a+e,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),p=(t,e,n)=>M_(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),f=(t,e,n)=>M_(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),m=p(0,c,u),g=p(h_,h,d),_=f(s_,c,u),y=f(s_+h_,h,d);n=(m-_)/2,r=(g-y)/2,s=-(m+_)/2,o=-(g+y)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:o}}(d,u,a),_=(i.width-s)/p,y=(i.height-s)/f,v=Math.max(Math.min(_,y)/2,0),b=$g(this.options.radius,v),x=(b-Math.max(b*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*b,this.offsetY=g*b,n.total=this.calculateTotal(),this.outerRadius=b-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*h,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/o_)}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.chartArea,a=s.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=r&&a.animateScale,u=h?0:this.innerRadius,d=h?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(e,n);let m,g=this._getRotation();for(m=0;m<e;++m)g+=this._circumference(m,r);for(m=e;m<e+i;++m){const e=this._circumference(m,r),i=t[m],s={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+e,circumference:e,outerRadius:d,innerRadius:u};f&&(s.options=p||this.resolveDataElementOptions(m,i.active?"active":n)),g+=e,this.updateElement(i,m,s,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const r=t._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?o_*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=K_(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,r,s,o,a;if(!t)for(n=0,r=i.data.datasets.length;n<r;++n)if(i.isDatasetVisible(n)){s=i.getDatasetMeta(n),t=s.data,o=s.controller;break}if(!t)return 0;for(n=0,r=t.length;n<r;++n)a=o.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Ug(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Qv extends Uv{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=K_(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return qy.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*s_;let u,d=h;const p=360/this.countVisibleElements();for(u=0;u<e;++u)d+=this._computeAngle(u,n,p);for(u=e;u<e+i;u++){const e=t[u];let i=d,f=d+this._computeAngle(u,n,p),m=s.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;d=f,r&&(o.animateScale&&(m=0),o.animateRotate&&(i=f=h));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:i,endAngle:f,options:this.resolveDataElementOptions(u,e.active?"active":n)};this.updateElement(e,u,g,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?v_(this.resolveDataElementOptions(t,e).angle||i):0}}var Jv=Object.freeze({__proto__:null,BarController:class extends Uv{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return qv(t,e,i,n)}parseArrayData(t,e,i,n){return qv(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:r,vScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l="x"===r.axis?o:a,c="x"===s.axis?o:a,h=[];let u,d,p,f;for(u=i,d=i+n;u<d;++u)f=e[u],p={},p[r.axis]=r.parse(t_(f,l),u),h.push(Hv(t_(f,c),p,s,u));return h}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),s=r._custom,o=Wv(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const r="reset"===n,{index:s,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),l=o.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n);for(let d=e;d<e+i;d++){const e=this.getParsed(d),i=r||Fg(e[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(d),p=this._calculateBarIndexPixels(d,c),f=(e._stacks||{})[o.axis],m={horizontal:l,base:i.base,enableBorderRadius:!f||Wv(e._custom)||s===f._top||s===f._bottom,x:l?i.head:p.center,y:l?p.center:i.head,height:l?p.size:Math.abs(i.size),width:l?Math.abs(i.size):p.size};u&&(m.options=h||this.resolveDataElementOptions(d,t[d].active?"active":n));const g=m.options||t[d].options;Gv(m,g,f,s),Xv(m,g,c.ratio),this.updateElement(t[d],d,m,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),r=i.options.stacked,s=[],o=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(Fg(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!o(i))&&((!1===r||-1===s.indexOf(i.stack)||void 0===r&&void 0===i.stack)&&s.push(i.stack),i.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let r,s;for(r=0,s=e.data.length;r<s;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||$v(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:r,minBarLength:s}}=this,o=r||0,a=this.getParsed(t),l=a._custom,c=Wv(l);let h,u,d=a[e.axis],p=0,f=i?this.applyStack(e,a,i):d;f!==d&&(p=f-d,f=d),c&&(d=l.barStart,f=l.barEnd-l.barStart,0!==d&&f_(d)!==f_(l.barEnd)&&(p=0),p+=d);const m=Fg(r)||c?p:r;let g=e.getPixelForValue(m);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(p+f):g,u=h-g,Math.abs(u)<s){u=function(t,e,i){return 0!==t?f_(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,o)*s,d===o&&(g-=u/2);const t=e.getPixelForDecimal(0),r=e.getPixelForDecimal(1),l=Math.min(t,r),p=Math.max(t,r);g=Math.max(Math.min(g,p),l),h=g+u,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(g))}if(g===e.getPixelForValue(o)){const t=f_(u)*e.getLineWidthForValue(o)/2;g+=t,u-=t}return{size:u,base:g,head:h,center:h+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,r=n.skipNull,s=Ug(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=r?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const r=e.pixels,s=r[t];let o=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const l=i.categoryPercentage;null===o&&(o=s-(null===a?e.end-e.start:a-s)),null===a&&(a=s+s-o);const c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:i.barPercentage,start:c}}(t,e,n,i):function(t,e,i,n){const r=i.barThickness;let s,o;return Fg(r)?(s=e.min*i.categoryPercentage,o=i.barPercentage):(s=r*n,o=1),{chunk:s/n,ratio:o,start:e.pixels[t]-s/2}}(t,e,n,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);o=l.start+l.chunk*c+l.chunk/2,a=Math.min(s,l.chunk*l.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(s,e.min*e.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}},BubbleController:class extends Uv{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const r=super.parsePrimitiveData(t,e,i,n);for(let t=0;t<r.length;t++)r[t]._custom=this.resolveDataElementOptions(t+i).radius;return r}parseArrayData(t,e,i,n){const r=super.parseArrayData(t,e,i,n);for(let t=0;t<r.length;t++){const n=e[i+t];r[t]._custom=Ug(n[2],this.resolveDataElementOptions(t+i).radius)}return r}parseObjectData(t,e,i,n){const r=super.parseObjectData(t,e,i,n);for(let t=0;t<r.length;t++){const n=e[i+t];r[t]._custom=Ug(n&&n.r&&+n.r,this.resolveDataElementOptions(t+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y),l=s._custom;return{label:i[t]||"",value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=s.axis,h=o.axis;for(let u=e;u<e+i;u++){const e=t[u],i=!r&&this.getParsed(u),d={},p=d[c]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[c]),f=d[h]=r?o.getBasePixel():o.getPixelForValue(i[h]);d.skip=isNaN(p)||isNaN(f),l&&(d.options=a||this.resolveDataElementOptions(u,e.active?"active":n),r&&(d.options.radius=0)),this.updateElement(e,u,d,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=Ug(i&&i._custom,r),n}},DoughnutController:Kv,LineController:class extends Uv{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=N_(e,n,s);this._drawStart=o,this._drawCount=a,j_(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,n),u=s.axis,d=o.axis,{spanGaps:p,segment:f}=this.options,m=__(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||r||"none"===n,_=e+i,y=t.length;let v=e>0&&this.getParsed(e-1);for(let i=0;i<y;++i){const p=t[i],y=g?p:{};if(i<e||i>=_){y.skip=!0;continue}const b=this.getParsed(i),x=Fg(b[d]),w=y[u]=s.getPixelForValue(b[u],i),E=y[d]=r||x?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,b,a):b[d],i);y.skip=isNaN(w)||isNaN(E)||x,y.stop=i>0&&Math.abs(b[u]-v[u])>m,f&&(y.parsed=b,y.raw=l.data[i]),h&&(y.options=c||this.resolveDataElementOptions(i,p.active?"active":n)),g||this.updateElement(p,i,y,n),v=b}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends Kv{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Qv,RadarController:class extends Uv{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return qy.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const r=this._cachedMeta.rScale,s="reset"===n;for(let o=e;o<e+i;o++){const e=t[o],i=this.resolveDataElementOptions(o,e.active?"active":n),a=r.getPointPositionForValue(o,this.getParsed(o).r),l=s?r.xCenter:a.x,c=s?r.yCenter:a.y,h={x:l,y:c,angle:a.angle,skip:isNaN(l)||isNaN(c),options:i};this.updateElement(e,o,h,n)}}},ScatterController:class extends Uv{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:r,count:s}=N_(e,i,n);if(this._drawStart=r,this._drawCount=s,j_(e)&&(r=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const o=this.resolveDatasetElementOptions(t);o.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:o},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),u=this.includeOptions(n,h),d=s.axis,p=o.axis,{spanGaps:f,segment:m}=this.options,g=__(f)?f:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),f=_?e:{},v=Fg(i[p]),b=f[d]=s.getPixelForValue(i[d],c),x=f[p]=r||v?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,i,a):i[p],c);f.skip=isNaN(b)||isNaN(x)||v,f.stop=c>0&&Math.abs(i[d]-y[d])>g,m&&(f.parsed=i,f.raw=l.data[c]),u&&(f.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),_||this.updateElement(e,c,f,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,s)/2}}});function tb(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class eb{static override(t){Object.assign(eb.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return tb()}parse(){return tb()}format(){return tb()}add(){return tb()}diff(){return tb()}startOf(){return tb()}endOf(){return tb()}}var ib={_date:eb};function nb(t,e,i,n){const{controller:r,data:s,_sorted:o}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&s.length){const t=a._reversePixels?I_:P_;if(!n)return t(s,e,i);if(r._sharedOptions){const n=s[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){const n=t(s,e,i-r),o=t(s,e,i+r);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:s.length-1}}function rb(t,e,i,n,r){const s=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=s.length;t<i;++t){const{index:i,data:a}=s[t],{lo:l,hi:c}=nb(s[t],e,o,r);for(let t=l;t<=c;++t){const e=a[t];e.skip||n(e,i,t)}}}function sb(t,e,i,n,r){const s=[];if(!r&&!t.isPointInArea(e))return s;return rb(t,i,e,(function(i,o,a){(r||dy(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&s.push({element:i,datasetIndex:o,index:a})}),!0),s}function ob(t,e,i,n,r,s){let o=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const r=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i);let l=Number.POSITIVE_INFINITY;return rb(t,i,e,(function(i,c,h){const u=i.inRange(e.x,e.y,r);if(n&&!u)return;const d=i.getCenterPoint(r);if(!(!!s||t.isPointInArea(d))&&!u)return;const p=a(e,d);p<l?(o=[{element:i,datasetIndex:c,index:h}],l=p):p===l&&o.push({element:i,datasetIndex:c,index:h})})),o}function ab(t,e,i,n,r,s){return s||t.isPointInArea(e)?"r"!==i||n?ob(t,e,i,n,r,s):function(t,e,i,n){let r=[];return rb(t,i,e,(function(t,i,s){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=w_(t,{x:e.x,y:e.y});M_(l,o,a)&&r.push({element:t,datasetIndex:i,index:s})})),r}(t,e,i,r):[]}function lb(t,e,i,n,r){const s=[],o="x"===i?"inXRange":"inYRange";let a=!1;return rb(t,i,e,((t,n,l)=>{t[o](e[i],r)&&(s.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,r))})),n&&!a?[]:s}var cb={evaluateInteractionItems:rb,modes:{index(t,e,i,n){const r=ov(e,t),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?sb(t,r,s,n,o):ab(t,r,s,!1,n,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){const r=ov(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?sb(t,r,s,n,o):ab(t,r,s,!1,n,o);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point(t,e,i,n){return sb(t,ov(e,t),i.axis||"xy",n,i.includeInvisible||!1)},nearest(t,e,i,n){const r=ov(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;return ab(t,r,s,i.intersect,n,o)},x(t,e,i,n){return lb(t,ov(e,t),"x",i.intersect,n)},y(t,e,i,n){return lb(t,ov(e,t),"y",i.intersect,n)}}};const hb=["left","top","right","bottom"];function ub(t,e){return t.filter((t=>t.pos===e))}function db(t,e){return t.filter((t=>-1===hb.indexOf(t.pos)&&t.box.axis===e))}function pb(t,e){return t.sort(((t,i)=>{const n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight}))}function fb(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!hb.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let s,o,a;for(s=0,o=t.length;s<o;++s){a=t[s];const{fullSize:o}=a.box,l=i[a.stack],c=l&&a.stackWeight/l.weight;a.horizontal?(a.width=c?c*n:o&&e.availableWidth,a.height=r):(a.width=n,a.height=c?c*r:o&&e.availableHeight)}return i}function mb(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function gb(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function _b(t,e,i,n){const{pos:r,box:s}=i,o=t.maxPadding;if(!Ng(r)){i.size&&(t[r]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[r]+=i.size}s.getPadding&&gb(o,s.getPadding());const a=Math.max(0,e.outerWidth-mb(o,t,"left","right")),l=Math.max(0,e.outerHeight-mb(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function yb(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function vb(t,e,i,n){const r=[];let s,o,a,l,c,h;for(s=0,o=t.length,c=0;s<o;++s){a=t[s],l=a.box,l.update(a.width||e.w,a.height||e.h,yb(a.horizontal,e));const{same:o,other:u}=_b(e,i,a,n);c|=o&&r.length,h=h||u,l.fullSize||r.push(a)}return c&&vb(r,e,i,n)||h}function bb(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function xb(t,e,i,n){const r=i.padding;let{x:s,y:o}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*c,s=l.size||t.height;i_(l.start)&&(o=l.start),t.fullSize?bb(t,r.left,o,i.outerWidth-r.right-r.left,s):bb(t,e.left+l.placed,o,n,s),l.start=o,l.placed+=n,o=t.bottom}else{const n=e.h*c,o=l.size||t.width;i_(l.start)&&(s=l.start),t.fullSize?bb(t,s,r.top,o,i.outerHeight-r.bottom-r.top):bb(t,s,e.top+l.placed,o,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=o}var wb={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const r=Cy(t.options.layout.padding),s=Math.max(e-r.width,0),o=Math.max(i-r.height,0),a=function(t){const e=function(t){const e=[];let i,n,r,s,o,a;for(i=0,n=(t||[]).length;i<n;++i)r=t[i],({position:s,options:{stack:o,stackWeight:a=1}}=r),e.push({index:i,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return e}(t),i=pb(e.filter((t=>t.box.fullSize)),!0),n=pb(ub(e,"left"),!0),r=pb(ub(e,"right")),s=pb(ub(e,"top"),!0),o=pb(ub(e,"bottom")),a=db(e,"x"),l=db(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:ub(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;qg(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const h=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},r);gb(d,Cy(n));const p=Object.assign({maxPadding:d,w:s,h:o,x:r.left,y:r.top},r),f=fb(l.concat(c),u);vb(a.fullSize,p,u,f),vb(l,p,u,f),vb(c,p,u,f)&&vb(l,p,u,f),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),xb(a.leftAndTop,p,u,f),p.x+=p.w,p.y+=p.h,xb(a.rightAndBottom,p,u,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},qg(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class Eb{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Sb extends Eb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Tb="$chartjs",Mb={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ab=t=>null===t||""===t;const Cb=!!hv&&{passive:!0};function kb(t,e,i){t.canvas.removeEventListener(e,i,Cb)}function Pb(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Ib(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Pb(i.addedNodes,n),e=e&&!Pb(i.removedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Db(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Pb(i.removedNodes,n),e=e&&!Pb(i.addedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Ob=new Map;let Lb=0;function zb(){const t=window.devicePixelRatio;t!==Lb&&(Lb=t,Ob.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Rb(t,e,i){const n=t.canvas,r=n&&tv(n);if(!r)return;const s=R_(((t,e)=>{const n=r.clientWidth;i(t,e),n<r.clientWidth&&i()}),window),o=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)}));return o.observe(r),function(t,e){Ob.size||window.addEventListener("resize",zb),Ob.set(t,e)}(t,s),o}function Fb(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Ob.delete(t),Ob.size||window.removeEventListener("resize",zb)}(t)}function Bb(t,e,i){const n=t.canvas,r=R_((e=>{null!==t.ctx&&i(function(t,e){const i=Mb[t.type]||t.type,{x:n,y:r}=ov(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,Cb)}(n,e,r),r}class Nb extends Eb{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[Tb]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Ab(r)){const e=uv(t,"width");void 0!==e&&(t.width=e)}if(Ab(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=uv(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Tb])return!1;const i=e[Tb].initial;["height","width"].forEach((t=>{const n=i[t];Fg(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[Tb],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Ib,detach:Db,resize:Rb}[e]||Bb;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Fb,detach:Fb,resize:Fb}[e]||kb)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return lv(t,e,i,n)}isAttached(t){const e=tv(t);return!(!e||!e.isConnected)}}class jb{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return __(this.x)&&__(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function Vb(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=Math.min(i.maxTicksLimit||n,n),s=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>r)return function(t,e,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===o&&(e.push(t[r]),s++,o=i[s*n])}(e,c,s,o/r),c;const h=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),r=e.length/i;if(!n)return Math.max(r,1);const s=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let t=0,e=s.length-1;t<e;t++){const e=s[t];if(e>r)return e}return Math.max(r,1)}(s,e,r);if(o>0){let t,i;const n=o>1?Math.round((l-a)/(o-1)):null;for(Ub(e,c,h,Fg(n)?0:a-n,a),t=0,i=o-1;t<i;t++)Ub(e,c,h,s[t],s[t+1]);return Ub(e,c,h,l,Fg(n)?e.length:l+n),c}return Ub(e,c,h),c}function Ub(t,e,i,n,r){const s=Ug(n,0),o=Math.min(Ug(r,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),r&&(a=r-n,i=a/Math.floor(a/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);l<o;l++)l===c&&(e.push(t[l]),h++,c=Math.round(s+h*i))}const $b=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Hb=(t,e)=>Math.min(e||t,t);function qb(t,e){const i=[],n=t.length/e,r=t.length;let s=0;for(;s<r;s+=n)i.push(t[Math.floor(s)]);return i}function Wb(t,e,i){const n=t.ticks.length,r=Math.min(e,n-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l,c=t.getPixelForTick(r);if(!(i&&(l=1===n?Math.max(c-s,o-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(r-1))/2,c+=r<e?l:-l,c<s-a||c>o+a)))return c}function Gb(t){return t.drawTicks?t.tickLength:0}function Zb(t,e){if(!t.display)return 0;const i=ky(t.font,e),n=Cy(t.padding);return(Bg(t.text)?t.text.length:1)*i.lineHeight+n.height}function Yb(t,e,i){let n=F_(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Xb extends jb{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Vg(t,Number.POSITIVE_INFINITY),e=Vg(e,Number.NEGATIVE_INFINITY),i=Vg(i,Number.POSITIVE_INFINITY),n=Vg(n,Number.NEGATIVE_INFINITY),{min:Vg(t,i),max:Vg(e,n),minDefined:jg(t),maxDefined:jg(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;a<l;++a)e=o[a].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),s||(n=Math.max(n,e.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:Vg(i,Vg(n,i)),max:Vg(n,Vg(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Hg(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:r}=t,s=$g(e,(r-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(s)),max:o(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o<this.ticks.length;this._convertTicksToLabels(a?qb(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=Vb(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Hg(this.options.afterUpdate,[this])}beforeSetDimensions(){Hg(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Hg(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Hg(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Hg(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,r;for(i=0,n=t.length;i<n;i++)r=t[i],r.label=Hg(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){Hg(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Hg(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Hb(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,r=e.maxRotation;let s,o,a,l=n;if(!this._isVisible()||!e.display||n>=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,u=c.highest.height,d=A_(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:d/(i-1),h+6>s&&(s=d/(i-(t.offset?.5:1)),o=this.maxHeight-Gb(t.grid)-e.padding-Zb(t.title,this.chart.options.font),a=Math.sqrt(h*h+u*u),l=b_(Math.min(Math.asin(A_((c.highest.height+6)/s,-1,1)),Math.asin(A_(o/a,-1,1))-Math.asin(A_(u/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){Hg(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Hg(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=Zb(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=Gb(r)+s):(t.height=this.maxHeight,t.width=Gb(r)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=v_(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*r.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*r.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:r,padding:s},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,u=0;a?l?(h=n*t.width,u=i*e.height):(h=i*t.height,u=n*e.width):"start"===r?u=e.width:"end"===r?h=t.width:"inner"!==r&&(h=t.width/2,u=e.width/2),this.paddingLeft=Math.max((h-o+s)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Hg(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)Fg(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=qb(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:r}=this,s=[],o=[],a=Math.floor(e/Hb(e,i));let l,c,h,u,d,p,f,m,g,_,y,v=0,b=0;for(l=0;l<e;l+=a){if(u=t[l].label,d=this._resolveTickFontOptions(l),n.font=p=d.string,f=r[p]=r[p]||{data:{},gc:[]},m=d.lineHeight,g=_=0,Fg(u)||Bg(u)){if(Bg(u))for(c=0,h=u.length;c<h;++c)y=u[c],Fg(y)||Bg(y)||(g=oy(n,f.data,f.gc,g,y),_+=m)}else g=oy(n,f.data,f.gc,g,u),_=m;s.push(g),o.push(_),v=Math.max(g,v),b=Math.max(_,b)}!function(t,e){qg(t,(t=>{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r<n;++r)delete t.data[i[r]];i.splice(0,n)}}))}(r,e);const x=s.indexOf(v),w=o.indexOf(b),E=t=>({width:s[t]||0,height:o[t]||0});return{first:E(0),last:E(e-1),widest:E(x),highest:E(w),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return A_(this._alignToPixels?ly(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Iy(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Iy(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=v_(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),s=t.autoSkipPadding||0,o=r?r.widest.width+s:0,a=r?r.highest.height+s:0;return this.isHorizontal()?a*i>o*n?o/i:a/n:a*n<o*i?a/i:o/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:r,position:s,border:o}=n,a=r.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Gb(r),u=[],d=o.setContext(this.getContext()),p=d.display?d.width:0,f=p/2,m=function(t){return ly(i,t,p)};let g,_,y,v,b,x,w,E,S,T,M,A;if("top"===s)g=m(this.bottom),x=this.bottom-h,E=g-f,T=m(t.top)+f,A=t.bottom;else if("bottom"===s)g=m(this.top),T=t.top,A=m(t.bottom)-f,x=g+f,E=this.top+h;else if("left"===s)g=m(this.right),b=this.right-h,w=g-f,S=m(t.left)+f,M=t.right;else if("right"===s)g=m(this.left),S=t.left,M=m(t.right)-f,b=g+f,w=this.left+h;else if("x"===e){if("center"===s)g=m((t.top+t.bottom)/2+.5);else if(Ng(s)){const t=Object.keys(s)[0],e=s[t];g=m(this.chart.scales[t].getPixelForValue(e))}T=t.top,A=t.bottom,x=g+f,E=x+h}else if("y"===e){if("center"===s)g=m((t.left+t.right)/2);else if(Ng(s)){const t=Object.keys(s)[0],e=s[t];g=m(this.chart.scales[t].getPixelForValue(e))}b=g-f,w=b-h,S=t.left,M=t.right}const C=Ug(n.ticks.maxTicksLimit,c),k=Math.max(1,Math.ceil(c/C));for(_=0;_<c;_+=k){const t=this.getContext(_),e=r.setContext(t),n=o.setContext(t),s=e.lineWidth,c=e.color,h=n.dash||[],d=n.dashOffset,p=e.tickWidth,f=e.tickColor,m=e.tickBorderDash||[],g=e.tickBorderDashOffset;y=Wb(this,_,a),void 0!==y&&(v=ly(i,y,s),l?b=w=S=M=v:x=E=T=A=v,u.push({tx1:b,ty1:x,tx2:w,ty2:E,x1:S,y1:T,x2:M,y2:A,width:s,color:c,borderDash:h,borderDashOffset:d,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:r}=i,s=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:l,padding:c,mirror:h}=r,u=Gb(i.grid),d=u+c,p=h?-c:d,f=-v_(this.labelRotation),m=[];let g,_,y,v,b,x,w,E,S,T,M,A,C="middle";if("top"===n)x=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===n)x=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,b=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,b=t.x}else if("x"===e){if("center"===n)x=(t.top+t.bottom)/2+d;else if(Ng(n)){const t=Object.keys(n)[0],e=n[t];x=this.chart.scales[t].getPixelForValue(e)+d}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)b=(t.left+t.right)/2-d;else if(Ng(n)){const t=Object.keys(n)[0],e=n[t];b=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===a?C="top":"end"===a&&(C="bottom"));const k=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){y=o[g],v=y.label;const t=r.setContext(this.getContext(g));E=this.getPixelForTick(g)+r.labelOffset,S=this._resolveTickFontOptions(g),T=S.lineHeight,M=Bg(v)?v.length:1;const e=M/2,i=t.color,a=t.textStrokeColor,c=t.textStrokeWidth;let u,d=w;if(s?(b=E,"inner"===w&&(d=g===_-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===l||0!==f?-M*T+T/2:"center"===l?-k.highest.height/2-e*T+T:-k.highest.height+T/2:"near"===l||0!==f?T/2:"center"===l?k.highest.height/2-e*T:k.highest.height-M*T,h&&(A*=-1),0===f||t.showLabelBackdrop||(b+=T/2*Math.sin(f))):(x=E,A=(1-M)*T/2),t.showLabelBackdrop){const e=Cy(t.backdropPadding),i=k.heights[g],n=k.widths[g];let r=A-e.top,s=0-e.left;switch(C){case"middle":r-=i/2;break;case"bottom":r-=i}switch(w){case"center":s-=n/2;break;case"right":s-=n;break;case"inner":g===_-1?s-=n:g>0&&(s-=n/2)}u={left:s,top:r,width:n+e.width,height:i+e.height,color:t.backdropColor}}m.push({label:v,font:S,textOffset:A,options:{rotation:f,color:i,strokeColor:a,strokeWidth:c,textAlign:d,textBaseline:C,translation:[b,x],backdrop:u}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-v_(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,s=t+r,o=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+r,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l+=o)):(l=this.right-s,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+r,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l-=o)):(l=this.left+s,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,s;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(r=0,s=n.length;r<s;++r){const t=n[r];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,r=i.setContext(this.getContext()),s=i.display?r.width:0;if(!s)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,u;this.isHorizontal()?(l=ly(t,this.left,s)-s/2,c=ly(t,this.right,o)+o/2,h=u=a):(h=ly(t,this.top,s)-s/2,u=ly(t,this.bottom,o)+o/2,l=c=a),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(l,h),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&py(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font;vy(e,t.label,0,t.textOffset,n,i)}i&&fy(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const r=ky(i.font),s=Cy(i.padding),o=i.align;let a=r.lineHeight/2;"bottom"===e||"center"===e||Ng(e)?(a+=s.bottom,Bg(i.text)&&(a+=r.lineHeight*(i.text.length-1))):a+=s.top;const{titleX:l,titleY:c,maxWidth:h,rotation:u}=function(t,e,i,n){const{top:r,left:s,bottom:o,right:a,chart:l}=t,{chartArea:c,scales:h}=l;let u,d,p,f=0;const m=o-r,g=a-s;if(t.isHorizontal()){if(d=B_(n,s,a),Ng(i)){const t=Object.keys(i)[0],n=i[t];p=h[t].getPixelForValue(n)+m-e}else p="center"===i?(c.bottom+c.top)/2+m-e:$b(t,i,e);u=a-s}else{if(Ng(i)){const t=Object.keys(i)[0],n=i[t];d=h[t].getPixelForValue(n)-g+e}else d="center"===i?(c.left+c.right)/2-g+e:$b(t,i,e);p=B_(n,o,r),f="left"===i?-h_:h_}return{titleX:d,titleY:p,maxWidth:u,rotation:f}}(this,a,e,o);vy(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:u,textAlign:Yb(o,e,n),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Ug(t.grid&&t.grid.z,-1),n=Ug(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Xb.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let r,s;for(r=0,s=e.length;r<s;++r){const s=e[r];s[i]!==this.id||t&&s.type!==t||n.push(s)}return n}_resolveTickFontOptions(t){return ky(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Kb{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,r=t.id,s=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,function(t,e,i){const n=Xg(Object.create(null),[i?sy.get(i):{},sy.get(e),t.defaults]);sy.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");sy.route(s,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&sy.describe(e,t.descriptors)}(t,s,i),this.override&&sy.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in sy[n]&&(delete sy[n][i],this.override&&delete ty[i])}}class Qb{constructor(){this.controllers=new Kb(Uv,"datasets",!0),this.elements=new Kb(jb,"elements"),this.plugins=new Kb(Object,"plugins"),this.scales=new Kb(Xb,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):qg(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=e_(t);Hg(i["before"+n],[],i),e[t](i),Hg(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var Jb=new Qb;class tx{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,n){n=n||{};for(const r of t){const t=r.plugin;if(!1===Hg(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){Fg(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=Ug(i.options&&i.options.plugins,{}),r=function(t){const e={},i=[],n=Object.keys(Jb.plugins.items);for(let t=0;t<n.length;t++)i.push(Jb.getPlugin(n[t]));const r=t.plugins||[];for(let t=0;t<r.length;t++){const n=r[t];-1===i.indexOf(n)&&(i.push(n),e[n.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,r){const s=[],o=t.getContext();for(const a of e){const e=a.id,l=ex(n[e],r);null!==l&&s.push({plugin:a,options:ix(t.config,{plugin:a,local:i[e]},l,o)})}return s}(t,r,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function ex(t,e){return e||!1!==t?!0===t?{}:t:null}function ix(t,{plugin:e,local:i},n,r){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(n,s);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function nx(t,e){const i=sy.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function rx(t){if("x"===t||"y"===t||"r"===t)return t}function sx(t,...e){if(rx(t))return t;for(const n of e){const e=n.axis||("top"===(i=n.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&rx(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ox(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function ax(t,e){const i=ty[t.type]||{scales:{}},n=e.scales||{},r=nx(t.type,e),s=Object.create(null);return Object.keys(n).forEach((e=>{const o=n[e];if(!Ng(o))return console.error(`Invalid scale configuration for scale: ${e}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=sx(e,o,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return ox(t,"x",i[0])||ox(t,"y",i[0])}return{}}(e,t),sy.scales[o.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,r),c=i.scales||{};s[e]=Kg(Object.create(null),[{axis:a},o,c[a],c[l]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||nx(r,e),a=(ty[r]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||e;s[r]=s[r]||Object.create(null),Kg(s[r],[{axis:e},n[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];Kg(e,[sy.scales[e.type],sy.scale])})),s}function lx(t){const e=t.options||(t.options={});e.plugins=Ug(e.plugins,{}),e.scales=ax(t,e)}function cx(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const hx=new Map,ux=new Set;function dx(t,e){let i=hx.get(t);return i||(i=e(),hx.set(t,i),ux.add(i)),i}const px=(t,e,i)=>{const n=t_(e,i);void 0!==n&&t.add(n)};class fx{constructor(t){this._config=function(t){return(t=t||{}).data=cx(t.data),lx(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=cx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),lx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return dx(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return dx(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return dx(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return dx(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:r}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>px(a,t,e)))),e.forEach((t=>px(a,n,t))),e.forEach((t=>px(a,ty[r]||{},t))),e.forEach((t=>px(a,sy,t))),e.forEach((t=>px(a,ey,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ux.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ty[e]||{},sy.datasets[e]||{},{type:e},sy,ey]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=mx(this._resolverCache,t,n);let a=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=Ly(t);for(const r of e){const e=i(r),s=n(r),o=(s||e)&&t[r];if(e&&(n_(o)||gx(o))||s&&Bg(o))return!0}return!1}(s,e)){r.$shared=!1;a=Oy(s,i=n_(i)?i():i,this.createResolver(t,i,o))}for(const t of e)r[t]=a[t];return r}createResolver(t,e,i=[""],n){const{resolver:r}=mx(this._resolverCache,t,i);return Ng(e)?Oy(r,e,void 0,n):r}}function mx(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=i.join();let s=n.get(r);if(!s){s={resolver:Dy(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,s)}return s}const gx=t=>Ng(t)&&Object.getOwnPropertyNames(t).some((e=>n_(t[e])));const _x=["top","bottom","left","right","chartArea"];function yx(t,e){return"top"===t||"bottom"===t||-1===_x.indexOf(t)&&"x"===e}function vx(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function bx(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Hg(i&&i.onComplete,[t],e)}function xx(t){const e=t.chart,i=e.options.animation;Hg(i&&i.onProgress,[t],e)}function wx(t){return Jy()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ex={},Sx=t=>{const e=wx(t);return Object.values(Ex).filter((t=>t.canvas===e)).pop()};function Tx(t,e,i){const n=Object.keys(t);for(const r of n){const n=+r;if(n>=e){const s=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=s)}}}function Mx(t,e,i){return t.options.clip?t[i]:e[i]}class Ax{static defaults=sy;static instances=Ex;static overrides=ty;static registry=Jb;static version="4.4.1";static getChart=Sx;static register(...t){Jb.add(...t),Cx()}static unregister(...t){Jb.remove(...t),Cx()}constructor(t,e){const i=this.config=new fx(e),n=wx(t),r=Sx(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Jy()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Sb:Nb}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,s.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=Rg(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new tx,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),s.resizeDelay||0),this._dataChanges=[],Ex[this.id]=this,o&&a?(Mv.listen(this,"complete",bx),Mv.listen(this,"progress",xx),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return Fg(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Jb}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cv(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cy(this.canvas,this.ctx),this}stop(){return Mv.stop(this),this}resize(t,e){Mv.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,cv(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Hg(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){qg(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const i=e[t],n=sx(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),qg(r,(e=>{const r=e.options,s=r.id,o=sx(s,r),a=Ug(r.type,e.dtype);void 0!==r.position&&yx(r.position,o)===yx(e.dposition)||(r.position=e.dposition),n[s]=!0;let l=null;if(s in i&&i[s].type===a)l=i[s];else{l=new(Jb.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)})),qg(n,((t,e)=>{t||delete i[e]})),qg(i,(t=>{wb.configure(this,t,t.options),wb.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(vx("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let r=this.getDatasetMeta(i);const s=n.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=s,r.indexAxis=n.indexAxis||nx(s,this.options),r.order=n.order||0,r.index=i,r.label=""+n.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const e=Jb.getController(s),{datasetElementType:n,dataElementType:o}=sy.datasets[s];Object.assign(e,{dataElementType:Jb.getElement(o),datasetElementType:n&&Jb.getElement(n)}),r.controller=new e(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){qg(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===r.indexOf(e);e.buildOrUpdateElements(i),s=Math.max(+e.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||qg(r,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(vx("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){qg(this.scales,(t=>{wb.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);r_(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:r}of e){Tx(t,n,"_removeElements"===i?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let t=1;t<e;t++)if(!r_(n,i(t)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;wb.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],qg(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,n_(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Mv.has(this)?this.attached&&!Mv.running(this)&&Mv.start(this):(this.draw(),bx({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,r;for(n=0,r=e.length;n<r;++n){const r=e[n];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,r=function(t,e){const{xScale:i,yScale:n}=t;return i&&n?{left:Mx(i,e,"left"),right:Mx(i,e,"right"),top:Mx(n,e,"top"),bottom:Mx(n,e,"bottom")}:e}(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&py(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&fy(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return dy(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const r=cb.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Iy(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,n);i_(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Mv.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),cy(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ex[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};qg(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",s)};s=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){qg(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},qg(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let r,s,o,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o<a;++o){s=t[o];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!Wg(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),s=r(e,t),o=i?t:r(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:r}=this,s=e,o=this._getActiveElements(t,n,i,s),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Hg(r.onHover,[t,o,this],this),a&&Hg(r.onClick,[t,o,this],this));const c=!Wg(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}function Cx(){return qg(Ax.instances,(t=>t._plugins.invalidate()))}function kx(t,e,i,n){const r=Ty(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(i-e)/2,o=Math.min(s,n*e/2),a=t=>{const e=(i-Math.min(s,t))*n/2;return A_(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:A_(r.innerStart,0,o),innerEnd:A_(r.innerEnd,0,o)}}function Px(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Ix(t,e,i,n,r,s){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,u=Math.max(e.outerRadius+n+i-c,0),d=h>0?h+n+i+c:0;let p=0;const f=r-l;if(n){const t=((h>0?h-n:0)+(u>0?u-n:0))/2;p=(f-(0!==t?f*t/(t+n):f))/2}const m=(f-Math.max(.001,f*u-i/s_)/u)/2,g=l+m+p,_=r-m-p,{outerStart:y,outerEnd:v,innerStart:b,innerEnd:x}=kx(e,d,u,_-g),w=u-y,E=u-v,S=g+y/w,T=_-v/E,M=d+b,A=d+x,C=g+b/M,k=_-x/A;if(t.beginPath(),s){const e=(S+T)/2;if(t.arc(o,a,u,S,e),t.arc(o,a,u,e,T),v>0){const e=Px(E,T,o,a);t.arc(e.x,e.y,v,T,_+h_)}const i=Px(A,_,o,a);if(t.lineTo(i.x,i.y),x>0){const e=Px(A,k,o,a);t.arc(e.x,e.y,x,_+h_,k+Math.PI)}const n=(_-x/d+(g+b/d))/2;if(t.arc(o,a,d,_-x/d,n,!0),t.arc(o,a,d,n,g+b/d,!0),b>0){const e=Px(M,C,o,a);t.arc(e.x,e.y,b,C+Math.PI,g-h_)}const r=Px(w,g,o,a);if(t.lineTo(r.x,r.y),y>0){const e=Px(w,S,o,a);t.arc(e.x,e.y,y,g-h_,S)}}else{t.moveTo(o,a);const e=Math.cos(S)*u+o,i=Math.sin(S)*u+a;t.lineTo(e,i);const n=Math.cos(T)*u+o,r=Math.sin(T)*u+a;t.lineTo(n,r)}t.closePath()}function Dx(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(u||[]),t.lineDashOffset=d,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let f=e.endAngle;if(s){Ix(t,e,i,n,f,r);for(let e=0;e<s;++e)t.stroke();isNaN(a)||(f=o+(a%o_||o_))}p&&function(t,e,i){const{startAngle:n,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e;let c=r/a;t.beginPath(),t.arc(s,o,a,n-c,i+c),l>r?(c=r/l,t.arc(s,o,l,i+c,n-c,!0)):t.arc(s,o,r,i+h_,n-h_),t.closePath(),t.clip()}(t,e,f),s||(Ix(t,e,i,n,f,r),t.stroke())}function Ox(t,e,i=e){t.lineCap=Ug(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Ug(i.borderDash,e.borderDash)),t.lineDashOffset=Ug(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Ug(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Ug(i.borderWidth,e.borderWidth),t.strokeStyle=Ug(i.borderColor,e.borderColor)}function Lx(t,e,i){t.lineTo(i.x,i.y)}function zx(t,e,i={}){const n=t.length,{start:r=0,end:s=n-1}=i,{start:o,end:a}=e,l=Math.max(r,o),c=Math.min(s,a),h=r<o&&s<o||r>a&&s>a;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}function Rx(t,e,i,n){const{points:r,options:s}=e,{count:o,start:a,loop:l,ilen:c}=zx(r,i,n),h=function(t){return t.stepped?my:t.tension||"monotone"===t.cubicInterpolationMode?gy:Lx}(s);let u,d,p,{move:f=!0,reverse:m}=n||{};for(u=0;u<=c;++u)d=r[(a+(m?c-u:u))%o],d.skip||(f?(t.moveTo(d.x,d.y),f=!1):h(t,p,d,m,s.stepped),p=d);return l&&(d=r[(a+(m?c:0))%o],h(t,p,d,m,s.stepped)),!!l}function Fx(t,e,i,n){const r=e.points,{count:s,start:o,ilen:a}=zx(r,i,n),{move:l=!0,reverse:c}=n||{};let h,u,d,p,f,m,g=0,_=0;const y=t=>(o+(c?a-t:t))%s,v=()=>{p!==f&&(t.lineTo(g,f),t.lineTo(g,p),t.lineTo(g,m))};for(l&&(u=r[y(0)],t.moveTo(u.x,u.y)),h=0;h<=a;++h){if(u=r[y(h)],u.skip)continue;const e=u.x,i=u.y,n=0|e;n===d?(i<p?p=i:i>f&&(f=i),g=(_*g+e)/++_):(v(),t.lineTo(e,i),d=n,_=0,p=f=i),m=i}v()}function Bx(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Fx:Rx}const Nx="function"==typeof Path2D;function jx(t,e,i,n){Nx&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Ox(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:s}=e,o=Bx(e);for(const a of r)Ox(t,s,a.style),t.beginPath(),o(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Vx extends jb{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Qy(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];const s=!!t._loop,{start:o,end:a}=function(t,e,i,n){let r=0,s=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return wv(t,!0===n?[{start:o,end:a,loop:s}]:function(t,e,i,n){const r=t.length,s=[];let o,a=e,l=t[e];for(o=e+1;o<=i;++o){const i=t[o%r];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%r,end:(o-1)%r,loop:n}),e=a=i.stop?o:null):(a=o,l.skip&&(e=o)),l=i}return null!==a&&s.push({start:e%r,end:a%r,loop:n}),s}(i,o,a<o?a+r:a,!!t._fullLoop&&0===o&&a===r-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],r=this.points,s=xv(this,{property:e,start:n,end:n});if(!s.length)return;const o=[],a=function(t){return t.stepped?pv:t.tension||"monotone"===t.cubicInterpolationMode?fv:dv}(i);let l,c;for(l=0,c=s.length;l<c;++l){const{start:c,end:h}=s[l],u=r[c],d=r[h];if(u===d){o.push(u);continue}const p=a(u,d,Math.abs((n-u[e])/(d[e]-u[e])),i.stepped);p[e]=t[e],o.push(p)}return 1===o.length?o[0]:o}pathSegment(t,e,i){return Bx(this)(t,this,e,i)}path(t,e,i){const n=this.segments,r=Bx(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of n)s&=r(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),jx(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ux(t,e,i,n){const r=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<r.radius+r.hitRadius}function $x(t,e){const{x:i,y:n,base:r,width:s,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,c,h,u;return t.horizontal?(u=o/2,a=Math.min(i,r),l=Math.max(i,r),c=n-u,h=n+u):(u=s/2,a=i-u,l=i+u,c=Math.min(n,r),h=Math.max(n,r)),{left:a,top:c,right:l,bottom:h}}function Hx(t,e,i,n){return t?0:A_(e,i,n)}function qx(t){const e=$x(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){const n=t.options.borderWidth,r=t.borderSkipped,s=My(n);return{t:Hx(r.top,s.top,0,i),r:Hx(r.right,s.right,0,e),b:Hx(r.bottom,s.bottom,0,i),l:Hx(r.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=Ay(r),o=Math.min(e,i),a=t.borderSkipped,l=n||Ng(r);return{topLeft:Hx(!l||a.top||a.left,s.topLeft,0,o),topRight:Hx(!l||a.top||a.right,s.topRight,0,o),bottomLeft:Hx(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:Hx(!l||a.bottom||a.right,s.bottomRight,0,o)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Wx(t,e,i,n){const r=null===e,s=null===i,o=t&&!(r&&s)&&$x(t,n);return o&&(r||C_(e,o.left,o.right))&&(s||C_(i,o.top,o.bottom))}function Gx(t,e){t.rect(e.x,e.y,e.w,e.h)}function Zx(t,e,i={}){const n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+s,h:t.h+o,radius:t.radius}}var Yx=Object.freeze({__proto__:null,ArcElement:class extends jb{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:r,distance:s}=w_(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,d=Ug(h,a-o)>=o_||M_(r,o,a),p=C_(s,l+u,c+u);return d&&p}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+r)/2,h=(s+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>o_?Math.floor(i/o_):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*n,Math.sin(o)*n);const a=n*(1-Math.sin(Math.min(s_,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a}=e;let l=e.endAngle;if(s){Ix(t,e,i,n,l,r);for(let e=0;e<s;++e)t.fill();isNaN(a)||(l=o+(a%o_||o_))}Ix(t,e,i,n,l,r),t.fill()}(t,this,a,r,s),Dx(t,this,a,r,s),t.restore()}},BarElement:class extends jb{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=qx(this),o=(a=s.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?by:Gx;var a;t.save(),s.w===r.w&&s.h===r.h||(t.beginPath(),o(t,Zx(s,e,r)),t.clip(),o(t,Zx(r,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,Zx(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return Wx(this,t,e,i)}inXRange(t,e){return Wx(this,t,null,e)}inYRange(t,e){return Wx(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:Vx,PointElement:class extends jb{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Ux(this,t,"x",e)}inYRange(t,e){return Ux(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!dy(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,hy(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const Xx=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Kx=Xx.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Qx(t){return Xx[t%Xx.length]}function Jx(t){return Kx[t%Kx.length]}function tw(t){let e=0;return(i,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof Kv?e=function(t,e){return t.backgroundColor=t.data.map((()=>Qx(e++))),e}(i,e):r instanceof Qv?e=function(t,e){return t.backgroundColor=t.data.map((()=>Jx(e++))),e}(i,e):r&&(e=function(t,e){return t.borderColor=Qx(e),t.backgroundColor=Jx(e),++e}(i,e))}}function ew(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var iw={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:r}=t.config,{elements:s}=r;if(!i.forceOverride&&(ew(n)||(o=r)&&(o.borderColor||o.backgroundColor)||s&&ew(s)))return;var o;const a=tw(t);n.forEach(a)}};function nw(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function rw(t){t.data.datasets.forEach((t=>{nw(t)}))}var sw={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void rw(t);const n=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:s,indexAxis:o}=e,a=t.getDatasetMeta(r),l=s||e.data;if("y"===Py([o,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:u}=function(t,e){const i=e.length;let n,r=0;const{iScale:s}=t,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=A_(P_(e,s.axis,o).lo,0,i-1)),n=c?A_(P_(e,s.axis,a).hi+1,r,i)-r:i-r,{start:r,count:n}}(a,l);if(u<=(i.threshold||4*n))return void nw(e);let d;switch(Fg(s)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":d=function(t,e,i,n,r){const s=r.samples||n;if(s>=i)return t.slice(e,e+i);const o=[],a=(i-2)/(s-2);let l=0;const c=e+i-1;let h,u,d,p,f,m=e;for(o[l++]=t[m],h=0;h<s-2;h++){let n,r=0,s=0;const c=Math.floor((h+1)*a)+1+e,g=Math.min(Math.floor((h+2)*a)+1,i)+e,_=g-c;for(n=c;n<g;n++)r+=t[n].x,s+=t[n].y;r/=_,s/=_;const y=Math.floor(h*a)+1+e,v=Math.min(Math.floor((h+1)*a)+1,i)+e,{x:b,y:x}=t[m];for(d=p=-1,n=y;n<v;n++)p=.5*Math.abs((b-r)*(t[n].y-x)-(b-t[n].x)*(s-x)),p>d&&(d=p,u=t[n],f=n);o[l++]=u,m=f}return o[l++]=t[c],o}(l,h,u,n,i);break;case"min-max":d=function(t,e,i,n){let r,s,o,a,l,c,h,u,d,p,f=0,m=0;const g=[],_=e+i-1,y=t[e].x,v=t[_].x-y;for(r=e;r<e+i;++r){s=t[r],o=(s.x-y)/v*n,a=s.y;const e=0|o;if(e===l)a<d?(d=a,c=r):a>p&&(p=a,h=r),f=(m*f+s.x)/++m;else{const i=r-1;if(!Fg(c)&&!Fg(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==u&&e!==i&&g.push({...t[e],x:f}),n!==u&&n!==i&&g.push({...t[n],x:f})}r>0&&i!==u&&g.push(t[i]),g.push(s),l=e,m=0,d=p=a,c=h=u=r}}return g}(l,h,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=d}))},destroy(t){rw(t)}};function ow(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=T_(r),s=T_(s)),{property:t,start:r,end:s}}function aw(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function lw(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function cw(t,e){let i=[],n=!1;return Bg(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},r=e.points,s=[];return e.segments.forEach((({start:t,end:e})=>{e=aw(t,e,r);const o=r[t],a=r[e];null!==n?(s.push({x:o.x,y:n}),s.push({x:a.x,y:n})):null!==i&&(s.push({x:i,y:o.y}),s.push({x:i,y:a.y}))})),s}(t,e),i.length?new Vx({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function hw(t){return t&&!1!==t.fill}function uw(t,e,i){let n=t[e].fill;const r=[e];let s;if(!i)return n;for(;!1!==n&&-1===r.indexOf(n);){if(!jg(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function dw(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Ug(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Ng(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return jg(r)&&Math.floor(r)===r?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function pw(t,e,i){const n=[];for(let r=0;r<i.length;r++){const s=i[r],{first:o,last:a,point:l}=fw(s,e,"x");if(!(!l||o&&a))if(o)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function fw(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const r=n[i],s=t.segments,o=t.points;let a=!1,l=!1;for(let t=0;t<s.length;t++){const e=s[t],n=o[e.start][i],c=o[e.end][i];if(C_(r,n,c)){a=r===n,l=r===c;break}}return{first:a,last:l,point:n}}class mw{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:r,radius:s}=this;return e=e||{start:0,end:o_},t.arc(n,r,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}function gw(t){const{chart:e,fill:i,line:n}=t;if(jg(i))return function(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,r=[],s=n.segments,o=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){const r=n[t];if(r.index===e)break;r.hidden||i.unshift(r.dataset)}return i}(e,i);a.push(cw({x:null,y:e.bottom},n));for(let t=0;t<s.length;t++){const e=s[t];for(let t=e.start;t<=e.end;t++)pw(r,o[t],a)}return new Vx({points:r,options:{}})}(t);if("shape"===i)return!0;const r=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,o=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:Ng(t)?t.value:e.getBaseValue(),n}(i,e,s),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,s);return new mw({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(o)})}for(let t=0;t<r;++t)a.push(e.getPointPositionForValue(t,o));return a}(t);return function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:Ng(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(jg(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return r instanceof mw?r:cw(r,n)}function _w(t,e,i){const n=gw(e),{line:r,scale:s,axis:o}=e,a=r.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:u=c}=l||{};n&&r.points.length&&(py(t,i),function(t,e){const{line:i,target:n,above:r,below:s,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&(yw(t,n,o.top),vw(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore(),t.save(),yw(t,n,o.bottom));vw(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore()}(t,{line:r,target:n,above:h,below:u,area:i,scale:s,axis:o}),fy(t))}function yw(t,e,i){const{segments:n,points:r}=e;let s=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=r[n],h=r[aw(n,l,r)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function vw(t,e){const{line:i,target:n,property:r,color:s,scale:o}=e,a=function(t,e,i){const n=t.segments,r=t.points,s=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=aw(n,a,r);const l=ow(i,r[n],r[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:r[n],end:r[a]});continue}const c=xv(e,l);for(const e of c){const n=ow(i,s[e.start],s[e.end],e.loop),a=bv(t,r,n);for(const t of a)o.push({source:t,target:e,start:{[i]:lw(l,n,"start",Math.max)},end:{[i]:lw(l,n,"end",Math.min)}})}}return o}(i,n,r);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=s}={}}=e,u=!0!==n;t.save(),t.fillStyle=a,bw(t,o,u&&ow(r,c,h)),t.beginPath();const d=!!i.pathSegment(t,e);let p;if(u){d?t.closePath():xw(t,n,h,r);const e=!!n.pathSegment(t,l,{move:d,reverse:!0});p=d&&e,p||xw(t,n,c,r)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function bw(t,e,i){const{top:n,bottom:r}=e.chart.chartArea,{property:s,start:o,end:a}=i||{};"x"===s&&(t.beginPath(),t.rect(o,n,a-o,r-n),t.clip())}function xw(t,e,i,n){const r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var ww={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,r=[];let s,o,a,l;for(o=0;o<n;++o)s=t.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Vx&&(l={visible:t.isDatasetVisible(o),index:o,fill:dw(a,o,n),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],l&&!1!==l.fill&&(l.fill=uw(r,o,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let e=r.length-1;e>=0;--e){const i=r[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&i.fill&&_w(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;hw(i)&&_w(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;hw(n)&&"beforeDatasetDraw"===i.drawTime&&_w(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ew=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Sw extends jb{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Hg(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=ky(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=Ew(i,r);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(s,r,o,a)+10):(c=this.maxHeight,l=this._fitCols(s,n,o,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+o;let h=t;r.textAlign="left",r.textBaseline="middle";let u=-1,d=-c;return this.legendItems.forEach(((t,p)=>{const f=i+e/2+r.measureText(t.text).width;(0===p||l[l.length-1]+f+2*o>s)&&(h+=c,l[l.length-(p>0?0:1)]=0,d+=c,u++),a[p]={left:0,top:d,row:u,width:f,height:n},l[l.length-1]+=f+o})),h}_fitCols(t,e,i,n){const{ctx:r,maxHeight:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=s-t;let h=o,u=0,d=0,p=0,f=0;return this.legendItems.forEach(((t,s)=>{const{itemWidth:m,itemHeight:g}=function(t,e,i,n,r){const s=function(t,e,i,n){let r=t.text;r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+n.measureText(r).width}(n,t,e,i),o=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=Tw(e,i));return n}(r,n,e.lineHeight);return{itemWidth:s,itemHeight:o}}(i,e,r,t,n);s>0&&d+g+2*o>c&&(h+=u+o,l.push({width:u,height:d}),p+=u+o,f++,u=d=0),a[s]={left:p,top:d,col:f,width:m,height:g},u=Math.max(u,m),d+=g+o})),h+=u,l.push({width:u,height:d}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,s=mv(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=B_(i,this.left+n,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=B_(i,this.left+n,this.right-this.lineWidths[r])),a.top+=this.top+t+n,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+n}else{let r=0,o=B_(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=B_(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+n,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;py(t,this),this._draw(),fy(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:s}=t,o=sy.color,a=mv(t.rtl,this.left,this.width),l=ky(s.font),{padding:c}=s,h=l.size,u=h/2;let d;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=Ew(s,h),g=this.isHorizontal(),_=this._computeTitleHeight();d=g?{x:B_(r,this.left+c,this.right-i[0]),y:this.top+c+_,line:0}:{x:this.left+c,y:B_(r,this.top+_+c,this.bottom-e[0].height),line:0},gv(this.ctx,t.textDirection);const y=m+c;this.legendItems.forEach(((v,b)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;const x=n.measureText(v.text).width,w=a.textAlign(v.textAlign||(v.textAlign=s.textAlign)),E=p+u+x;let S=d.x,T=d.y;a.setWidth(this.width),g?b>0&&S+E+c>this.right&&(T=d.y+=y,d.line++,S=d.x=B_(r,this.left+c,this.right-i[d.line])):b>0&&T+y>this.bottom&&(S=d.x=S+e[d.line].width+c,d.line++,T=d.y=B_(r,this.top+_+c,this.bottom-e[d.line].height));if(function(t,e,i){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;n.save();const r=Ug(i.lineWidth,1);if(n.fillStyle=Ug(i.fillStyle,o),n.lineCap=Ug(i.lineCap,"butt"),n.lineDashOffset=Ug(i.lineDashOffset,0),n.lineJoin=Ug(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=Ug(i.strokeStyle,o),n.setLineDash(Ug(i.lineDash,[])),s.usePointStyle){const o={radius:f*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},l=a.xPlus(t,p/2);uy(n,o,l,e+u,s.pointStyleWidth&&p)}else{const s=e+Math.max((h-f)/2,0),o=a.leftForLtr(t,p),l=Ay(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?by(n,{x:o,y:s,w:p,h:f,radius:l}):n.rect(o,s,p,f),n.fill(),0!==r&&n.stroke()}n.restore()}(a.x(S),T,v),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+p+u,g?S+E:this.right,t.rtl),function(t,e,i){vy(n,i.text,t,e+m/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),T,v),g)d.x+=E+c;else if("string"!=typeof v.text){const t=l.lineHeight;d.y+=Tw(v,t)+c}else d.y+=y})),_v(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ky(e.font),n=Cy(e.padding);if(!e.display)return;const r=mv(t.rtl,this.left,this.width),s=this.ctx,o=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+l,h=B_(t.align,h,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+B_(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const d=B_(o,h,h+u);s.textAlign=r.textAlign(F_(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,vy(s,e.text,d,c,i)}_computeTitleHeight(){const t=this.options.title,e=ky(t.font),i=Cy(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(C_(t,this.left,this.right)&&C_(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],C_(t,n.left,n.left+n.width)&&C_(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const n=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&Hg(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&Hg(e.onHover,[t,i,this],this)}else i&&Hg(e.onClick,[t,i,this],this)}}function Tw(t,e){return e*(t.text?t.text.length:0)}var Mw={id:"legend",_element:Sw,start(t,e,i){const n=t.legend=new Sw({ctx:t.ctx,options:i,chart:t});wb.configure(t,n,i),wb.addBox(t,n)},stop(t){wb.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;wb.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),c=Cy(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:o&&(a||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Aw extends jb{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Bg(i.text)?i.text.length:1;this._padding=Cy(i.padding);const r=n*ky(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:r,options:s}=this,o=s.align;let a,l,c,h=0;return this.isHorizontal()?(l=B_(o,i,r),c=e+t,a=r-i):("left"===s.position?(l=i+t,c=B_(o,n,e),h=-.5*s_):(l=r-t,c=B_(o,e,n),h=.5*s_),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=ky(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);vy(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:a,textAlign:F_(e.align),textBaseline:"middle",translation:[r,s]})}}var Cw={id:"title",_element:Aw,start(t,e,i){!function(t,e){const i=new Aw({ctx:t.ctx,options:e,chart:t});wb.configure(t,i,e),wb.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;wb.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;wb.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kw=new WeakMap;var Pw={id:"subtitle",start(t,e,i){const n=new Aw({ctx:t.ctx,options:i,chart:t});wb.configure(t,n,i),wb.addBox(t,n),kw.set(t,n)},stop(t){wb.removeBox(t,kw.get(t)),kw.delete(t)},beforeUpdate(t,e,i){const n=kw.get(t);wb.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Iw={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,r+=t.y,++s}}return{x:n/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let i,n,r,s=e.x,o=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=E_(e,n.getCenterPoint());t<a&&(a=t,r=n)}}if(r){const t=r.tooltipPosition();s=t.x,o=t.y}return{x:s,y:o}}};function Dw(t,e){return e&&(Bg(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ow(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Lw(t,e){const{element:i,datasetIndex:n,index:r}=e,s=t.getDatasetMeta(n).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:t,label:o,parsed:s.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function zw(t,e){const i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=ky(e.bodyFont),c=ky(e.titleFont),h=ky(e.footerFont),u=s.length,d=r.length,p=n.length,f=Cy(e.padding);let m=f.height,g=0,_=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(_+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),_){m+=p*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(_-p)*l.lineHeight+(_-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*h.lineHeight+(d-1)*e.footerSpacing);let y=0;const v=function(t){g=Math.max(g,i.measureText(t).width+y)};return i.save(),i.font=c.string,qg(t.title,v),i.font=l.string,qg(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?o+2+e.boxPadding:0,qg(n,(t=>{qg(t.before,v),qg(t.lines,v),qg(t.after,v)})),y=0,i.font=h.string,qg(t.footer,v),i.restore(),g+=f.width,{width:g,height:m}}function Rw(t,e,i,n){const{x:r,width:s}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=r<=(a+l)/2?"left":"right":r<=s/2?c="left":r>=o-s/2&&(c="right"),function(t,e,i,n){const{x:r,width:s}=n,o=i.caretSize+i.caretPadding;return"left"===t&&r+s+o>e.width||"right"===t&&r-s-o<0||void 0}(c,t,e,i)&&(c="center"),c}function Fw(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Rw(t,e,i,n),yAlign:n}}function Bw(t,e,i,n){const{caretSize:r,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=r+s,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:p}=Ay(o);let f=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const m=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,c);return"center"===l?"left"===a?f+=c:"right"===a&&(f-=c):"left"===a?f-=Math.max(h,d)+r:"right"===a&&(f+=Math.max(u,p)+r),{x:A_(f,0,n.width-e.width),y:A_(m,0,n.height-e.height)}}function Nw(t,e,i){const n=Cy(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function jw(t){return Dw([],Ow(t))}function Vw(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Uw={beforeTitle:zg,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:zg,beforeBody:zg,beforeLabel:zg,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return Fg(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:zg,afterBody:zg,beforeFooter:zg,footer:zg,afterFooter:zg};function $w(t,e,i,n){const r=t[e].call(i,n);return void 0===r?Uw[e].call(i,n):r}class Hw extends jb{static positioners=Iw;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Pv(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Iy(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=$w(i,"beforeTitle",this,t),r=$w(i,"title",this,t),s=$w(i,"afterTitle",this,t);let o=[];return o=Dw(o,Ow(n)),o=Dw(o,Ow(r)),o=Dw(o,Ow(s)),o}getBeforeBody(t,e){return jw($w(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return qg(t,(t=>{const e={before:[],lines:[],after:[]},r=Vw(i,t);Dw(e.before,Ow($w(r,"beforeLabel",this,t))),Dw(e.lines,$w(r,"label",this,t)),Dw(e.after,Ow($w(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return jw($w(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=$w(i,"beforeFooter",this,t),r=$w(i,"footer",this,t),s=$w(i,"afterFooter",this,t);let o=[];return o=Dw(o,Ow(n)),o=Dw(o,Ow(r)),o=Dw(o,Ow(s)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],r=[],s=[];let o,a,l=[];for(o=0,a=e.length;o<a;++o)l.push(Lw(this.chart,e[o]));return t.filter&&(l=l.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),qg(l,(e=>{const i=Vw(t.callbacks,e);n.push($w(i,"labelColor",this,e)),r.push($w(i,"labelPointStyle",this,e)),s.push($w(i,"labelTextColor",this,e))})),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let r,s=[];if(n.length){const t=Iw[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=zw(this,i),o=Object.assign({},t,e),a=Fw(this.chart,i,o),l=Bw(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=s,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:r}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=Ay(o),{x:u,y:d}=t,{width:p,height:f}=e;let m,g,_,y,v,b;return"center"===r?(v=d+f/2,"left"===n?(m=u,g=m-s,y=v+s,b=v-s):(m=u+p,g=m+s,y=v-s,b=v+s),_=m):(g="left"===n?u+Math.max(a,c)+s:"right"===n?u+p-Math.max(l,h)-s:this.caretX,"top"===r?(y=d,v=y-s,m=g-s,_=g+s):(y=d+f,v=y+s,m=g+s,_=g-s),b=y),{x1:m,x2:g,x3:_,y1:y,y2:v,y3:b}}drawTitle(t,e,i){const n=this.title,r=n.length;let s,o,a;if(r){const l=mv(i.rtl,this.x,this.width);for(t.x=Nw(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=ky(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,a=0;a<r;++a)e.fillText(n[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,a+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,n,r){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=r,c=ky(r.bodyFont),h=Nw(this,"left",r),u=n.x(h),d=a<c.lineHeight?(c.lineHeight-a)/2:0,p=e.y+d;if(r.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=n.leftForLtr(u,l)+l/2,c=p+a/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,hy(t,e,i,c),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,hy(t,e,i,c)}else{t.lineWidth=Ng(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=n.leftForLtr(u,l),i=n.leftForLtr(n.xPlus(u,1),l-2),o=Ay(s.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,by(t,{x:e,y:p,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),by(t,{x:i,y:p+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,l,a),t.strokeRect(e,p,l,a),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ky(i.bodyFont);let u=h.lineHeight,d=0;const p=mv(i.rtl,this.x,this.width),f=function(i){e.fillText(i,p.x(t.x+d),t.y+u/2),t.y+=u+r},m=p.textAlign(s);let g,_,y,v,b,x,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=Nw(this,m,i),e.fillStyle=i.bodyColor,qg(this.beforeBody,f),d=o&&"right"!==m?"center"===s?l/2+c:l+2+c:0,v=0,x=n.length;v<x;++v){for(g=n[v],_=this.labelTextColors[v],e.fillStyle=_,qg(g.before,f),y=g.lines,o&&y.length&&(this._drawColorBox(e,t,v,p,i),u=Math.max(h.lineHeight,a)),b=0,w=y.length;b<w;++b)f(y[b]),u=h.lineHeight;qg(g.after,f)}d=0,u=h.lineHeight,qg(this.afterBody,f),t.y-=r}drawFooter(t,e,i){const n=this.footer,r=n.length;let s,o;if(r){const a=mv(i.rtl,this.x,this.width);for(t.x=Nw(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",s=ky(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<r;++o)e.fillText(n[o],a.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:r,yAlign:s}=this,{x:o,y:a}=t,{width:l,height:c}=i,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:p}=Ay(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(o+h,a),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+l-u,a),e.quadraticCurveTo(o+l,a,o+l,a+u),"center"===s&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+l,a+c-p),e.quadraticCurveTo(o+l,a+c,o+l-p,a+c),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+d,a+c),e.quadraticCurveTo(o,a+c,o,a+c-d),"center"===s&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(o,a+h),e.quadraticCurveTo(o,a,o+h,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=Iw[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=zw(this,t),o=Object.assign({},i,this._size),a=Fw(e,t,o),l=Bw(t,o,a,e);n._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Cy(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),gv(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),_v(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),r=!Wg(i,n),s=this._positionChanged(n,e);(r||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,i),o=this._positionChanged(s,t),a=e||!Wg(s,r)||o;return a&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const r=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const s=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:r}=this,s=Iw[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}var qw={id:"tooltip",_element:Hw,positioners:Iw,afterInit(t,e,i){i&&(t.tooltip=new Hw({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Uw},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ww=Object.freeze({__proto__:null,Colors:iw,Decimation:sw,Filler:ww,Legend:Mw,SubTitle:Pw,Title:Cw,Tooltip:qw});function Gw(t,e,i,n){const r=t.indexOf(e);if(-1===r)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return r!==t.lastIndexOf(e)?i:r}function Zw(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Yw(t,e){const i=[],{bounds:n,step:r,min:s,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:u}=t,d=r||1,p=c-1,{min:f,max:m}=e,g=!Fg(s),_=!Fg(o),y=!Fg(l),v=(m-f)/(h+1);let b,x,w,E,S=g_((m-f)/p/d)*d;if(S<1e-14&&!g&&!_)return[{value:f},{value:m}];E=Math.ceil(m/S)-Math.floor(f/S),E>p&&(S=g_(E*S/p/d)*d),Fg(a)||(b=Math.pow(10,a),S=Math.ceil(S*b)/b),"ticks"===n?(x=Math.floor(f/S)*S,w=Math.ceil(m/S)*S):(x=f,w=m),g&&_&&r&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-s)/r,S/1e3)?(E=Math.round(Math.min((o-s)/S,c)),S=(o-s)/E,x=s,w=o):y?(x=g?s:x,w=_?o:w,E=l-1,S=(w-x)/E):(E=(w-x)/S,E=m_(E,Math.round(E),S/1e3)?Math.round(E):Math.ceil(E));const T=Math.max(x_(S),x_(x));b=Math.pow(10,Fg(a)?T:a),x=Math.round(x*b)/b,w=Math.round(w*b)/b;let M=0;for(g&&(u&&x!==s?(i.push({value:s}),x<s&&M++,m_(Math.round((x+M*S)*b)/b,s,Xw(s,v,t))&&M++):x<s&&M++);M<E;++M){const t=Math.round((x+M*S)*b)/b;if(_&&t>o)break;i.push({value:t})}return _&&u&&w!==o?i.length&&m_(i[i.length-1].value,o,Xw(o,v,t))?i[i.length-1].value=o:i.push({value:o}):_&&w!==o||i.push({value:w}),i}function Xw(t,e,{horizontal:i,minRotation:n}){const r=v_(n),s=(i?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}class Kw extends Xb{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Fg(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:r}=this;const s=t=>n=e?n:t,o=t=>r=i?r:t;if(t){const t=f_(n),e=f_(r);t<0&&e<0?o(0):t>0&&e>0&&s(0)}if(n===r){let e=0===r?1:Math.abs(.05*r);o(r+e),t||s(n-e)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Yw({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&y_(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return K_(t,this.chart.options.locale,this.options.ticks.format)}}class Qw extends Kw{static id="linear";static defaults={ticks:{callback:J_.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=jg(t)?t:0,this.max=jg(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=v_(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Jw=t=>Math.floor(p_(t)),tE=(t,e)=>Math.pow(10,Jw(t)+e);function eE(t){return 1===t/Math.pow(10,Jw(t))}function iE(t,e,i){const n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function nE(t,{min:e,max:i}){e=Vg(t.min,e);const n=[],r=Jw(e);let s=function(t,e){let i=Jw(e-t);for(;iE(t,e,i)>10;)i++;for(;iE(t,e,i)<10;)i--;return Math.min(i,Jw(t))}(e,i),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=r>s?Math.pow(10,r):0,c=Math.round((e-l)*o)/o,h=Math.floor((e-l)/a/10)*a*10;let u=Math.floor((c-h)/Math.pow(10,s)),d=Vg(t.min,Math.round((l+h+u*Math.pow(10,s))*o)/o);for(;d<i;)n.push({value:d,major:eE(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(s++,u=2,o=s>=0?1:o),d=Math.round((l+h+u*Math.pow(10,s))*o)/o;const p=Vg(t.max,d);return n.push({value:p,major:eE(p),significand:u}),n}class rE extends Xb{static id="logarithmic";static defaults={ticks:{callback:J_.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Kw.prototype.parse.apply(this,[t,e]);if(0!==i)return jg(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=jg(t)?Math.max(0,t):null,this.max=jg(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!jg(this._userMin)&&(this.min=t===tE(this.min,0)?tE(this.min,-1):tE(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const r=e=>i=t?i:e,s=t=>n=e?n:t;i===n&&(i<=0?(r(1),s(10)):(r(tE(i,-1)),s(tE(n,1)))),i<=0&&r(tE(n,-1)),n<=0&&s(tE(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=nE({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&y_(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":K_(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=p_(t),this._valueRange=p_(this.max)-p_(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(p_(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function sE(t){const e=t.ticks;if(e.display&&t.display){const t=Cy(e.backdropPadding);return Ug(e.font&&e.font.size,sy.font.size)+t.height}return 0}function oE(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function aE(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],s=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?s_/s:0;for(let u=0;u<s;u++){const s=o.setContext(t.getPointLabelContext(u));r[u]=s.padding;const d=t.getPointPosition(u,t.drawingArea+r[u],a),p=ky(s.font),f=(l=t.ctx,c=p,h=Bg(h=t._pointLabels[u])?h:[h],{w:ay(l,c.string,h),h:h.length*c.lineHeight});n[u]=f;const m=T_(t.getIndexAngle(u)+a),g=Math.round(b_(m));lE(i,e,m,oE(g,d.x,f.w,0,180),oE(g,d.y,f.h,90,270))}var l,c,h;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const n=[],r=t._pointLabels.length,s=t.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:sE(s)/2,additionalAngle:o?s_/r:0};let c;for(let s=0;s<r;s++){l.padding=i[s],l.size=e[s];const r=cE(t,s,l);n.push(r),"auto"===a&&(r.visible=hE(r,c),r.visible&&(c=r))}return n}(t,n,r)}function lE(t,e,i,n,r){const s=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.start<e.l?(a=(e.l-n.start)/s,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function cE(t,e,i){const n=t.drawingArea,{extra:r,additionalAngle:s,padding:o,size:a}=i,l=t.getPointPosition(e,n+r+o,s),c=Math.round(b_(T_(l.angle+h_))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),u=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),d=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function hE(t,e){if(!e)return!0;const{left:i,top:n,right:r,bottom:s}=t;return!(dy({x:i,y:n},e)||dy({x:i,y:s},e)||dy({x:r,y:n},e)||dy({x:r,y:s},e))}function uE(t,e,i){const{left:n,top:r,right:s,bottom:o}=i,{backdropColor:a}=e;if(!Fg(a)){const i=Ay(e.borderRadius),l=Cy(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=r-l.top,u=s-n+l.width,d=o-r+l.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),by(t,{x:c,y:h,w:u,h:d,radius:i}),t.fill()):t.fillRect(c,h,u,d)}}function dE(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,o_);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),r.lineTo(i.x,i.y)}}class pE extends Kw{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:J_.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Cy(sE(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=jg(t)&&!isNaN(t)?t:0,this.max=jg(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/sE(this.options))}generateTickLabels(t){Kw.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=Hg(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?aE(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return T_(t*(o_/(this._pointLabels.length||1))+v_(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(Fg(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Fg(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return Iy(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-h_+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),dE(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:r}=e,s=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const e=t._pointLabelItems[r];if(!e.visible)continue;const s=n.setContext(t.getPointLabelContext(r));uE(i,s,e);const o=ky(s.font),{x:a,y:l,textAlign:c}=e;vy(i,t._pointLabels[r],a,l+o.lineHeight/2,o,{color:s.color,textAlign:c,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),o=n.setContext(i),l=r.setContext(i);!function(t,e,i,n,r){const s=t.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!n||!a||!l||i<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash),s.lineDashOffset=r.dashOffset,s.beginPath(),dE(t,i,o,n),s.closePath(),s.stroke(),s.restore())}(this,o,a,s,l)}})),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:s}=n;s&&r&&(t.lineWidth=s,t.strokeStyle=r,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let r,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ky(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=Cy(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}vy(t,n.label,0,-r,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})})),t.restore()}drawTitle(){}}const fE={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mE=Object.keys(fE);function gE(t,e){return t-e}function _E(t,e){if(Fg(e))return null;const i=t._adapter,{parser:n,round:r,isoWeekday:s}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),jg(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!__(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function yE(t,e,i,n){const r=mE.length;for(let s=mE.indexOf(t);s<r-1;++s){const t=fE[mE[s]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return mE[s]}return mE[r-1]}function vE(t,e,i){if(i){if(i.length){const{lo:n,hi:r}=k_(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function bE(t,e,i){const n=[],r={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],r[a]=o,n.push({value:a,major:!1});return 0!==s&&i?function(t,e,i,n){const r=t._adapter,s=+r.startOf(e[0].value,n),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+r.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}(t,n,r,i):n}class xE extends Xb{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new ib._date(t.adapters.date);n.init(e),Kg(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:_E(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(r=Math.max(r,t.max))}s&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=jg(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=jg(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,s=function(t,e,i){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?yE(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let s=mE.length-1;s>=mE.indexOf(i);s--){const i=mE[s];if(fE[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return mE[i?mE.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=mE.indexOf(t)+1,i=mE.length;e<i;++e)if(fE[mE[e]].common)return mE[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&s.reverse(),bE(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=A_(n,0,s),r=A_(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,s=r.unit||yE(r.minUnit,e,i,this._getLabelCapacity(e)),o=Ug(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=__(a)||!0===a,c={};let h,u,d=e;if(l&&(d=+t.startOf(d,"isoWeek",a)),d=+t.startOf(d,l?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p="data"===n.ticks.source&&this.getDataTimestamps();for(h=d,u=0;h<i;h=+t.add(h,o,s),u++)vE(c,h,p);return h!==i&&"ticks"!==n.bounds&&1!==u||vE(c,h,p),Object.keys(c).sort(gE).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,r=e||i[n];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const r=this.options,s=r.ticks.callback;if(s)return Hg(s,[t,e,i],this);const o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=i[e],d=l&&h&&u&&u.major;return this._adapter.format(t,n||(d?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=v_(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),s=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*s,h:i*s+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,bE(this,[t],this._majorUnit),n),s=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(_E(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return L_(t.sort(gE))}}function wE(t,e,i){let n,r,s,o,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=P_(t,"pos",e)),({pos:n,time:s}=t[a]),({pos:r,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=P_(t,"time",e)),({time:n,pos:s}=t[a]),({time:r,pos:o}=t[l]));const c=r-n;return c?s+(o-s)*(e-n)/c:s}var EE=Object.freeze({__proto__:null,CategoryScale:class extends Xb{static id="category";static defaults={ticks:{callback:Zw}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Fg(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:A_(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Gw(i,t,Ug(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Zw.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Qw,LogarithmicScale:rE,RadialLinearScale:pE,TimeScale:xE,TimeSeriesScale:class extends xE{static id="timeseries";static defaults=xE.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=wE(e,this.min),this._tableRange=wE(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],r=[];let s,o,a,l,c;for(s=0,o=t.length;s<o;++s)l=t[s],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=n.length;s<o;++s)c=n[s+1],a=n[s-1],l=n[s],Math.round((c+a)/2)!==l&&r.push({time:l,pos:s/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(wE(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return wE(this._table,i*this._tableRange+this._minPos,!0)}}});const SE=[Jv,Yx,Ww,EE];Ax.register(...SE);function TE(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function ME(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}let AE={};function CE(){return AE}function kE(){return Object.assign({},CE())}const PE={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function IE(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const DE={date:IE({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:IE({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:IE({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},OE={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function LE(t){return(e,i)=>{let n;if("formatting"===(i?.context?String(i.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,r=i?.width?String(i.width):e;n=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth,r=i?.width?String(i.width):t.defaultWidth;n=t.values[r]||t.values[e]}return n[t.argumentCallback?t.argumentCallback(e):e]}}const zE={ordinalNumber:(t,e)=>{const i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:LE({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:LE({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:LE({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:LE({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:LE({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function RE(t){return(e,i={})=>{const n=i.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(r);if(!s)return null;const o=s[0],a=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(a,(t=>t.test(o))):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(a,(t=>t.test(o)));let c;c=t.valueCallback?t.valueCallback(l):l,c=i.valueCallback?i.valueCallback(c):c;return{value:c,rest:e.slice(o.length)}}}const FE={ordinalNumber:(BE={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match(BE.matchPattern);if(!i)return null;const n=i[0],r=t.match(BE.parsePattern);if(!r)return null;let s=BE.valueCallback?BE.valueCallback(r[0]):r[0];return s=e.valueCallback?e.valueCallback(s):s,{value:s,rest:t.slice(n.length)}}),era:RE({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:RE({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:RE({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:RE({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:RE({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var BE;const NE={code:"en-US",formatDistance:(t,e,i)=>{let n;const r=PE[t];return n="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+n:n+" ago":n},formatLong:DE,formatRelative:(t,e,i,n)=>OE[t],localize:zE,match:FE,options:{weekStartsOn:0,firstWeekContainsDate:1}};const jE=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},VE=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},UE={p:VE,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],n=i[1],r=i[2];if(!r)return jE(t,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;default:s=e.dateTime({width:"full"})}return s.replace("{{date}}",jE(n,e)).replace("{{time}}",VE(r,e))}},$E=/^D+$/,HE=/^Y+$/,qE=["D","DD","YY","YYYY"];function WE(t){return $E.test(t)}function GE(t){return HE.test(t)}function ZE(t,e,i){const n=function(t,e,i){const n="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,i);if(console.warn(n),qE.includes(t))throw new RangeError(n)}function YE(t,e){const i=e instanceof Date?ME(e,0):new e(0);return i.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i}class XE{subPriority=0;validate(t,e){return!0}}class KE extends XE{constructor(t,e,i,n,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=n,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class QE extends XE{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:ME(t,YE(t,Date))}}class JE{run(t,e,i,n){const r=this.parse(t,e,i,n);return r?{setter:new KE(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}Math.pow(10,8);const tS=6048e5,eS=864e5,iS=6e4,nS=36e5,rS=/^(1[0-2]|0?\d)/,sS=/^(3[0-1]|[0-2]?\d)/,oS=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,aS=/^(5[0-3]|[0-4]?\d)/,lS=/^(2[0-3]|[0-1]?\d)/,cS=/^(2[0-4]|[0-1]?\d)/,hS=/^(1[0-1]|0?\d)/,uS=/^(1[0-2]|0?\d)/,dS=/^[0-5]?\d/,pS=/^[0-5]?\d/,fS=/^\d/,mS=/^\d{1,2}/,gS=/^\d{1,3}/,_S=/^\d{1,4}/,yS=/^-?\d+/,vS=/^-?\d/,bS=/^-?\d{1,2}/,xS=/^-?\d{1,3}/,wS=/^-?\d{1,4}/,ES=/^([+-])(\d{2})(\d{2})?|Z/,SS=/^([+-])(\d{2})(\d{2})|Z/,TS=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,MS=/^([+-])(\d{2}):(\d{2})|Z/,AS=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function CS(t,e){return t?{value:e(t.value),rest:t.rest}:t}function kS(t,e){const i=e.match(t);return i?{value:parseInt(i[0],10),rest:e.slice(i[0].length)}:null}function PS(t,e){const i=e.match(t);if(!i)return null;if("Z"===i[0])return{value:0,rest:e.slice(1)};const n="+"===i[1]?1:-1,r=i[2]?parseInt(i[2],10):0,s=i[3]?parseInt(i[3],10):0,o=i[5]?parseInt(i[5],10):0;return{value:n*(r*nS+s*iS+1e3*o),rest:e.slice(i[0].length)}}function IS(t){return kS(yS,t)}function DS(t,e){switch(t){case 1:return kS(fS,e);case 2:return kS(mS,e);case 3:return kS(gS,e);case 4:return kS(_S,e);default:return kS(new RegExp("^\\d{1,"+t+"}"),e)}}function OS(t,e){switch(t){case 1:return kS(vS,e);case 2:return kS(bS,e);case 3:return kS(xS,e);case 4:return kS(wS,e);default:return kS(new RegExp("^-?\\d{1,"+t+"}"),e)}}function LS(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function zS(t,e){const i=e>0,n=i?e:1-e;let r;if(n<=50)r=t||100;else{const e=n+50;r=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return i?r:1-r}function RS(t){return t%400==0||t%4==0&&t%100!=0}function FS(t,e){const i=CE(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=TE(t),s=r.getDay(),o=(s<n?7:0)+s-n;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function BS(t,e){const i=TE(t),n=i.getFullYear(),r=CE(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=ME(t,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=FS(o,e),l=ME(t,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const c=FS(l,e);return i.getTime()>=a.getTime()?n+1:i.getTime()>=c.getTime()?n:n-1}function NS(t){return FS(t,{weekStartsOn:1})}function jS(t,e){const i=CE(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=BS(t,e),s=ME(t,0);s.setFullYear(r,0,n),s.setHours(0,0,0,0);return FS(s,e)}function VS(t,e){const i=TE(t),n=+FS(i,e)-+jS(i,e);return Math.round(n/tS)+1}function US(t,e,i){const n=TE(t),r=VS(n,i)-e;return n.setDate(n.getDate()-7*r),n}function $S(t){const e=TE(t),i=e.getFullYear(),n=ME(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=NS(n),s=ME(t,0);s.setFullYear(i,0,4),s.setHours(0,0,0,0);const o=NS(s);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function HS(t){const e=$S(t),i=ME(t,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),NS(i)}function qS(t){const e=TE(t),i=+NS(e)-+HS(e);return Math.round(i/tS)+1}function WS(t,e){const i=TE(t),n=qS(i)-e;return i.setDate(i.getDate()-7*n),i}const GS=[31,28,31,30,31,30,31,31,30,31,30,31],ZS=[31,29,31,30,31,30,31,31,30,31,30,31];function YS(t,e){const i=TE(t);return isNaN(e)?ME(t,NaN):e?(i.setDate(i.getDate()+e),i):i}function XS(t,e,i){const n=CE(),r=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=TE(t),o=s.getDay(),a=7-r;return YS(s,e<0||e>6?e-(o+a)%7:((e%7+7)%7+a)%7-(o+a)%7)}function KS(t){let e=TE(t).getDay();return 0===e&&(e=7),e}function QS(t,e){const i=TE(t);return YS(i,e-KS(i))}function JS(t){const e=TE(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}const tT={G:new class extends JE{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends JE{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const n=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return CS(DS(4,t),n);case"yo":return CS(i.ordinalNumber(t,{unit:"year"}),n);default:return CS(DS(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const n=t.getFullYear();if(i.isTwoDigitYear){const e=zS(i.year,n);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const r="era"in e&&1!==e.era?1-i.year:i.year;return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}},Y:new class extends JE{priority=130;parse(t,e,i){const n=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return CS(DS(4,t),n);case"Yo":return CS(i.ordinalNumber(t,{unit:"year"}),n);default:return CS(DS(e.length,t),n)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,n){const r=BS(t,n);if(i.isTwoDigitYear){const e=zS(i.year,r);return t.setFullYear(e,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),FS(t,n)}const s="era"in e&&1!==e.era?1-i.year:i.year;return t.setFullYear(s,0,n.firstWeekContainsDate),t.setHours(0,0,0,0),FS(t,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends JE{priority=130;parse(t,e){return OS("R"===e?4:e.length,t)}set(t,e,i){const n=ME(t,0);return n.setFullYear(i,0,4),n.setHours(0,0,0,0),NS(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends JE{priority=130;parse(t,e){return OS("u"===e?4:e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends JE{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return DS(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth(3*(i-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends JE{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return DS(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth(3*(i-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends JE{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const n=t=>t-1;switch(e){case"M":return CS(kS(rS,t),n);case"MM":return CS(DS(2,t),n);case"Mo":return CS(i.ordinalNumber(t,{unit:"month"}),n);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}},L:new class extends JE{priority=110;parse(t,e,i){const n=t=>t-1;switch(e){case"L":return CS(kS(rS,t),n);case"LL":return CS(DS(2,t),n);case"Lo":return CS(i.ordinalNumber(t,{unit:"month"}),n);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends JE{priority=100;parse(t,e,i){switch(e){case"w":return kS(aS,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return DS(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,n){return FS(US(t,i,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends JE{priority=100;parse(t,e,i){switch(e){case"I":return kS(aS,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return DS(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return NS(WS(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends JE{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return kS(sS,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return DS(e.length,t)}}validate(t,e){const i=RS(t.getFullYear()),n=t.getMonth();return i?e>=1&&e<=ZS[n]:e>=1&&e<=GS[n]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends JE{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return kS(oS,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return DS(e.length,t)}}validate(t,e){return RS(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends JE{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,n){return(t=XS(t,i,n)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends JE{priority=90;parse(t,e,i,n){const r=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return CS(DS(e.length,t),r);case"eo":return CS(i.ordinalNumber(t,{unit:"day"}),r);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,n){return(t=XS(t,i,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends JE{priority=90;parse(t,e,i,n){const r=t=>{const e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return CS(DS(e.length,t),r);case"co":return CS(i.ordinalNumber(t,{unit:"day"}),r);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,n){return(t=XS(t,i,n)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends JE{priority=90;parse(t,e,i){const n=t=>0===t?7:t;switch(e){case"i":case"ii":return DS(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return CS(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),n);case"iiiii":return CS(i.day(t,{width:"narrow",context:"formatting"}),n);case"iiiiii":return CS(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),n);default:return CS(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),n)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return(t=QS(t,i)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends JE{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(LS(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends JE{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(LS(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends JE{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(LS(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends JE{priority=70;parse(t,e,i){switch(e){case"h":return kS(uS,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return DS(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const n=t.getHours()>=12;return n&&i<12?t.setHours(i+12,0,0,0):n||12!==i?t.setHours(i,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends JE{priority=70;parse(t,e,i){switch(e){case"H":return kS(lS,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return DS(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends JE{priority=70;parse(t,e,i){switch(e){case"K":return kS(hS,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return DS(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends JE{priority=70;parse(t,e,i){switch(e){case"k":return kS(cS,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return DS(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const n=i<=24?i%24:i;return t.setHours(n,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends JE{priority=60;parse(t,e,i){switch(e){case"m":return kS(dS,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return DS(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]},s:new class extends JE{priority=50;parse(t,e,i){switch(e){case"s":return kS(pS,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return DS(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]},S:new class extends JE{priority=30;parse(t,e){return CS(DS(e.length,t),(t=>Math.trunc(t*Math.pow(10,3-e.length))))}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]},X:new class extends JE{priority=10;parse(t,e){switch(e){case"X":return PS(ES,t);case"XX":return PS(SS,t);case"XXXX":return PS(TS,t);case"XXXXX":return PS(AS,t);default:return PS(MS,t)}}set(t,e,i){return e.timestampIsSet?t:ME(t,t.getTime()-JS(t)-i)}incompatibleTokens=["t","T","x"]},x:new class extends JE{priority=10;parse(t,e){switch(e){case"x":return PS(ES,t);case"xx":return PS(SS,t);case"xxxx":return PS(TS,t);case"xxxxx":return PS(AS,t);default:return PS(MS,t)}}set(t,e,i){return e.timestampIsSet?t:ME(t,t.getTime()-JS(t)-i)}incompatibleTokens=["t","T","X"]},t:new class extends JE{priority=40;parse(t){return IS(t)}set(t,e,i){return[ME(t,1e3*i),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends JE{priority=20;parse(t){return IS(t)}set(t,e,i){return[ME(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}},eT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nT=/^'([^]*?)'?$/,rT=/''/g,sT=/\S/,oT=/[a-zA-Z]/;function aT(t,e,i,n){const r=kE(),s=n?.locale??r.locale??NE,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0;if(""===e)return""===t?TE(i):ME(i,NaN);const l={firstWeekContainsDate:o,weekStartsOn:a,locale:s},c=[new QE],h=e.match(iT).map((t=>{const e=t[0];if(e in UE){return(0,UE[e])(t,s.formatLong)}return t})).join("").match(eT),u=[];for(let r of h){!n?.useAdditionalWeekYearTokens&&GE(r)&&ZE(r,e,t),!n?.useAdditionalDayOfYearTokens&&WE(r)&&ZE(r,e,t);const o=r[0],a=tT[o];if(a){const{incompatibleTokens:e}=a;if(Array.isArray(e)){const t=u.find((t=>e.includes(t.token)||t.token===o));if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${r}\` at the same time`)}else if("*"===a.incompatibleTokens&&u.length>0)throw new RangeError(`The format string mustn't contain \`${r}\` and any other token at the same time`);u.push({token:o,fullToken:r});const n=a.run(t,r,s.match,l);if(!n)return ME(i,NaN);c.push(n.setter),t=n.rest}else{if(o.match(oT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===r?r="'":"'"===o&&(r=r.match(nT)[1].replace(rT,"'")),0!==t.indexOf(r))return ME(i,NaN);t=t.slice(r.length)}}if(t.length>0&&sT.test(t))return ME(i,NaN);const d=c.map((t=>t.priority)).sort(((t,e)=>e-t)).filter(((t,e,i)=>i.indexOf(t)===e)).map((t=>c.filter((e=>e.priority===t)).sort(((t,e)=>e.subPriority-t.subPriority)))).map((t=>t[0]));let p=TE(i);if(isNaN(p.getTime()))return ME(i,NaN);const f={};for(const t of d){if(!t.validate(p,l))return ME(i,NaN);const e=t.set(p,f,l);Array.isArray(e)?(p=e[0],Object.assign(f,e[1])):p=e}return ME(i,p)}function lT(t,e){const i=e?.additionalDigits??2,n=function(t){const e={},i=t.split(cT.dateTimeDelimiter);let n;if(i.length>2)return e;/:/.test(i[0])?n=i[0]:(e.date=i[0],n=i[1],cT.timeZoneDelimiter.test(e.date)&&(e.date=t.split(cT.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length)));if(n){const t=cT.timezone.exec(n);t?(e.time=n.replace(t[1],""),e.timezone=t[1]):e.time=n}return e}(t);let r;if(n.date){const t=function(t,e){const i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};const r=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?r:100*s,restDateString:t.slice((n[1]||n[2]).length)}}(n.date,i);r=function(t,e){if(null===e)return new Date(NaN);const i=t.match(hT);if(!i)return new Date(NaN);const n=!!i[4],r=pT(i[1]),s=pT(i[2])-1,o=pT(i[3]),a=pT(i[4]),l=pT(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){const n=new Date(0);n.setUTCFullYear(t,0,4);const r=n.getUTCDay()||7,s=7*(e-1)+i+1-r;return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);{const t=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(mT[e]||(gT(t)?29:28))}(e,s,o)&&function(t,e){return e>=1&&e<=(gT(t)?366:365)}(e,r)?(t.setUTCFullYear(e,s,Math.max(r,o)),t):new Date(NaN)}}(t.restDateString,t.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const s=r.getTime();let o,a=0;if(n.time&&(a=function(t){const e=t.match(uT);if(!e)return NaN;const i=fT(e[1]),n=fT(e[2]),r=fT(e[3]);if(!function(t,e,i){if(24===t)return 0===e&&0===i;return i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,r))return NaN;return i*nS+n*iS+1e3*r}(n.time),isNaN(a)))return new Date(NaN);if(!n.timezone){const t=new Date(s+a),e=new Date(0);return e.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),e.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),e}return o=function(t){if("Z"===t)return 0;const e=t.match(dT);if(!e)return 0;const i="+"===e[1]?-1:1,n=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;if(!function(t,e){return e>=0&&e<=59}(0,r))return NaN;return i*(n*nS+r*iS)}(n.timezone),isNaN(o)?new Date(NaN):new Date(s+a+o)}const cT={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,uT=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dT=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pT(t){return t?parseInt(t):1}function fT(t){return t&&parseFloat(t.replace(",","."))||0}const mT=[31,null,31,30,31,30,31,31,30,31,30,31];function gT(t){return t%400==0||t%4==0&&t%100!=0}function _T(t){return t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function yT(t){if(!_T(t)&&"number"!=typeof t)return!1;const e=TE(t);return!isNaN(Number(e))}function vT(t){const e=TE(t);return e.setHours(0,0,0,0),e}function bT(t,e){const i=vT(t),n=vT(e),r=+i-JS(i),s=+n-JS(n);return Math.round((r-s)/eS)}function xT(t){const e=TE(t),i=ME(t,0);return i.setFullYear(e.getFullYear(),0,1),i.setHours(0,0,0,0),i}function wT(t){const e=TE(t);return bT(e,xT(e))+1}function ET(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const ST={y(t,e){const i=t.getFullYear(),n=i>0?i:1-i;return ET("yy"===e?n%100:n,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):ET(i+1,2)},d(t,e){return ET(t.getDate(),e.length)},a(t,e){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h(t,e){return ET(t.getHours()%12||12,e.length)},H(t,e){return ET(t.getHours(),e.length)},m(t,e){return ET(t.getMinutes(),e.length)},s(t,e){return ET(t.getSeconds(),e.length)},S(t,e){const i=e.length,n=t.getMilliseconds();return ET(Math.trunc(n*Math.pow(10,i-3)),e.length)}},TT="midnight",MT="noon",AT="morning",CT="afternoon",kT="evening",PT="night",IT={G:function(t,e,i){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){const e=t.getFullYear(),n=e>0?e:1-e;return i.ordinalNumber(n,{unit:"year"})}return ST.y(t,e)},Y:function(t,e,i,n){const r=BS(t,n),s=r>0?r:1-r;if("YY"===e){return ET(s%100,2)}return"Yo"===e?i.ordinalNumber(s,{unit:"year"}):ET(s,e.length)},R:function(t,e){return ET($S(t),e.length)},u:function(t,e){return ET(t.getFullYear(),e.length)},Q:function(t,e,i){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ET(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ET(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){const n=t.getMonth();switch(e){case"M":case"MM":return ST.M(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return ET(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,n){const r=VS(t,n);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):ET(r,e.length)},I:function(t,e,i){const n=qS(t);return"Io"===e?i.ordinalNumber(n,{unit:"week"}):ET(n,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):ST.d(t,e)},D:function(t,e,i){const n=wT(t);return"Do"===e?i.ordinalNumber(n,{unit:"dayOfYear"}):ET(n,e.length)},E:function(t,e,i){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){const r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return ET(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){const r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return ET(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){const n=t.getDay(),r=0===n?7:n;switch(e){case"i":return String(r);case"ii":return ET(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){const n=t.getHours();let r;switch(r=12===n?MT:0===n?TT:n/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,i){const n=t.getHours();let r;switch(r=n>=17?kT:n>=12?CT:n>=4?AT:PT,e){case"B":case"BB":case"BBB":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),i.ordinalNumber(e,{unit:"hour"})}return ST.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):ST.H(t,e)},K:function(t,e,i){const n=t.getHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):ET(n,e.length)},k:function(t,e,i){let n=t.getHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):ET(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):ST.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):ST.s(t,e)},S:function(t,e){return ST.S(t,e)},X:function(t,e,i){const n=t.getTimezoneOffset();if(0===n)return"Z";switch(e){case"X":return OT(n);case"XXXX":case"XX":return LT(n);default:return LT(n,":")}},x:function(t,e,i){const n=t.getTimezoneOffset();switch(e){case"x":return OT(n);case"xxxx":case"xx":return LT(n);default:return LT(n,":")}},O:function(t,e,i){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+DT(n,":");default:return"GMT"+LT(n,":")}},z:function(t,e,i){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+DT(n,":");default:return"GMT"+LT(n,":")}},t:function(t,e,i){return ET(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,i){return ET(t.getTime(),e.length)}};function DT(t,e=""){const i=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),s=n%60;return 0===s?i+String(r):i+String(r)+e+ET(s,2)}function OT(t,e){if(t%60==0){return(t>0?"-":"+")+ET(Math.abs(t)/60,2)}return LT(t,e)}function LT(t,e=""){const i=t>0?"-":"+",n=Math.abs(t);return i+ET(Math.trunc(n/60),2)+e+ET(n%60,2)}const zT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FT=/^'([^]*?)'?$/,BT=/''/g,NT=/[a-zA-Z]/;function jT(t,e,i){const n=CE(),r=i?.locale??n.locale??NE,s=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=TE(t);if(!yT(a))throw new RangeError("Invalid time value");let l=e.match(RT).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,UE[e])(t,r.formatLong)}return t})).join("").match(zT).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:VT(t)};if(IT[e])return{isToken:!0,value:t};if(e.match(NT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:r};return l.map((n=>{if(!n.isToken)return n.value;const s=n.value;(!i?.useAdditionalWeekYearTokens&&GE(s)||!i?.useAdditionalDayOfYearTokens&&WE(s))&&ZE(s,e,String(t));return(0,IT[s[0]])(a,s,r.localize,c)})).join("")}function VT(t){const e=t.match(FT);return e?e[1].replace(BT,"'"):t}function UT(t,e){return ME(t,+TE(t)+e)}function $T(t,e){return UT(t,1e3*e)}function HT(t,e){return UT(t,e*iS)}function qT(t,e){return UT(t,e*nS)}function WT(t,e){return YS(t,7*e)}function GT(t,e){const i=TE(t);if(isNaN(e))return ME(t,NaN);if(!e)return i;const n=i.getDate(),r=ME(t,i.getTime());r.setMonth(i.getMonth()+e+1,0);return n>=r.getDate()?r:(i.setFullYear(r.getFullYear(),r.getMonth(),n),i)}function ZT(t,e){return GT(t,3*e)}function YT(t,e){return GT(t,12*e)}function XT(t,e){return+TE(t)-+TE(e)}function KT(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return 0===i?0:i}}function QT(t,e,i){const n=XT(t,e)/1e3;return KT(i?.roundingMethod)(n)}function JT(t,e,i){const n=XT(t,e)/iS;return KT(i?.roundingMethod)(n)}function tM(t,e,i){const n=XT(t,e)/nS;return KT(i?.roundingMethod)(n)}function eM(t,e){const i=TE(t),n=TE(e),r=iM(i,n),s=Math.abs(bT(i,n));i.setDate(i.getDate()-r*s);const o=r*(s-Number(iM(i,n)===-r));return 0===o?0:o}function iM(t,e){const i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function nM(t,e,i){const n=eM(t,e)/7;return KT(i?.roundingMethod)(n)}function rM(t,e){const i=TE(t),n=TE(e),r=i.getTime()-n.getTime();return r<0?-1:r>0?1:r}function sM(t,e){const i=TE(t),n=TE(e);return 12*(i.getFullYear()-n.getFullYear())+(i.getMonth()-n.getMonth())}function oM(t){const e=TE(t);return e.setHours(23,59,59,999),e}function aM(t){const e=TE(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function lM(t){const e=TE(t);return+oM(e)==+aM(e)}function cM(t,e){const i=TE(t),n=TE(e),r=rM(i,n),s=Math.abs(sM(i,n));let o;if(s<1)o=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-r*s);let e=rM(i,n)===-r;lM(TE(t))&&1===s&&1===rM(t,n)&&(e=!1),o=r*(s-Number(e))}return 0===o?0:o}function hM(t,e,i){const n=cM(t,e)/3;return KT(i?.roundingMethod)(n)}function uM(t,e){const i=TE(t),n=TE(e);return i.getFullYear()-n.getFullYear()}function dM(t,e){const i=TE(t),n=TE(e),r=rM(i,n),s=Math.abs(uM(i,n));i.setFullYear(1584),n.setFullYear(1584);const o=r*(s-+(rM(i,n)===-r));return 0===o?0:o}function pM(t){const e=TE(t);return e.setMilliseconds(0),e}function fM(t){const e=TE(t);return e.setSeconds(0,0),e}function mM(t){const e=TE(t);return e.setMinutes(0,0,0),e}function gM(t){const e=TE(t);return e.setDate(1),e.setHours(0,0,0,0),e}function _M(t){const e=TE(t),i=e.getMonth(),n=i-i%3;return e.setMonth(n,1),e.setHours(0,0,0,0),e}function yM(t){const e=TE(t);return e.setMilliseconds(999),e}function vM(t){const e=TE(t);return e.setSeconds(59,999),e}function bM(t){const e=TE(t);return e.setMinutes(59,59,999),e}function xM(t,e){const i=CE(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=TE(t),s=r.getDay(),o=6+(s<n?-7:0)-(s-n);return r.setDate(r.getDate()+o),r.setHours(23,59,59,999),r}function wM(t){const e=TE(t),i=e.getMonth(),n=i-i%3+3;return e.setMonth(n,0),e.setHours(23,59,59,999),e}function EM(t){const e=TE(t),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}const SM={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};function TM(t){var e=window.getComputedStyle(document.body),i=e.getPropertyValue("--text-contrast-color"),n=e.getPropertyValue("--text-contrast-2-color"),r=e.getPropertyValue("--text-color"),s=e.getPropertyValue("--divider-contrast-color"),o=!1;return t&&(o=t.isReverseScaleY),{responsive:!0,maintainAspectRatio:!1,showAllTooltips:!0,layout:{autoPadding:!1,padding:{left:20,right:20,top:40}},scales:{x:{type:"time",time:{unit:"year"},ticks:{color:n},border:{color:s},grid:{display:!1}},y:{reverse:o,display:!1,beginAtZero:!0,grid:{display:!1}}},elements:{point:{radius:4.5,hoverRadius:8,backgroundColor:i},line:{borderColor:i}},plugins:{legend:{display:!1},tooltip:{enabled:!1,intersect:!1,caretSize:0,backgroundColor:i,bodyColor:r,cornerSize:4,caretPadding:16,xAlign:"center",yAlign:"bottom",displayColors:!1,callbacks:{title:()=>"",label:(t,e)=>{t.formattedValue}}}}}}ib._date.override({_id:"date-fns",formats:function(){return SM},parse:function(t,e){if(null==t)return null;const i=typeof t;return"number"===i||t instanceof Date?t=TE(t):"string"===i&&(t="string"==typeof e?aT(t,e,new Date,this.options):lT(t,this.options)),yT(t)?t.getTime():null},format:function(t,e){return jT(t,e,this.options)},add:function(t,e,i){switch(i){case"millisecond":return UT(t,e);case"second":return $T(t,e);case"minute":return HT(t,e);case"hour":return qT(t,e);case"day":return YS(t,e);case"week":return WT(t,e);case"month":return GT(t,e);case"quarter":return ZT(t,e);case"year":return YT(t,e);default:return t}},diff:function(t,e,i){switch(i){case"millisecond":return XT(t,e);case"second":return QT(t,e);case"minute":return JT(t,e);case"hour":return tM(t,e);case"day":return eM(t,e);case"week":return nM(t,e);case"month":return cM(t,e);case"quarter":return hM(t,e);case"year":return dM(t,e);default:return 0}},startOf:function(t,e,i){switch(e){case"second":return pM(t);case"minute":return fM(t);case"hour":return mM(t);case"day":return vT(t);case"week":return FS(t);case"isoWeek":return FS(t,{weekStartsOn:+i});case"month":return gM(t);case"quarter":return _M(t);case"year":return xT(t);default:return t}},endOf:function(t,e){switch(e){case"second":return yM(t);case"minute":return vM(t);case"hour":return bM(t);case"day":return oM(t);case"week":return xM(t);case"month":return aM(t);case"quarter":return wM(t);case"year":return EM(t);default:return t}}});var MM=window.getComputedStyle(document.body),AM=MM.getPropertyValue("--text-contrast-color"),CM=MM.getPropertyValue("--text-color"),kM={id:"alwaysShowTooltip",afterDraw(t,e,i){var{ctx:n}=t;n.save(),t.data.datasets.forEach(((e,i)=>{t.getDatasetMeta(i).data.forEach(((t,i)=>{if(!t.hidden){var r,s,o,a,{x:l,y:c}=t.tooltipPosition(),h=e.data[i].y,u=n.measureText(h).width;dO.plugins.responsive.mobile?(u<=16&&(u=17),r=0===i?l-u/2+4:u<=17?l-u/2:i===e.data.length-1?l-u:l-u/2-4,s=c-30,o=0===i?l+3:u<=17?l+4:i===e.data.length-1?l-u/2+4:l,a=c-15,0===i&&u<=17&&(r=l-13,o=l)):(r=0===i?l-8:i===e.data.length-1?l-u-4:l-u/2-8,s=c-40,o=0===i?l:i===e.data.length-1?l-u+4:l-u/2,a=c-20),n.save(),n.beginPath(),dO.plugins.responsive.mobile?n.roundRect(r,s,0!==i?u+8:u<=17?u+9:u-2,22,8):n.roundRect(r,s,u+16,30,8),n.clip(),n.fillStyle=AM,dO.plugins.responsive.mobile?n.fillRect(r,s,0!==i?u+8:u<=17?u+9:u-2,22):n.fillRect(r,s,u+16,30),n.restore(),n.fillStyle=CM,dO.plugins.responsive.mobile&&(n.font="0.9rem Arial",n.textAlign="center"),n.fillText(h,o,a)}}))})),n.restore()}};function PM(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}Ax.defaults.font={family:"Golos",size:14};var IM=new WeakMap,DM=new WeakMap;function OM(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var LM=new WeakMap;function zM(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function RM(t,e,i){return e&&zM(t.prototype,e),i&&zM(t,i),t}function FM(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function BM(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function NM(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?BM(Object(i),!0).forEach((function(e){FM(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):BM(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jM(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,r=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){r=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw s}}return i}(t,e)||UM(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VM(t){return function(t){if(Array.isArray(t))return $M(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||UM(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UM(t,e){if(t){if("string"==typeof t)return $M(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?$M(t,e):void 0}}function $M(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function HM(t,e){return Object.getOwnPropertyNames(Object(t)).reduce((function(i,n){var r=Object.getOwnPropertyDescriptor(Object(t),n),s=Object.getOwnPropertyDescriptor(Object(e),n);return Object.defineProperty(i,n,s||r)}),{})}function qM(t){return"string"==typeof t}function WM(t){return Array.isArray(t)}function GM(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=HM(e);return void 0!==i.types?t=i.types:void 0!==i.split&&(t=i.split),void 0!==t&&(i.types=(qM(t)||WM(t)?String(t):"").split(",").map((function(t){return String(t).trim()})).filter((function(t){return/((line)|(word)|(char))/i.test(t)}))),(i.absolute||i.position)&&(i.absolute=i.absolute||/absolute/.test(e.position)),i}function ZM(t){var e=qM(t)||WM(t)?String(t):"";return{none:!e,lines:/line/i.test(e),words:/word/i.test(e),chars:/char/i.test(e)}}function YM(t){return null!==t&&"object"==typeof t}function XM(t){return YM(t)&&/^(1|3|11)$/.test(t.nodeType)}function KM(t){return WM(t)?t:null==t?[]:function(t){return YM(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0}(t.length)}(t)?Array.prototype.slice.call(t):[t]}function QM(t){var e=t;return qM(t)&&(e=/^(#[a-z]\w+)$/.test(t.trim())?document.getElementById(t.trim().slice(1)):document.querySelectorAll(t)),KM(e).reduce((function(t,e){return[].concat(VM(t),VM(KM(e).filter(XM)))}),[])}!function(){function t(){for(var t=arguments.length,e=0;e<t;e++){var i=e<0||arguments.length<=e?void 0:arguments[e];1===i.nodeType||11===i.nodeType?this.appendChild(i):this.appendChild(document.createTextNode(String(i)))}}function e(){for(;this.lastChild;)this.removeChild(this.lastChild);arguments.length&&this.append.apply(this,arguments)}function i(){for(var t=this.parentNode,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var r=i.length;if(t)for(r||t.removeChild(this);r--;){var s=i[r];"object"!=typeof s?s=this.ownerDocument.createTextNode(s):s.parentNode&&s.parentNode.removeChild(s),r?t.insertBefore(this.previousSibling,s):t.replaceChild(s,this)}}"undefined"!=typeof Element&&(Element.prototype.append||(Element.prototype.append=t,DocumentFragment.prototype.append=t),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=e,DocumentFragment.prototype.replaceChildren=e),Element.prototype.replaceWith||(Element.prototype.replaceWith=i,DocumentFragment.prototype.replaceWith=i))}();var JM=Object.entries,tA="_splittype",eA={},iA=0;function nA(t,e,i){if(!YM(t))return console.warn("[data.set] owner is not an object"),null;var n=t[tA]||(t[tA]=++iA),r=eA[n]||(eA[n]={});return void 0===i?e&&Object.getPrototypeOf(e)===Object.prototype&&(eA[n]=NM(NM({},r),e)):void 0!==e&&(r[e]=i),i}function rA(t,e){var i=YM(t)?t[tA]:null,n=i&&eA[i]||{};return void 0===e?n:n[e]}function sA(t){var e=t&&t[tA];e&&(delete t[e],delete eA[e])}var oA="\\ud800-\\udfff",aA="\\u0300-\\u036f\\ufe20-\\ufe23",lA="\\u20d0-\\u20f0",cA="\\ufe0e\\ufe0f",hA="[".concat(oA,"]"),uA="[".concat(aA).concat(lA,"]"),dA="\\ud83c[\\udffb-\\udfff]",pA="(?:".concat(uA,"|").concat(dA,")"),fA="[^".concat(oA,"]"),mA="(?:\\ud83c[\\udde6-\\uddff]){2}",gA="[\\ud800-\\udbff][\\udc00-\\udfff]",_A="\\u200d",yA="".concat(pA,"?"),vA="[".concat(cA,"]?"),bA=vA+yA+("(?:"+_A+"(?:"+[fA,mA,gA].join("|")+")"+vA+yA+")*"),xA="(?:".concat(["".concat(fA).concat(uA,"?"),uA,mA,gA,hA].join("|"),"\n)"),wA=RegExp("".concat(dA,"(?=").concat(dA,")|").concat(xA).concat(bA),"g"),EA=RegExp("[".concat([_A,oA,aA,lA,cA].join(""),"]"));function SA(t){return EA.test(t)}function TA(t){return SA(t)?function(t){return t.match(wA)||[]}(t):function(t){return t.split("")}(t)}function MA(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t=null==(e=t)?"":String(e))&&qM(t)&&!i&&SA(t)?TA(t):t.split(i)}function AA(t,e){var i=document.createElement(t);return e?(Object.keys(e).forEach((function(t){var n=e[t],r=qM(n)?n.trim():n;null!==r&&""!==r&&("children"===t?i.append.apply(i,VM(KM(r))):i.setAttribute(t,r))})),i):i}var CA={splitClass:"",lineClass:"line",wordClass:"word",charClass:"char",types:["lines","words","chars"],absolute:!1,tagName:"div"};function kA(t,e){var i,n=ZM((e=HM(CA,e)).types),r=e.tagName,s=t.nodeValue,o=document.createDocumentFragment(),a=[];return/^\s/.test(s)&&o.append(" "),i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return(t?String(t):"").trim().replace(/\s+/g," ").split(e)}(s).reduce((function(t,i,s,l){var c,h;return n.chars&&(h=MA(i).map((function(t){var i=AA(r,{class:"".concat(e.splitClass," ").concat(e.charClass),style:"display: inline-block;",children:t});return nA(i,"isChar",!0),a=[].concat(VM(a),[i]),i}))),n.words||n.lines?(nA(c=AA(r,{class:"".concat(e.wordClass," ").concat(e.splitClass),style:"display: inline-block; ".concat(n.words&&e.absolute?"position: relative;":""),children:n.chars?h:i}),{isWord:!0,isWordStart:!0,isWordEnd:!0}),o.appendChild(c)):h.forEach((function(t){o.appendChild(t)})),s<l.length-1&&o.append(" "),n.words?t.concat(c):t}),[]),/\s$/.test(s)&&o.append(" "),t.replaceWith(o),{words:i,chars:a}}function PA(t,e){var i=t.nodeType,n={words:[],chars:[]};if(!/(1|3|11)/.test(i))return n;if(3===i&&/\S/.test(t.nodeValue))return kA(t,e);var r=KM(t.childNodes);if(r.length&&(nA(t,"isSplit",!0),!rA(t).isRoot)){t.style.display="inline-block",t.style.position="relative";var s=t.nextSibling,o=t.previousSibling,a=t.textContent||"",l=s?s.textContent:" ",c=o?o.textContent:" ";nA(t,{isWordEnd:/\s$/.test(a)||/^\s/.test(l),isWordStart:/^\s/.test(a)||/\s$/.test(c)})}return r.reduce((function(t,i){var n=PA(i,e),r=n.words,s=n.chars;return{words:[].concat(VM(t.words),VM(r)),chars:[].concat(VM(t.chars),VM(s))}}),n)}function IA(t){rA(t).isWord?(sA(t),t.replaceWith.apply(t,VM(t.childNodes))):KM(t.children).forEach((function(t){return IA(t)}))}function DA(t,e,i){var n,r,s,o=ZM(e.types),a=e.tagName,l=t.getElementsByTagName("*"),c=[],h=[],u=null,d=[],p=t.parentElement,f=t.nextElementSibling,m=document.createDocumentFragment(),g=window.getComputedStyle(t),_=g.textAlign,y=.2*parseFloat(g.fontSize);return e.absolute&&(s={left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth},r=t.offsetWidth,n=t.offsetHeight,nA(t,{cssWidth:t.style.width,cssHeight:t.style.height})),KM(l).forEach((function(n){var r=n.parentElement===t,s=function(t,e,i,n){if(!i.absolute)return{top:e?t.offsetTop:null};var r=t.offsetParent,s=jM(n,2),o=s[0],a=s[1],l=0,c=0;if(r&&r!==document.body){var h=r.getBoundingClientRect();l=h.x+o,c=h.y+a}var u=t.getBoundingClientRect(),d=u.width,p=u.height,f=u.x;return{width:d,height:p,top:u.y+a-c,left:f+o-l}}(n,r,e,i),a=s.width,l=s.height,d=s.top,p=s.left;/^br$/i.test(n.nodeName)||(o.lines&&r&&((null===u||d-u>=y)&&(u=d,c.push(h=[])),h.push(n)),e.absolute&&nA(n,{top:d,left:p,width:a,height:l}))})),p&&p.removeChild(t),o.lines&&(d=c.map((function(t){var i=AA(a,{class:"".concat(e.splitClass," ").concat(e.lineClass),style:"display: block; text-align: ".concat(_,"; width: 100%;")});nA(i,"isLine",!0);var n={height:0,top:1e4};return m.appendChild(i),t.forEach((function(t,e,r){var s=rA(t),o=s.isWordEnd,a=s.top,l=s.height,c=r[e+1];n.height=Math.max(n.height,l),n.top=Math.min(n.top,a),i.appendChild(t),o&&rA(c).isWordStart&&i.append(" ")})),e.absolute&&nA(i,{height:n.height,top:n.top}),i})),o.words||IA(m),t.replaceChildren(m)),e.absolute&&(t.style.width="".concat(t.style.width||r,"px"),t.style.height="".concat(n,"px"),KM(l).forEach((function(t){var e=rA(t),i=e.isLine,n=e.top,r=e.left,o=e.width,a=e.height,l=rA(t.parentElement),c=!i&&l.isLine;t.style.top="".concat(c?n-l.top:n,"px"),t.style.left="".concat(i?s.left:r-(c?s.left:0),"px"),t.style.height="".concat(a,"px"),t.style.width="".concat(i?s.width:o,"px"),t.style.position="absolute"}))),p&&(f?p.insertBefore(t,f):p.appendChild(t)),d}var OA=HM(CA,{}),LA=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isSplit=!1,this.settings=HM(OA,GM(i)),this.elements=QM(e),this.split()}return RM(t,null,[{key:"clearData",value:function(){Object.keys(eA).forEach((function(t){delete eA[t]}))}},{key:"setDefaults",value:function(t){return OA=HM(OA,GM(t)),CA}},{key:"revert",value:function(t){QM(t).forEach((function(t){var e=rA(t),i=e.isSplit,n=e.html,r=e.cssWidth,s=e.cssHeight;i&&(t.innerHTML=n,t.style.width=r||"",t.style.height=s||"",sA(t))}))}},{key:"create",value:function(e,i){return new t(e,i)}},{key:"data",get:function(){return eA}},{key:"defaults",get:function(){return OA},set:function(t){OA=HM(OA,GM(t))}}]),RM(t,[{key:"split",value:function(t){var e=this;this.revert(),this.elements.forEach((function(t){nA(t,"html",t.innerHTML)})),this.lines=[],this.words=[],this.chars=[];var i=[window.pageXOffset,window.pageYOffset];void 0!==t&&(this.settings=HM(this.settings,GM(t)));var n=ZM(this.settings.types);n.none||(this.elements.forEach((function(t){nA(t,"isRoot",!0);var i=PA(t,e.settings),n=i.words,r=i.chars;e.words=[].concat(VM(e.words),VM(n)),e.chars=[].concat(VM(e.chars),VM(r))})),this.elements.forEach((function(t){if(n.lines||e.settings.absolute){var r=DA(t,e.settings,i);e.lines=[].concat(VM(e.lines),VM(r))}})),this.isSplit=!0,window.scrollTo(i[0],i[1]),JM(eA).forEach((function(t){var e=jM(t,2),i=e[0],n=e[1],r=n.isRoot,s=n.isSplit;r&&s||(eA[i]=null,delete eA[i])})))}},{key:"revert",value:function(){this.isSplit&&(this.lines=null,this.words=null,this.chars=null,this.isSplit=!1),t.revert(this.elements)}}]),t}();function zA(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var RA=new WeakMap,FA=new WeakMap,BA=new WeakMap,NA=new WeakMap,jA=new WeakMap,VA=new WeakMap,UA=new WeakMap,$A=new WeakMap,HA=new WeakMap,qA=new WeakMap;var WA=class extends Da{constructor(t,e){super(t,e),zA(this,RA,{writable:!0,value:void 0}),zA(this,FA,{writable:!0,value:void 0}),zA(this,BA,{writable:!0,value:void 0}),zA(this,NA,{writable:!0,value:void 0}),zA(this,jA,{writable:!0,value:void 0}),zA(this,VA,{writable:!0,value:void 0}),zA(this,UA,{writable:!0,value:void 0}),zA(this,$A,{writable:!0,value:void 0}),zA(this,HA,{writable:!0,value:void 0}),zA(this,qA,{writable:!0,value:void 0}),Ra(this,RA,t.querySelector(".swiper")),Ra(this,BA,t.querySelector(".js-slider-prev")),Ra(this,NA,t.querySelector(".js-slider-next")),Ra(this,jA,t.querySelector(".js-pagination")),Ra(this,UA,t.querySelector(".js-students-life-slider-bg")),Ra(this,$A,t.querySelector(".js-students-life-slider-title")),Ra(this,HA,t.querySelector(".js-students-life-slider-note")),Ra(this,qA,t.querySelector(".js-students-life-slider-nav"))}init(){var t=za(this,RA).getAttribute("data-alides-perview-sm"),e=za(this,RA).getAttribute("data-alides-perview-md"),i=za(this,RA).getAttribute("data-alides-perview-lg");this.initScrollTrigger(),Ra(this,FA,new Bc(za(this,RA),{modules:[jc,Uc,Gc],pagination:{el:za(this,jA)},fadeEffect:{crossFade:!0},navigation:{prevEl:za(this,BA),nextEl:za(this,NA)},breakpoints:{0:{slidesPerView:t},767:{slidesPerView:e},1023:{slidesPerView:i}}}))}initScrollTrigger(){Ra(this,VA,k.ZP.timeline({scrollTrigger:{trigger:this.$element,once:!0,start:"top center+=70"}}));var{words:t}=LA.create(za(this,$A),{types:"words",tagName:"span"});k.ZP.set(za(this,UA),{clipPath:"inset(100% 0% 0% 0%)",willChange:"clip-path",transition:"none"}),k.ZP.set(za(this,RA),{autoAlpha:0,xPercent:100}),k.ZP.set([t,za(this,qA),za(this,HA)],{autoAlpha:0,yPercent:30}),za(this,VA).to(za(this,UA),{clipPath:"inset(0% 0% 0% 0%)",ease:"power2.in",duration:.7}).to(t,{autoAlpha:1,yPercent:0,stagger:.1}).to([za(this,qA),za(this,HA)],{autoAlpha:1,yPercent:0,duration:.7},"<+=0.2").to(za(this,RA),{xPercent:0,autoAlpha:1,ease:"power3.out"},">-=0.2").set(za(this,UA),{willChange:"auto"})}destroy(){za(this,FA).destroy(),window.removeEventListener("resize",this.onResize)}};function GA(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var ZA=new WeakMap;var YA=class extends E{constructor(t){var e,i,n;super(),s(this,"$button",void 0),s(this,"$openIcon",void 0),s(this,"$closeIcon",void 0),s(this,"state",void 0),s(this,"tl",void 0),GA(this,ZA,{writable:!0,value:void 0}),this.$button=t,this.$openIcon=null===(e=this.$button)||void 0===e?void 0:e.querySelector(".js-burger-open"),this.$closeIcon=null===(i=this.$button)||void 0===i?void 0:i.querySelector(".js-burger-close"),Ra(this,ZA,this.onClick.bind(this)),null===(n=this.$button)||void 0===n||n.addEventListener("click",za(this,ZA)),this.close(!0)}onClick(){this.state=!this.state,document.documentElement.classList.toggle("_menu-opened",this.state),this.state?this.open():this.close()}open(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.emit("open");var e=t?0:.3;this.initTl(),this.tl.set(this.$closeIcon,{scale:1.5,opacity:0}),this.tl.to(this.$openIcon,{duration:e,scale:.4,opacity:0}),this.tl.to(this.$closeIcon,{duration:e,scale:1,opacity:1},"<+0.15")}close(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.emit("close");var e=t?0:.3;this.initTl(),this.tl.set(this.$openIcon,{scale:1.5,opacity:0}),this.tl.to(this.$closeIcon,{duration:e,scale:.4,opacity:0}),this.tl.to(this.$openIcon,{duration:e,scale:1,opacity:1},"<+0.15")}initTl(){var t;null===(t=this.tl)||void 0===t||t.kill(),this.tl=k.gsap.timeline()}};function XA(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var{toArray:KA}=k.gsap.utils,QA=new WeakMap,JA=new WeakMap,tC=new WeakMap,eC=new WeakMap;var iC=__webpack_require__(517),nC=__webpack_require__.n(iC);__webpack_require__(3692);function rC(t,e){oC(t,e),e.add(t)}function sC(t,e,i){oC(t,e),e.set(t,i)}function oC(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aC(t,e,i){return function(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}(e,t),i}nC().accessToken="pk.eyJ1IjoibWFuYWdlcyIsImEiOiJjbHQzejZqY20xcW1mMmtvZW4wajRkcnVoIn0.7PrRXvM-MIwzgOpBCIvdyA";var lC='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3 21H21M6 18V9.99998M10 18V9.99998M14 18V9.99998M18 18V9.99998M20 6.99998L12.424 2.26498C12.2702 2.16884 12.1933 2.12077 12.1108 2.10203C12.0379 2.08546 11.9621 2.08546 11.8892 2.10203C11.8067 2.12077 11.7298 2.16884 11.576 2.26498L4 6.99998H20Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',cC=12,hC=new WeakMap,uC=new WeakMap,dC=new WeakMap,pC=new WeakMap,fC=new WeakMap,mC=new WeakSet,gC=new WeakSet,_C=new WeakSet,yC=new WeakSet,vC=new WeakSet,bC=new WeakSet,xC=new WeakSet;function wC(){Ra(this,hC,new(nC().Map)({container:this.$map,style:"mapbox://styles/mapbox/".concat(this.ctx.plugins.themeManager.currentTheme,"-v10"),center:za(this,pC),zoom:cC,scrollZoom:!1,bearing:25,pitch:45})),za(this,hC).once("load",(()=>{aC(this,gC,EC).call(this),aC(this,vC,MC).call(this),aC(this,yC,TC).call(this),this.$canvas=this.$map.querySelector("canvas"),this.$content.querySelectorAll(".map-item__close-control").forEach((t=>{t.addEventListener("click",(()=>{aC(this,xC,CC).call(this)}))}));var t=this.$content.querySelector(".map__select"),e=null==t?void 0:t.querySelector("select");k.gsap.set(t,{clearProps:"all"}),null==e||e.addEventListener("change",(t=>{aC(this,bC,AC).call(this,t.target.value)})),this.$zoomIn.addEventListener("click",(()=>{za(this,hC).zoomIn()})),this.$zoomOut.addEventListener("click",(()=>{za(this,hC).zoomOut()})),this.$zoomIn.disabled=!1,this.$zoomOut.disabled=!1}))}function EC(){var t=za(this,hC).getStyle().layers.find((t=>"symbol"===t.type&&t.layout["text-field"])).id;za(this,hC).addLayer({id:"add-3d-buildings",source:"composite","source-layer":"building",filter:["==","extrude","true"],type:"fill-extrusion",minzoom:15,paint:{"fill-extrusion-color":"#aaa","fill-extrusion-height":["interpolate",["linear"],["zoom"],15,0,15.05,["get","height"]],"fill-extrusion-base":["interpolate",["linear"],["zoom"],15,0,15.05,["get","min_height"]],"fill-extrusion-opacity":.6}},t)}function SC(t){"white"===t?t="light":"black"===t&&(t="dark"),za(this,hC).setStyle("mapbox://styles/mapbox/".concat(t,"-v10")),za(this,hC).once("styledata",(()=>{aC(this,gC,EC).call(this),aC(this,yC,TC).call(this)}))}function TC(){["admin-0-boundary","admin-0-boundary-bg"].forEach((t=>{za(this,hC).setLayoutProperty(t,"visibility","none")}))}function MC(){za(this,uC).forEach((t=>{var e=document.createElement("div");e.classList.add("map-marker"),e.classList.add("_".concat(t.markerColor)),e.innerHTML=lC,e.setAttribute("data-marker-id",t.id),new(nC().Marker)(e).setLngLat({lat:t.coordinates[0],lon:t.coordinates[1]}).addTo(za(this,hC)),e.addEventListener("click",(()=>{aC(this,bC,AC).call(this,t.id)}))}))}function AC(t){var e;if(t!==za(this,dC)){null===(e=za(this,fC))||void 0===e||e.kill(),Ra(this,fC,k.gsap.timeline());var i=za(this,fC),n=za(this,uC).find((e=>e.id===t)),r=za(this,dC)?this.$content.querySelector('[data-id="'.concat(za(this,dC),'"]')):null,s=za(this,dC)?this.$map.querySelector('[data-marker-id="'.concat(za(this,dC),'"]')):null,o=this.$content.querySelector('[data-id="'.concat(t,'"]')),a=this.$map.querySelector('[data-marker-id="'.concat(t,'"]'));i.set([o].concat(r?[r]:[]),{willChange:"opacity"}),r&&(s.classList.remove("_active"),i.to(r,{opacity:0,y:15,duration:.35},">0.15"),i.set(r,{pointerEvents:"none",visibility:"hidden"})),i.set(o,{clearProps:"all"}),i.add((()=>{za(this,hC).flyTo({center:[n.coordinates[1],n.coordinates[0]],zoom:16}),this.$zoomIn.disabled=!0,this.$zoomOut.disabled=!0,a.classList.add("_active"),k.gsap.set(this.$canvas,{pointerEvents:"none"})})),i.to(o,{opacity:1,y:0,duration:.35},">1"),i.set([o].concat(r?[r]:[]),{clearProps:"willChange"}),Ra(this,dC,t)}}function CC(){var t;null===(t=za(this,fC))||void 0===t||t.kill(),Ra(this,fC,k.gsap.timeline());var e=za(this,fC),i=za(this,dC)?this.$content.querySelector('[data-id="'.concat(za(this,dC),'"]')):null,n=za(this,dC)?this.$map.querySelector('[data-marker-id="'.concat(za(this,dC),'"]')):null;i&&(e.set(i,{willChange:"opacity"}),e.to(i,{opacity:0,y:15,duration:.35},">0.15"),e.add((()=>{n.classList.remove("_active"),this.$zoomIn.disabled=!1,this.$zoomOut.disabled=!1,za(this,hC).flyTo({center:za(this,pC),zoom:cC})}),"<0.15"),e.set(i,{pointerEvents:"none",visibility:"hidden"}),e.set(this.$canvas,{clearProps:"pointerEvents"}),e.set(i,{clearProps:"willChange"}),Ra(this,dC,""))}var kC=class extends Da{constructor(t,e){super(t,e),rC(this,xC),rC(this,bC),rC(this,vC),rC(this,yC),rC(this,_C),rC(this,gC),rC(this,mC),s(this,"$map",void 0),s(this,"$canvas",void 0),s(this,"$content",void 0),sC(this,hC,{writable:!0,value:void 0}),sC(this,uC,{writable:!0,value:void 0}),sC(this,dC,{writable:!0,value:void 0}),sC(this,pC,{writable:!0,value:[37.61556,55.75222]}),sC(this,fC,{writable:!0,value:void 0}),s(this,"$zoomIn",void 0),s(this,"$zoomOut",void 0)}init(){this.$map=this.$element.querySelector("#map-canvas"),this.$content=this.$element.querySelector("#map-content"),this.$zoomIn=this.$element.querySelector(".map__zoom-in"),this.$zoomOut=this.$element.querySelector(".map__zoom-out");var t=this.$element.dataset.centerCoords;t&&Ra(this,pC,JSON.parse(t).reverse()),Ra(this,uC,Array.from(this.$content.querySelectorAll(".map-item")).map((t=>({id:t.dataset.id,coordinates:JSON.parse(t.dataset.coords),markerColor:t.dataset.markerColor?t.dataset.markerColor:"primary"})))),aC(this,mC,wC).call(this),this.ctx.plugins.themeManager.on("change",(t=>{aC(this,_C,SC).call(this,t)}));var e=()=>{var t,e=0;this.$content.querySelectorAll(".map-item").forEach((t=>{t.offsetHeight>e&&(e=t.offsetHeight)})),null===(t=this.$content.querySelector(".map__items"))||void 0===t||t.style.setProperty("height","".concat(e,"px"))};document.addEventListener("resize",(()=>{e()})),e()}},PC="_active";class IC extends Da{constructor(t,e){super(t,e),this.UI={element:t,activator:document.querySelectorAll(".js-sp-panel-trigger"),close:t.querySelector(".js-sp-panel-close"),btnImagesOff:t.querySelector(".js-sp-panel-img-off"),btnImagesOn:t.querySelector(".js-sp-panel-img-on")},this.UI.btnImagesOn.hidden=!0,this.params={textSize:localStorage.getItem("sp_text")||"normal",images:localStorage.getItem("sp_images")||"on"},this.setTextSize(this.params.textSize),this.toggleImages(this.params.images),this.UI.activator.forEach((t=>{t.addEventListener("click",(()=>{this.ctx.plugins.lenis.stop(),this.UI.element.classList.toggle(PC)}))})),this.UI.close.addEventListener("click",(()=>{this.ctx.plugins.lenis.start(),this.UI.element.classList.remove(PC)})),this.UI.element.querySelectorAll("[data-sp-text]").forEach((t=>{t.addEventListener("click",(()=>{this.setTextSize(t.getAttribute("data-sp-text")||"normal"),window.dispatchEvent(new Event("resize"))}))})),this.UI.element.querySelectorAll("[data-sp-theme]").forEach((t=>{t.addEventListener("click",(()=>{this.ctx.plugins.themeManager.setTheme(t.getAttribute("data-sp-theme")||"light"),this.ctx.plugins.themeManager.setPropertyItems()}))})),"off"===localStorage.getItem("sp_images")?(this.UI.btnImagesOn.hidden=!1,this.UI.btnImagesOff.hidden=!0):(this.UI.btnImagesOn.hidden=!0,this.UI.btnImagesOff.hidden=!1),this.UI.btnImagesOff.addEventListener("click",(()=>{this.toggleImages("off"),this.UI.btnImagesOff.hidden=!0,this.UI.btnImagesOn.hidden=!1})),this.UI.btnImagesOn.addEventListener("click",(()=>{this.toggleImages("on"),this.UI.btnImagesOn.hidden=!0,this.UI.btnImagesOff.hidden=!1})),this.UI.element.querySelector(".js-sp-panel-img-reset").addEventListener("click",(()=>{this.setTextSize("normal"),this.ctx.plugins.themeManager.setTheme("light"),this.ctx.plugins.themeManager.resetBtns(),this.ctx.plugins.themeManager.setPropertyItems(),this.toggleImages("on")}))}init(){document.addEventListener("click",(t=>{this.$element.classList.contains(PC)&&t.target.classList.contains("sp-panel__bg")&&(this.ctx.plugins.lenis.start(),this.UI.element.classList.remove(PC))}))}close(){this.UI.element.classList.remove("_opened")}setTextSize(t){document.documentElement.style.setProperty("font-size",IC.textParams[t]+"%"),localStorage.setItem("sp_text",t)}toggleImages(t){document.querySelectorAll("[src], [data-src], [data-bg]").forEach((e=>{null===e.getAttribute("data-theme")&&("off"===t?(document.documentElement.classList.add("images-off"),e.style.setProperty("visibility","hidden"),localStorage.setItem("sp_images","off")):(document.documentElement.classList.remove("images-off"),e.style.removeProperty("visibility"),localStorage.setItem("sp_images","on")))}))}destroy(){document.removeEventListener("click",(t=>{this.$element.classList.contains(PC)&&t.target.classList.contains("sp-panel__bg")&&(this.ctx.plugins.lenis.start(),this.UI.element.classList.remove(PC))}))}}function DC(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}s(IC,"textParams",{normal:62.5,medium:70.5,large:80});var OC=new WeakMap,LC=new WeakMap,zC=new WeakMap;function RC(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var FC="open",BC=".js-share__trigger",NC=".js-share__tooltip",jC=".js-share__share",VC=new WeakMap,UC=new WeakMap,$C=new WeakMap;var HC=class extends Da{constructor(t,e){super(t,e),s(this,"$trigger",void 0),s(this,"$tooltip",void 0),s(this,"$share",void 0),s(this,"state",!1),s(this,"shareData",{}),RC(this,VC,{writable:!0,value:void 0}),RC(this,UC,{writable:!0,value:void 0}),RC(this,$C,{writable:!0,value:void 0}),this.$trigger=this.$element.querySelector(BC),this.$tooltip=this.$element.querySelector(NC),this.$share=this.$element.querySelector(jC),Ra(this,VC,this.onTriggerClick.bind(this)),Ra(this,UC,this.onBodyClick.bind(this)),Ra(this,$C,this.onShareClick.bind(this))}init(){this.$trigger.addEventListener("click",za(this,VC)),this.$share&&this.$share.addEventListener("click",za(this,$C))}destroy(){this.$trigger.removeEventListener("click",za(this,VC)),this.$share.removeEventListener("click",za(this,$C))}onTriggerClick(){this.state?this.hide():this.show()}onBodyClick(t){t.target.closest(BC)||t.target.closest(NC)||this.hide()}onShareClick(){var t=this;return i((function*(){var e=t.$share.dataset.shareUrl||window.location.href;try{yield navigator.clipboard.writeText(e),t.ctx.plugins.toasts.success("Скопировано в буфер обмена")}catch(e){t.ctx.plugins.toasts.error(e.message)}}))()}show(){this.state=!0,this.$tooltip.classList.add(FC),document.body.addEventListener("click",za(this,UC))}hide(){this.state=!1,this.$tooltip.classList.remove(FC),document.body.removeEventListener("click",za(this,UC))}};function qC(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var{toArray:WC}=k.gsap.utils,GC={background:"var(--overflow-color-3)",position:"fixed",width:"100%",zIndex:99,height:"100%",top:0,left:0,opacity:0},ZC=new WeakMap,YC=new WeakMap,XC=new WeakMap;function KC(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var QC=new WeakMap,JC=new WeakMap,tk=new WeakMap;var ek=class extends Da{constructor(t,e){super(t,e),s(this,"isSlideChanging",!1),KC(this,QC,{writable:!0,value:0}),KC(this,JC,{writable:!0,value:null}),KC(this,tk,{writable:!0,value:null}),Object.assign(this,{UI:{imageSlides:this.$element.querySelectorAll(".js-fade-slider-image"),contentSlides:this.$element.querySelectorAll(".js-fade-slider-content"),counter:this.$element.querySelector(".js-fade-slider-counter"),btnPrev:this.$element.querySelector(".js-slider-prev"),btnNext:this.$element.querySelector(".js-slider-next")}}),this._bindedOnPrevClick=this._onPrevClick.bind(this),this._bindedOnNextClick=this._onNextClick.bind(this)}init(){this.UI.btnPrev.addEventListener("click",this._bindedOnPrevClick),this.UI.btnNext.addEventListener("click",this._bindedOnNextClick),this._changeCounter(),this.UI.imageSlides.forEach(((t,e)=>{0!==e&&k.gsap.set(t,{opacity:0})})),this.UI.contentSlides.forEach(((t,e)=>{0!==e&&k.gsap.set(t,{display:"none"})}))}destroy(){}_onPrevClick(){var t;if(!this.isSlideChanging){var e=za(this,QC);0===za(this,QC)?Ra(this,QC,this.UI.contentSlides.length-1):Ra(this,QC,(t=za(this,QC),t--,t)),this._changeCounter(),this._setActiveSlide(e,za(this,QC)),this._setActivePicture(e,za(this,QC))}}_onNextClick(){var t;if(!this.isSlideChanging){var e=za(this,QC);this.UI.contentSlides.length-1===za(this,QC)?Ra(this,QC,0):Ra(this,QC,(t=za(this,QC),t++,t)),this._changeCounter(),this._setActiveSlide(e,za(this,QC)),this._setActivePicture(e,za(this,QC))}}_changeCounter(){this.UI.counter.textContent="".concat(za(this,QC)+1," / ").concat(this.UI.contentSlides.length)}_setActiveSlide(t,e){var i;this.isSlideChanging=!0;var n=this.UI.contentSlides[t],r=this.UI.contentSlides[e];null===(i=za(this,JC))||void 0===i||i.kill(),Ra(this,JC,k.gsap.timeline()),za(this,JC).to(n,{opacity:0,duration:.2,ease:"power1.in"}),za(this,JC).set(n,{display:"none"}),za(this,JC).set(r,{opacity:0,display:"flex"}),za(this,JC).to(r,{opacity:1,duration:.3,ease:"power1.out",onComplete:()=>{this.isSlideChanging=!1}})}_setActivePicture(t,e){var i,n=this.UI.imageSlides[t],r=this.UI.imageSlides[e];null===(i=za(this,tk))||void 0===i||i.kill(),Ra(this,tk,k.gsap.timeline()),za(this,tk).to(n,{opacity:0,duration:.3,ease:"power1.in"}),za(this,tk).to(r,{opacity:1,duration:.3,ease:"power1.out"},"<+0")}};var ik=class extends Da{constructor(t,e){super(t,e),this.cardFront=t.querySelector(".js-flip-card-front"),this.cardBack=t.querySelector(".js-flip-card-back"),this.bindedOnClick=this.onClick.bind(this),e.on("resize:debounce",(()=>{this.setCardHeight()}))}init(){this.setCardHeight(),this.$element.addEventListener("click",this.bindedOnClick)}destroy(){this.$element.removeEventListener("click",this.bindedOnClick)}onClick(){this.$element.classList.toggle("_is-flipped")}setCardHeight(){var t=this.cardFront.scrollHeight,e=this.cardBack.scrollHeight;e>t&&(this.$element.style.minHeight="".concat(e,"px"))}};var nk=class extends Da{constructor(t,e){super(t,e),s(this,"instance",null)}init(){this.instance=new gd(this.$element,{range:!0,inline:!0,autoClose:!0,visible:!0})}destroy(){this.instance.destroy()}};function rk(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var sk=new WeakMap;var ok=class extends Da{constructor(t,e){super(t,e,{}),rk(this,sk,{writable:!0,value:()=>{var t,e=this.$element.getAttribute("href");if(e&&e.startsWith("#")&&!(e.length<2)){var i=document.querySelector(e);null!=i&&null!==(t=i.instance)&&void 0!==t&&t.open&&(this.$element.addEventListener("click",(t=>{t.preventDefault(),i.instance.open()})),this.destroy())}}})}init(){this.ctx.on("ready",za(this,sk))}destroy(){this.ctx.off("ready",za(this,sk))}};__webpack_require__(7200);var ak,lk,ck,hk,uk,dk,pk,fk,mk=class extends Da{constructor(t,e){super(t,e),s(this,"slider_1",null),s(this,"slider_2",null),s(this,"swiper_1",null),s(this,"swiper_2",null),s(this,"pagination",null)}init(){this.slider_1=this.$element.querySelector(".video-alumni-card-slider-titles "),this.slider_2=this.$element.querySelector(".video-alumni-card-slider-texts "),this.pagination=this.$element.querySelector(".swiper-pagination"),this.swiper_1=new Bc(this.slider_1,{modules:[$c],direction:"vertical",grabCursor:!0}),this.swiper_2=new Bc(this.slider_2,{modules:[Uc,Gc,$c],effect:"fade",fadeEffect:{crossFade:!0},grabCursor:!0,watchOverflow:!0,autoplay:{delay:2e3},autoplayDisableOnInteraction:!0,pagination:{el:this.pagination,clickable:!0}}),this.swiper_1.on("slideChange",(t=>{this.swiper_2.slideTo(t.activeIndex)})),this.swiper_2.on("slideChange",(t=>{this.swiper_1.slideToLoop(t.activeIndex)}))}destroy(){this.swiper_1.destroy(),this.swiper_2.destroy()}},gk=function(){return"undefined"!=typeof window},_k=function(){return ak||gk()&&(ak=window.gsap)&&ak.registerPlugin&&ak},yk=function(t){return"string"==typeof t},vk=function(t){return"function"==typeof t},bk=function(t,e){var i="x"===e?"Width":"Height",n="scroll"+i,r="client"+i;return t===ck||t===hk||t===uk?Math.max(hk[n],uk[n])-(ck["inner"+i]||hk[r]||uk[r]):t[n]-t["offset"+i]},xk=function(t,e){var i="scroll"+("x"===e?"Left":"Top");return t===ck&&(null!=t.pageXOffset?i="page"+e.toUpperCase()+"Offset":t=null!=hk[i]?hk:uk),function(){return t[i]}},wk=function(t,e){if(!(t=dk(t)[0])||!t.getBoundingClientRect)return console.warn("scrollTo target doesn't exist. Using 0")||{x:0,y:0};var i=t.getBoundingClientRect(),n=!e||e===ck||e===uk,r=n?{top:hk.clientTop-(ck.pageYOffset||hk.scrollTop||uk.scrollTop||0),left:hk.clientLeft-(ck.pageXOffset||hk.scrollLeft||uk.scrollLeft||0)}:e.getBoundingClientRect(),s={x:i.left-r.left,y:i.top-r.top};return!n&&e&&(s.x+=xk(e,"x")(),s.y+=xk(e,"y")()),s},Ek=function(t,e,i,n,r){return isNaN(t)||"object"==typeof t?yk(t)&&"="===t.charAt(1)?parseFloat(t.substr(2))*("-"===t.charAt(0)?-1:1)+n-r:"max"===t?bk(e,i)-r:Math.min(bk(e,i),wk(t,e)[i]-r):parseFloat(t)-r},Sk=function(){ak=_k(),gk()&&ak&&"undefined"!=typeof document&&document.body&&(ck=window,uk=document.body,hk=document.documentElement,dk=ak.utils.toArray,ak.config({autoKillThreshold:7}),pk=ak.config(),lk=1)},Tk={version:"3.12.4",name:"scrollTo",rawVars:1,register:function(t){ak=t,Sk()},init:function(t,e,i,n,r){lk||Sk();var s=this,o=ak.getProperty(t,"scrollSnapType");s.isWin=t===ck,s.target=t,s.tween=i,e=function(t,e,i,n){if(vk(t)&&(t=t(e,i,n)),"object"!=typeof t)return yk(t)&&"max"!==t&&"="!==t.charAt(1)?{x:t,y:t}:{y:t};if(t.nodeType)return{y:t,x:t};var r,s={};for(r in t)s[r]="onAutoKill"!==r&&vk(t[r])?t[r](e,i,n):t[r];return s}(e,n,t,r),s.vars=e,s.autoKill=!!e.autoKill,s.getX=xk(t,"x"),s.getY=xk(t,"y"),s.x=s.xPrev=s.getX(),s.y=s.yPrev=s.getY(),fk||(fk=ak.core.globals().ScrollTrigger),"smooth"===ak.getProperty(t,"scrollBehavior")&&ak.set(t,{scrollBehavior:"auto"}),o&&"none"!==o&&(s.snap=1,s.snapInline=t.style.scrollSnapType,t.style.scrollSnapType="none"),null!=e.x?(s.add(s,"x",s.x,Ek(e.x,t,"x",s.x,e.offsetX||0),n,r),s._props.push("scrollTo_x")):s.skipX=1,null!=e.y?(s.add(s,"y",s.y,Ek(e.y,t,"y",s.y,e.offsetY||0),n,r),s._props.push("scrollTo_y")):s.skipY=1},render:function(t,e){for(var i,n,r,s,o,a=e._pt,l=e.target,c=e.tween,h=e.autoKill,u=e.xPrev,d=e.yPrev,p=e.isWin,f=e.snap,m=e.snapInline;a;)a.r(t,a.d),a=a._next;i=p||!e.skipX?e.getX():u,r=(n=p||!e.skipY?e.getY():d)-d,s=i-u,o=pk.autoKillThreshold,e.x<0&&(e.x=0),e.y<0&&(e.y=0),h&&(!e.skipX&&(s>o||s<-o)&&i<bk(l,"x")&&(e.skipX=1),!e.skipY&&(r>o||r<-o)&&n<bk(l,"y")&&(e.skipY=1),e.skipX&&e.skipY&&(c.kill(),e.vars.onAutoKill&&e.vars.onAutoKill.apply(c,e.vars.onAutoKillParams||[]))),p?ck.scrollTo(e.skipX?i:e.x,e.skipY?n:e.y):(e.skipY||(l.scrollTop=e.y),e.skipX||(l.scrollLeft=e.x)),!f||1!==t&&0!==t||(n=l.scrollTop,i=l.scrollLeft,m?l.style.scrollSnapType=m:l.style.removeProperty("scroll-snap-type"),l.scrollTop=n+1,l.scrollLeft=i+1,l.scrollTop=n,l.scrollLeft=i),e.xPrev=e.x,e.yPrev=e.y,fk&&fk.update()},kill:function(t){var e="scrollTo"===t,i=this._props.indexOf(t);return(e||"scrollTo_x"===t)&&(this.skipX=1),(e||"scrollTo_y"===t)&&(this.skipY=1),i>-1&&this._props.splice(i,1),!this._props.length}};Tk.max=bk,Tk.getOffset=wk,Tk.buildGetter=xk,_k()&&ak.registerPlugin(Tk);var Mk=class extends Da{constructor(t,e){super(t,e)}init(){k.ZP.registerPlugin(Tk),this.$element.addEventListener("click",(()=>{k.ZP.to(window,{duration:.7,delay:.5,scrollTo:{y:"[data-top-element]",offsetY:50},ease:"power2.inOut"})}))}};var Ak=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var Ck=function(t){if(!Ak(t))return!1;var e=_l(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},kk=sl["__core-js_shared__"],Pk=function(){var t=/[^.]+$/.exec(kk&&kk.keys&&kk.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Ik=function(t){return!!Pk&&Pk in t},Dk=Function.prototype.toString;var Ok=function(t){if(null!=t){try{return Dk.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Lk=/^\[object .+?Constructor\]$/,zk=Function.prototype,Rk=Object.prototype,Fk=zk.toString,Bk=Rk.hasOwnProperty,Nk=RegExp("^"+Fk.call(Bk).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var jk=function(t){return!(!Ak(t)||Ik(t))&&(Ck(t)?Nk:Lk).test(Ok(t))};var Vk=function(t,e){return null==t?void 0:t[e]};var Uk=function(t,e){var i=Vk(t,e);return jk(i)?i:void 0},$k=function(){try{var t=Uk(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Hk=function(t,e,i){"__proto__"==e&&$k?$k(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i};var qk=function(t,e,i,n){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(n,o,i(o),t)}return n};var Wk=function(t){return function(e,i,n){for(var r=-1,s=Object(e),o=n(e),a=o.length;a--;){var l=o[t?a:++r];if(!1===i(s[l],l,s))break}return e}},Gk=Wk();var Zk=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n};var Yk=function(t){return yl(t)&&"[object Arguments]"==_l(t)},Xk=Object.prototype,Kk=Xk.hasOwnProperty,Qk=Xk.propertyIsEnumerable,Jk=Yk(function(){return arguments}())?Yk:function(t){return yl(t)&&Kk.call(t,"callee")&&!Qk.call(t,"callee")},tP=Jk;var eP=function(){return!1},iP="object"==typeof exports&&exports&&!exports.nodeType&&exports,nP=iP&&"object"==typeof module&&module&&!module.nodeType&&module,rP=nP&&nP.exports===iP?sl.Buffer:void 0,sP=(rP?rP.isBuffer:void 0)||eP,oP=/^(?:0|[1-9]\d*)$/;var aP=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&oP.test(t))&&t>-1&&t%1==0&&t<e};var lP=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},cP={};cP["[object Float32Array]"]=cP["[object Float64Array]"]=cP["[object Int8Array]"]=cP["[object Int16Array]"]=cP["[object Int32Array]"]=cP["[object Uint8Array]"]=cP["[object Uint8ClampedArray]"]=cP["[object Uint16Array]"]=cP["[object Uint32Array]"]=!0,cP["[object Arguments]"]=cP["[object Array]"]=cP["[object ArrayBuffer]"]=cP["[object Boolean]"]=cP["[object DataView]"]=cP["[object Date]"]=cP["[object Error]"]=cP["[object Function]"]=cP["[object Map]"]=cP["[object Number]"]=cP["[object Object]"]=cP["[object RegExp]"]=cP["[object Set]"]=cP["[object String]"]=cP["[object WeakMap]"]=!1;var hP=function(t){return yl(t)&&lP(t.length)&&!!cP[_l(t)]};var uP=function(t){return function(e){return t(e)}},dP="object"==typeof exports&&exports&&!exports.nodeType&&exports,pP=dP&&"object"==typeof module&&module&&!module.nodeType&&module,fP=pP&&pP.exports===dP&&nl.process,mP=function(){try{var t=pP&&pP.require&&pP.require("util").types;return t||fP&&fP.binding&&fP.binding("util")}catch(t){}}(),gP=mP&&mP.isTypedArray,_P=gP?uP(gP):hP,yP=Object.prototype.hasOwnProperty;var vP=function(t,e){var i=ll(t),n=!i&&tP(t),r=!i&&!n&&sP(t),s=!i&&!n&&!r&&_P(t),o=i||n||r||s,a=o?Zk(t.length,String):[],l=a.length;for(var c in t)!e&&!yP.call(t,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||aP(c,l))||a.push(c);return a},bP=Object.prototype;var xP=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||bP)};var wP=function(t,e){return function(i){return t(e(i))}},EP=wP(Object.keys,Object),SP=Object.prototype.hasOwnProperty;var TP=function(t){if(!xP(t))return EP(t);var e=[];for(var i in Object(t))SP.call(t,i)&&"constructor"!=i&&e.push(i);return e};var MP=function(t){return null!=t&&lP(t.length)&&!Ck(t)};var AP=function(t){return MP(t)?vP(t):TP(t)};var CP=function(t,e){return function(i,n){if(null==i)return i;if(!MP(i))return t(i,n);for(var r=i.length,s=e?r:-1,o=Object(i);(e?s--:++s<r)&&!1!==n(o[s],s,o););return i}},kP=CP((function(t,e){return t&&Gk(t,e,AP)}));var PP=function(t,e,i,n){return kP(t,(function(t,r,s){e(n,t,i(t),s)})),n};var IP=function(){this.__data__=[],this.size=0};var DP=function(t,e){return t===e||t!=t&&e!=e};var OP=function(t,e){for(var i=t.length;i--;)if(DP(t[i][0],e))return i;return-1},LP=Array.prototype.splice;var zP=function(t){var e=this.__data__,i=OP(e,t);return!(i<0)&&(i==e.length-1?e.pop():LP.call(e,i,1),--this.size,!0)};var RP=function(t){var e=this.__data__,i=OP(e,t);return i<0?void 0:e[i][1]};var FP=function(t){return OP(this.__data__,t)>-1};var BP=function(t,e){var i=this.__data__,n=OP(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function NP(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}NP.prototype.clear=IP,NP.prototype.delete=zP,NP.prototype.get=RP,NP.prototype.has=FP,NP.prototype.set=BP;var jP=NP;var VP=function(){this.__data__=new jP,this.size=0};var UP=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i};var $P=function(t){return this.__data__.get(t)};var HP=function(t){return this.__data__.has(t)},qP=Uk(sl,"Map"),WP=Uk(Object,"create");var GP=function(){this.__data__=WP?WP(null):{},this.size=0};var ZP=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},YP=Object.prototype.hasOwnProperty;var XP=function(t){var e=this.__data__;if(WP){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return YP.call(e,t)?e[t]:void 0},KP=Object.prototype.hasOwnProperty;var QP=function(t){var e=this.__data__;return WP?void 0!==e[t]:KP.call(e,t)};var JP=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=WP&&void 0===e?"__lodash_hash_undefined__":e,this};function tI(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}tI.prototype.clear=GP,tI.prototype.delete=ZP,tI.prototype.get=XP,tI.prototype.has=QP,tI.prototype.set=JP;var eI=tI;var iI=function(){this.size=0,this.__data__={hash:new eI,map:new(qP||jP),string:new eI}};var nI=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var rI=function(t,e){var i=t.__data__;return nI(e)?i["string"==typeof e?"string":"hash"]:i.map};var sI=function(t){var e=rI(this,t).delete(t);return this.size-=e?1:0,e};var oI=function(t){return rI(this,t).get(t)};var aI=function(t){return rI(this,t).has(t)};var lI=function(t,e){var i=rI(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};function cI(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}cI.prototype.clear=iI,cI.prototype.delete=sI,cI.prototype.get=oI,cI.prototype.has=aI,cI.prototype.set=lI;var hI=cI;var uI=function(t,e){var i=this.__data__;if(i instanceof jP){var n=i.__data__;if(!qP||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new hI(n)}return i.set(t,e),this.size=i.size,this};function dI(t){var e=this.__data__=new jP(t);this.size=e.size}dI.prototype.clear=VP,dI.prototype.delete=UP,dI.prototype.get=$P,dI.prototype.has=HP,dI.prototype.set=uI;var pI=dI;var fI=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var mI=function(t){return this.__data__.has(t)};function gI(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new hI;++e<i;)this.add(t[e])}gI.prototype.add=gI.prototype.push=fI,gI.prototype.has=mI;var _I=gI;var yI=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1};var vI=function(t,e){return t.has(e)};var bI=function(t,e,i,n,r,s){var o=1&i,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=2&i?new _I:void 0;for(s.set(t,e),s.set(e,t);++u<a;){var f=t[u],m=e[u];if(n)var g=o?n(m,f,u,e,t,s):n(f,m,u,t,e,s);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!yI(e,(function(t,e){if(!vI(p,e)&&(f===t||r(f,t,i,n,s)))return p.push(e)}))){d=!1;break}}else if(f!==m&&!r(f,m,i,n,s)){d=!1;break}}return s.delete(t),s.delete(e),d},xI=sl.Uint8Array;var wI=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i};var EI=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i},SI=ol?ol.prototype:void 0,TI=SI?SI.valueOf:void 0;var MI=function(t,e,i,n,r,s,o){switch(i){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new xI(t),new xI(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return DP(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=wI;case"[object Set]":var l=1&n;if(a||(a=EI),t.size!=e.size&&!l)return!1;var c=o.get(t);if(c)return c==e;n|=2,o.set(t,e);var h=bI(a(t),a(e),n,r,s,o);return o.delete(t),h;case"[object Symbol]":if(TI)return TI.call(t)==TI.call(e)}return!1};var AI=function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t};var CI=function(t,e,i){var n=e(t);return ll(t)?n:AI(n,i(t))};var kI=function(t,e){for(var i=-1,n=null==t?0:t.length,r=0,s=[];++i<n;){var o=t[i];e(o,i,t)&&(s[r++]=o)}return s};var PI=function(){return[]},II=Object.prototype.propertyIsEnumerable,DI=Object.getOwnPropertySymbols,OI=DI?function(t){return null==t?[]:(t=Object(t),kI(DI(t),(function(e){return II.call(t,e)})))}:PI;var LI=function(t){return CI(t,AP,OI)},zI=Object.prototype.hasOwnProperty;var RI=function(t,e,i,n,r,s){var o=1&i,a=LI(t),l=a.length;if(l!=LI(e).length&&!o)return!1;for(var c=l;c--;){var h=a[c];if(!(o?h in e:zI.call(e,h)))return!1}var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var p=!0;s.set(t,e),s.set(e,t);for(var f=o;++c<l;){var m=t[h=a[c]],g=e[h];if(n)var _=o?n(g,m,h,e,t,s):n(m,g,h,t,e,s);if(!(void 0===_?m===g||r(m,g,i,n,s):_)){p=!1;break}f||(f="constructor"==h)}if(p&&!f){var y=t.constructor,v=e.constructor;y==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(p=!1)}return s.delete(t),s.delete(e),p},FI=Uk(sl,"DataView"),BI=Uk(sl,"Promise"),NI=Uk(sl,"Set"),jI=Uk(sl,"WeakMap"),VI="[object Map]",UI="[object Promise]",$I="[object Set]",HI="[object WeakMap]",qI="[object DataView]",WI=Ok(FI),GI=Ok(qP),ZI=Ok(BI),YI=Ok(NI),XI=Ok(jI),KI=_l;(FI&&KI(new FI(new ArrayBuffer(1)))!=qI||qP&&KI(new qP)!=VI||BI&&KI(BI.resolve())!=UI||NI&&KI(new NI)!=$I||jI&&KI(new jI)!=HI)&&(KI=function(t){var e=_l(t),i="[object Object]"==e?t.constructor:void 0,n=i?Ok(i):"";if(n)switch(n){case WI:return qI;case GI:return VI;case ZI:return UI;case YI:return $I;case XI:return HI}return e});var QI=KI,JI="[object Arguments]",tD="[object Array]",eD="[object Object]",iD=Object.prototype.hasOwnProperty;var nD=function(t,e,i,n,r,s){var o=ll(t),a=ll(e),l=o?tD:QI(t),c=a?tD:QI(e),h=(l=l==JI?eD:l)==eD,u=(c=c==JI?eD:c)==eD,d=l==c;if(d&&sP(t)){if(!sP(e))return!1;o=!0,h=!1}if(d&&!h)return s||(s=new pI),o||_P(t)?bI(t,e,i,n,r,s):MI(t,e,l,i,n,r,s);if(!(1&i)){var p=h&&iD.call(t,"__wrapped__"),f=u&&iD.call(e,"__wrapped__");if(p||f){var m=p?t.value():t,g=f?e.value():e;return s||(s=new pI),r(m,g,i,n,s)}}return!!d&&(s||(s=new pI),RI(t,e,i,n,r,s))};var rD=function t(e,i,n,r,s){return e===i||(null==e||null==i||!yl(e)&&!yl(i)?e!=e&&i!=i:nD(e,i,n,r,t,s))};var sD=function(t,e,i,n){var r=i.length,s=r,o=!n;if(null==t)return!s;for(t=Object(t);r--;){var a=i[r];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++r<s;){var l=(a=i[r])[0],c=t[l],h=a[1];if(o&&a[2]){if(void 0===c&&!(l in t))return!1}else{var u=new pI;if(n)var d=n(c,h,l,t,e,u);if(!(void 0===d?rD(h,c,3,n,u):d))return!1}}return!0};var oD=function(t){return t==t&&!Ak(t)};var aD=function(t){for(var e=AP(t),i=e.length;i--;){var n=e[i],r=t[n];e[i]=[n,r,oD(r)]}return e};var lD=function(t,e){return function(i){return null!=i&&(i[t]===e&&(void 0!==e||t in Object(i)))}};var cD=function(t){var e=aD(t);return 1==e.length&&e[0][2]?lD(e[0][0],e[0][1]):function(i){return i===t||sD(i,t,e)}},hD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uD=/^\w*$/;var dD=function(t,e){if(ll(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!vl(t))||(uD.test(t)||!hD.test(t)||null!=e&&t in Object(e))};function pD(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=t.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(pD.Cache||hI),i}pD.Cache=hI;var fD=pD;var mD=function(t){var e=fD(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e},gD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_D=/\\(\\)?/g,yD=mD((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(gD,(function(t,i,n,r){e.push(n?r.replace(_D,"$1"):i||t)})),e})),vD=yD;var bD=function(t,e){return ll(t)?t:dD(t,e)?[t]:vD(El(t))};var xD=function(t){if("string"==typeof t||vl(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e};var wD=function(t,e){for(var i=0,n=(e=bD(e,t)).length;null!=t&&i<n;)t=t[xD(e[i++])];return i&&i==n?t:void 0};var ED=function(t,e,i){var n=null==t?void 0:wD(t,e);return void 0===n?i:n};var SD=function(t,e){return null!=t&&e in Object(t)};var TD=function(t,e,i){for(var n=-1,r=(e=bD(e,t)).length,s=!1;++n<r;){var o=xD(e[n]);if(!(s=null!=t&&i(t,o)))break;t=t[o]}return s||++n!=r?s:!!(r=null==t?0:t.length)&&lP(r)&&aP(o,r)&&(ll(t)||tP(t))};var MD=function(t,e){return null!=t&&TD(t,e,SD)};var AD=function(t,e){return dD(t)&&oD(e)?lD(xD(t),e):function(i){var n=ED(i,t);return void 0===n&&n===e?MD(i,t):rD(e,n,3)}};var CD=function(t){return t};var kD=function(t){return function(e){return null==e?void 0:e[t]}};var PD=function(t){return function(e){return wD(e,t)}};var ID=function(t){return dD(t)?kD(xD(t)):PD(t)};var DD=function(t){return"function"==typeof t?t:null==t?CD:"object"==typeof t?ll(t)?AD(t[0],t[1]):cD(t):ID(t)};var OD=function(t,e){return function(i,n){var r=ll(i)?qk:PP,s=e?e():{};return r(i,t,DD(n,2),s)}},LD=Object.prototype.hasOwnProperty,zD=OD((function(t,e,i){LD.call(t,i)?t[i].push(e):Hk(t,i,[e])}));function RD(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}var FD=new WeakMap,BD=new WeakMap,ND=new WeakMap,jD=new WeakMap;var VD=class extends Da{constructor(t,e){super(t,e),RD(this,FD,{writable:!0,value:void 0}),RD(this,BD,{writable:!0,value:void 0}),RD(this,ND,{writable:!0,value:[]}),RD(this,jD,{writable:!0,value:void 0}),s(this,"handler",(()=>{if(Ra(this,FD,Array.from(this.$element.children).reduce(((t,e)=>(e.classList.contains("swiper-slide")?t.push(e.children[0]):t.push(e),t)),[])),za(this,FD).length){var t,e=null!==(t=Array.from(za(this,FD)[0].classList).map((t=>".".concat(t))).join(""))&&void 0!==t?t:"*";if(this.$element.querySelectorAll(":scope > ".concat(e,", .swiper-slide > ").concat(e)).length<.75*za(this,FD).length){var i=Array.from(this.$element.querySelectorAll(":scope > ".concat(iO.join())));Ra(this,FD,i.length?i:[this.$element])}}else Ra(this,FD,[this.$element]);Ra(this,FD,za(this,FD).filter((t=>!t.closest("[data-animation-disabled]")))),window.addEventListener("resize",this.animate),this.animate(),Ra(this,jD,new MutationObserver(((t,e)=>{var i=!1;for(var n of t)"childList"===n.type&&(i=!0);i&&(this.destroy(),this.init())}))),za(this,jD).observe(this.$element,{childList:!0,subtree:!0})})),s(this,"animate",(()=>{za(this,ND).forEach((t=>t.kill())),Ra(this,ND,[]);var t=zD(za(this,FD),(t=>t.getBoundingClientRect().top));Object.values(t).forEach((t=>{var e=k.gsap.timeline({scrollTrigger:{trigger:t[0],onEnter:()=>{window.removeEventListener("resize",this.animate)}}});e.set(t,{willChange:"opacity, transform"}),e.to(t,{opacity:1,y:0,x:0,duration:.75,ease:"power2.sineOut",stagger:.25},">0.25"),e.add((()=>{t.forEach((t=>{t.setAttribute("data-animation-disabled","true")}))})),e.set(t,{clearProps:"all"}),za(this,ND).push(e)}))}))}init(){this.$element.closest("[data-animation-disabled]")||this.handler()}destroy(){var t,e,i;null===(t=za(this,BD))||void 0===t||t.kill(),null===(e=za(this,ND))||void 0===e||e.forEach((t=>t.kill())),window.removeEventListener("resize",this.animate),null===(i=za(this,jD))||void 0===i||i.disconnect(),this.ctx.off("ready",this.handler)}},UD=function(){return sl.Date.now()},$D=/\s/;var HD=function(t){for(var e=t.length;e--&&$D.test(t.charAt(e)););return e},qD=/^\s+/;var WD=function(t){return t?t.slice(0,HD(t)+1).replace(qD,""):t},GD=/^[-+]0x[0-9a-f]+$/i,ZD=/^0b[01]+$/i,YD=/^0o[0-7]+$/i,XD=parseInt;var KD=function(t){if("number"==typeof t)return t;if(vl(t))return NaN;if(Ak(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ak(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=WD(t);var i=ZD.test(t);return i||YD.test(t)?XD(t.slice(2),i?2:8):GD.test(t)?NaN:+t},QD=Math.max,JD=Math.min;var tO=function(t,e,i){var n,r,s,o,a,l,c=0,h=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var i=n,s=r;return n=r=void 0,c=e,o=t.apply(s,i)}function f(t){var i=t-l;return void 0===l||i>=e||i<0||u&&t-c>=s}function m(){var t=UD();if(f(t))return g(t);a=setTimeout(m,function(t){var i=e-(t-l);return u?JD(i,s-(t-c)):i}(t))}function g(t){return a=void 0,d&&n?p(t):(n=r=void 0,o)}function _(){var t=UD(),i=f(t);if(n=arguments,r=this,l=t,i){if(void 0===a)return function(t){return c=t,a=setTimeout(m,e),h?p(t):o}(l);if(u)return clearTimeout(a),a=setTimeout(m,e),p(l)}return void 0===a&&(a=setTimeout(m,e)),o}return e=KD(e)||0,Ak(i)&&(h=!!i.leading,s=(u="maxWait"in i)?QD(KD(i.maxWait)||0,e):s,d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=r=a=void 0},_.flush=function(){return void 0===a?o:g(UD())},_};var eO=class extends Da{constructor(t,e){super(t,e),s(this,"checkboxes",null),s(this,"fields",null),s(this,"handleAddClass",(t=>{this.fields.forEach((t=>{t.classList.remove("_active")})),this.fields[t].classList.add("_active")}))}init(){this.checkboxes=this.$element.querySelectorAll('input[type="checkbox"]'),this.fieldsNumber=this.$element.querySelectorAll('input[type="number"]'),this.fields=this.$element.querySelectorAll(".educational-filter__field "),this.checkboxes.forEach(((t,e)=>{t.addEventListener("change",(()=>{this.handleAddClass(e),tO((()=>{this.fields[e].classList.remove("_active")}),2500)()}))})),this.fieldsNumber.forEach(((t,e)=>{t.addEventListener("input",(t=>{var e=t.target.closest(".educational-filter__field");tO((()=>{e.classList.add("_active")}),1e3)(),tO((()=>{e.classList.remove("_active")}),2500)()}))}))}destroy(){this.checkboxes.forEach(((t,e)=>{t.removeEventListener("change",(()=>{this.handleAddClass(e),tO((()=>{this.fields[e].classList.remove("_active")}),2e3)()}))})),checkboxes=null,fields=null}},iO=[".infographics-card",".education-card",".news-card",".page-card-link",".link-banner",".page-button-card",".numbers-grid__card",".event-card",".person-card",".magazine-card",".cathedra-card",".folder-card"],nO={"#js-header":Oa,"#js-menu":class extends Da{constructor(t,e){super(t,e),s(this,"$burgerBtn",void 0),s(this,"$tabsDesktop",void 0),s(this,"$tabsMobile",void 0),s(this,"$contents",void 0),s(this,"$contentWrapper",void 0),s(this,"$mainLinks",void 0),s(this,"$firstLevel",void 0),s(this,"$mobileBack",void 0),s(this,"$header",void 0),s(this,"burgerMenu",void 0),s(this,"isHeaderContrast",void 0),s(this,"windowWidth",void 0),s(this,"mobileSelected",void 0),s(this,"tl",void 0),s(this,"tabTl",void 0),XA(this,QA,{writable:!0,value:void 0}),XA(this,JA,{writable:!0,value:void 0}),XA(this,tC,{writable:!0,value:void 0}),XA(this,eC,{writable:!0,value:void 0}),this.$burgerBtn=document.getElementById("js-burger-menu"),this.$header=document.getElementById("js-header"),this.$tabsDesktop=KA(".js-menu-tab__desktop",this.$element),this.$tabsMobile=KA(".js-menu-tab__mobile",this.$element),this.$contents=KA(".js-menu__content",this.$element),this.$contentWrapper=KA(".js-menu__content-wrapper",this.$element),this.$mainLinks=KA(".js-menu__main-link"),this.$firstLevel=KA(".js-menu__first-level"),this.$mobileBack=this.$element.querySelector(".js-menu__mobile-back"),Ra(this,QA,this.openMenu.bind(this)),Ra(this,JA,this.closeMenu.bind(this)),Ra(this,tC,this.mobileBack.bind(this)),Ra(this,eC,this.onResize.bind(this)),this.isHeaderContrast=this.$header.classList.contains("_contrast")}init(){var t,e,i;this.burgerMenu=new YA(this.$burgerBtn),this.burgerMenu.on("open",za(this,QA)),this.burgerMenu.on("close",za(this,JA)),null===(t=this.$tabsDesktop)||void 0===t||t.forEach((t=>{t.addEventListener("click",(()=>this.selectTab(t)))})),null===(e=this.$tabsMobile)||void 0===e||e.forEach((t=>{t.addEventListener("click",(()=>this.selectMobileTab(t)))})),null===(i=this.$mobileBack)||void 0===i||i.addEventListener("click",za(this,tC)),this.selectTab(this.$tabsDesktop[0]),window.addEventListener("resize",za(this,eC))}destroy(){window.removeEventListener("resize",za(this,eC))}onResize(){this.windowWidth!==window.innerWidth&&(this.windowWidth=window.innerWidth,this.mobileSelected&&this.mobileBack())}selectMobileTab(t){var e=this.$tabsMobile.indexOf(t);this.mobileSelected=!0,this.$tabsDesktop.forEach((t=>t.classList.remove("active"))),this.$tabsDesktop[e].classList.add("active"),k.gsap.timeline().set([this.$firstLevel,this.$contentWrapper],{willChange:"transform"}).set(this.$contents,{display:"none",autoAlpha:0}).set(this.$contents[e],{display:"block",autoAlpha:1}).to([this.$firstLevel,this.$contentWrapper],{x:"-100vw",ease:"power1.inOut"},.1).set([this.$firstLevel,this.$contentWrapper],{clearProps:"willChange"})}mobileBack(){this.mobileSelected=!1,k.gsap.timeline().set([this.$firstLevel,this.$contentWrapper],{willChange:"transform"}).to([this.$firstLevel,this.$contentWrapper],{x:"0",ease:"power1.inOut"},.1).set([this.$firstLevel,this.$contentWrapper],{clearProps:"willChange"}).set(this.$contents,{display:"none"})}selectTab(t){var e=this.$tabsDesktop.indexOf(t);this.$tabsDesktop.forEach((t=>t.classList.remove("active"))),t.classList.add("active"),this.initTabTl(),this.tabTl.to(this.$contents,{autoAlpha:0,display:"none"}),this.tabTl.to(this.$contents[e],{autoAlpha:1,display:"block"})}openMenu(){var t=this;return i((function*(){t.ctx.plugins.lenis.stop(),window.scrollY&&(yield new Promise((e=>{t.ctx.plugins.lenis.scrollTo(0,{force:!0,onComplete:e,duration:.3})}))),t.initTl(),t.tl.set([t.$tabsDesktop,t.$contentWrapper],{opacity:0,y:30,willChange:"transform, opacity"}).set(t.$mainLinks,{willChange:"opacity"}).add((()=>{t.isHeaderContrast||t.$header.classList.add("_contrast")}),0).to(t.$element,{autoAlpha:1,ease:"linear"}).addLabel("start",.3).to([t.$tabsDesktop],{opacity:1,stagger:.03,ease:"linear",duration:.5},"start").to([t.$tabsDesktop],{y:0,stagger:.03},"start").to([t.$contentWrapper],{opacity:1,ease:"linear",duration:.5},"start").to([t.$contentWrapper],{y:0},"start").to(t.$mainLinks,{autoAlpha:0,stagger:.05},"start").set([t.$tabsDesktop,t.$contentWrapper,t.$mainLinks],{clearProps:"willChange"})}))()}closeMenu(){this.ctx.plugins.lenis.start(),this.initTl(),this.tl.set(this.$mainLinks,{willChange:"opacity"}).to(this.$element,{autoAlpha:0}).to(this.$mainLinks,{autoAlpha:1,stagger:-.05,ease:"power1.in"},"<+0.1").add((()=>{this.isHeaderContrast||this.$header.classList.remove("_contrast")}),0).set(this.$mainLinks,{clearProps:"willChange"})}initTl(){var t;null===(t=this.tl)||void 0===t||t.kill(),this.tl=k.gsap.timeline({defaults:{duration:.35}})}initTabTl(){var t;null===(t=this.tabTl)||void 0===t||t.kill(),this.tabTl=k.gsap.timeline({defaults:{duration:.35}})}},"#js-scroll-to-top-button":Na,".js-useful-links":$a,".js-folder-card":Qa,".js-accordion":il,".js-tabs":class extends Da{constructor(t,e){var i,n,r;super(t,e),s(this,"instanceId",Tl("tab-")),s(this,"activeIndex",0),s(this,"timeline",null),s(this,"tabsMergeInstance",null),s(this,"hashNavigation",!1);var o=this.$element.dataset.contentsSelector;Object.assign(this,{type:this.$element.dataset.type,UI:{control:this.$element.querySelector(".js-tabs-control"),buttons:(null===(i=this.$element.querySelector(".js-tabs-control"))||void 0===i?void 0:i.children)||[],contentWrapper:this.$element.querySelector(".js-tabs-content"),contents:o?(null===(n=document.querySelector(o))||void 0===n?void 0:n.children)||[]:(null===(r=this.$element.querySelector(".js-tabs-content"))||void 0===r?void 0:r.children)||[]}})}init(){if("radio"!==this.type){if(this.hashNavigation=this.$element.hasAttribute("data-hash-navigation")&&"false"!==this.$element.dataset.hashNavigation,this.hashNavigation){var{hash:t=""}=window.location;this.activeIndex=Array.from(this.UI.buttons).findIndex((e=>"#"+e.id===t)),-1===this.activeIndex&&(this.activeIndex=0)}for(var e of this.UI.buttons)e.closest(".js-tabs-more")||e.setAttribute("data-tab-id",this.instanceId);Array.from(this.UI.contents).forEach((t=>t.setAttribute("data-display",getComputedStyle(t).display))),this._toggleButton(this.activeIndex,this.activeIndex),this._toggleContent(this.activeIndex,this.activeIndex,!0),this._bindEvents()}}_bindEvents(){document.addEventListener("click",(t=>{var{target:e}=t,i=e.closest("[data-tab-id]");i&&i.dataset.tabId&&i.dataset.index&&i.dataset.tabId===this.instanceId&&(this.hashNavigation&&history.replaceState({},"","#".concat(i.id)),this._onClick(+i.dataset.index))}))}_onClick(t){var e=this.activeIndex,i=t;this.activeIndex=t,this._toggleButton(e,i),this._toggleContent(e,i),this.emit("change",this.activeIndex)}_toggleButton(t,e){this.UI.control.querySelector("[data-index='".concat(t,"']")).classList.remove(Ml),this.UI.control.querySelector("[data-index='".concat(e,"']")).classList.add(Ml)}_toggleContent(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.UI.contents[t],s=this.UI.contents[e],o=n?.01:.3;null===(i=this.timeline)||void 0===i||i.kill(),this.timeline=k.gsap.timeline().to(r,{opacity:0,duration:o,ease:"power1.in"}).set(this.UI.contents,{display:"none"}).set(s,{opacity:0,display:s.dataset.display}).to(s,{opacity:1,duration:o,ease:"power1.out"}).to(this.UI.contentWrapper,{height:()=>s.offsetHeight,onComplete:()=>{k.gsap.set(this.UI.contentWrapper,{height:"auto"})}},"<")}},".js-sidebar":Ll,".js-text-content-slider":Zc,".js-partners-slider":Qc,".js-photo-gallery":class extends Kc{constructor(t,e){super(t,e,{spaceBetween:20,slidesPerView:"auto",loop:!0,grabCursor:!0,breakpoints:{1024:{centeredSlides:!0,spaceBetween:32}}})}},".js-hero-slider":Jc,".js-tooltip":fd,".js-datepicker":Ad,".js-date-filter":Fd,".js-events-slider":class extends Da{constructor(t,e){super(t,e),Bd(this,Nd,{writable:!0,value:null}),Bd(this,jd,{writable:!0,value:null}),Bd(this,Vd,{writable:!0,value:null});var i=t.closest(".app-section");Ra(this,jd,i.querySelector(".js-slider-prev")),Ra(this,Vd,i.querySelector(".js-slider-next"))}init(){Ra(this,Nd,new Bc(this.$element,{modules:[jc],navigation:{prevEl:za(this,jd),nextEl:za(this,Vd)},spaceBetween:64,slidesPerView:2,loop:!0,grabCursor:!0}))}destroy(){var t;null===(t=za(this,Nd))||void 0===t||t.destroy()}},".js-date-filter-open":class extends qd{constructor(t,e){super(t,e),Wd(this,Gd,{writable:!0,value:null}),Wd(this,Zd,{writable:!0,value:!1}),Wd(this,Yd,{writable:!0,value:null}),Wd(this,Xd,{writable:!0,value:null}),Wd(this,Kd,{writable:!0,value:"Выбрать дату"}),s(this,"refresh",(()=>{var t;null===(t=za(this,Yd))||void 0===t||t.refresh()})),s(this,"_onSelect",(t=>{var e=Array.isArray(t)?null==t?void 0:t.filter((t=>t)).length:t;this.openButton.classList.toggle("_active",e),za(this,Xd).textContent=e?Array.isArray(t)?t.filter((t=>t)).join(" - "):t:za(this,Kd)})),Ra(this,Xd,this.openButton.querySelector("span"));var i=this.openButton.getAttribute("data-text");Ra(this,Kd,i||za(this,Xd).textContent)}init(){var t,e;super.init(),Ra(this,Gd,this.popup.querySelector(".js-filter-refresh")),Ra(this,Yd,this.popup.querySelector(".js-date-filter-mobile")),Ra(this,Zd,!!za(this,Yd).getAttribute("data-year")),Ra(this,Yd,za(this,Zd)?new $d(za(this,Yd),this.ctx,{inline:!0}):new Fd(za(this,Yd),this.ctx,{inline:!0})),null===(t=za(this,Yd))||void 0===t||t.init(),null===(e=za(this,Yd))||void 0===e||e.on("selected",this._onSelect),za(this,Gd).addEventListener("click",this.refresh)}destroy(){var t;super.destroy(),null===(t=za(this,Yd))||void 0===t||t.off("selected",this._onSelect),za(this,Gd).removeEventListener("click",this.refresh)}},".js-project-slider":class extends Kc{constructor(t,e){super(t,e,{breakpoints:{0:{slidesPerView:1.2},767:{slidesPerView:2.2},1024:{slidesPerView:3}}})}},".js-date-filter-year":$d,".js-review-slider":class extends Kc{constructor(t,e){super(t,e,{slidesPerView:"auto",spaceBetween:128,loop:!1,grabCursor:!0,breakpoints:{1024:{spaceBetween:64}}})}},".js-news-text-overflow":class extends Da{constructor(t,e){super(t,e),Qd(this,Jd,{writable:!0,value:null}),Qd(this,tp,{writable:!0,value:null}),Qd(this,ep,{writable:!0,value:6}),s(this,"_setLineVar",((t,e)=>{t&&(e||(t.style.display="none"),t.style.setProperty("--line",String(e)))})),s(this,"_calcLine",(t=>{if(!t)return 0;var{height:e,lineHeight:i}=window.getComputedStyle(t);return Math.round(this._replacePx(e)/this._replacePx(i))})),s(this,"_replacePx",(t=>+t.replace("px","")));var[i=null,n=null]=this.$element.children||[];Ra(this,Jd,i),Ra(this,tp,n),Ra(this,ep,+this.$element.getAttribute("data-line")||6)}init(){var t=Math.min(this._calcLine(za(this,Jd)),za(this,ep)),e=Math.min(this._calcLine(za(this,tp)),za(this,ep)-t);this._setLineVar(za(this,Jd),t),this._setLineVar(za(this,tp),e)}},".js-section-slider":yp,".js-app-form":class extends Da{constructor(t,e){super(t,e),s(this,"$submitBtns",void 0),s(this,"$errorPopup",void 0),s(this,"$successPopup",void 0),s(this,"validator",void 0),Np(this,jp,{writable:!0,value:!1}),Np(this,Vp,{writable:!0,value:void 0}),Np(this,Up,{writable:!0,value:void 0}),this.$submitBtns=this.$element.querySelectorAll('button[type="submit"]');var i=this.$element.getAttribute("data-error-popup-selector"),n=this.$element.getAttribute("data-success-popup-selector");this.$errorPopup=document.querySelector(i),this.$successPopup=document.querySelector(n),Ra(this,Vp,this.onValidateFail.bind(this)),Ra(this,Up,this.onValidateSuccess.bind(this))}init(){this.validator=function(t){var e=new Lp(t,zp);return t.querySelectorAll("[data-validate]").forEach((t=>{var i=t,n=i.querySelector("select");n&&(i=n);var r="#".concat(i.id),s="group"===i.dataset.validate;if(r)if(s){var o=i.dataset.errorMessage||"Выберите не менее одного пункта";e.addRequiredGroup(r,o)}else{var a=[],l=i.attributes;for(var c of l){var{name:h,value:u}=c;Rp[h]&&Rp[h](u)&&a.push(Rp[h](u))}a.length>0&&e.addField(r,a)}else console.error("'id' parameter is required for validation of ".concat(i))})),e.onValidateCallback=t=>{var{groups:e}=t,i=function(t){if(!s)return 1;n.forEach((e=>{e.classList.toggle(zp.errorFieldCssClass,!t)}))};for(var{elems:n,isValid:r,touched:s}of Object.values(e))i(r)},e}(this.$element),this.validator.onSuccess(za(this,Up)),this.validator.onFail(za(this,Vp))}onError(){this.$errorPopup&&this.$errorPopup.instance.open()}onSuccess(){for(var{selector:t,instance:e}of Object.values(this.ctx.activeModules))".js-popup"===t&&e.id!==this.$successPopup.instance.id&&e.close();this.$successPopup&&this.$successPopup.instance.open()}onValidateFail(t,e){var i=Bp(Bp({},t),e);this.scrollToFirstFailedField(i)}onValidateSuccess(){this.isSubmitting||this.submit()}submit(){var t=this;return i((function*(){var e;t.isSubmitting=!0,yield(e=500,new Promise((t=>{t(),setTimeout(t,e)})));var i,{pathname:n}=new URL(t.$element.action),r=t.$element.method||"POST",s="get"===r.toLowerCase(),o="post"===r.toLowerCase(),a=new FormData(t.$element);s&&(i=t.sendGetRequest(n,a)),o&&(i=t.sendPostRequest(n,a)),i||(console.error('the "'.concat(r,'" method is not processed')),t.isSubmitting=!1),i.then((()=>t.onSuccess())).catch((e=>t.onError())).finally((()=>t.isSubmitting=!1))}))()}sendGetRequest(t,e){var n=this;return i((function*(){var i="".concat(t,"?").concat(new URLSearchParams(e));return yield n.ctx.plugins.api.get(i)}))()}sendPostRequest(t,e){var n=this;return i((function*(){return yield n.ctx.plugins.api.post(t,e)}))()}scrollToFirstFailedField(t){var{scrollY:e}=window,i=e;for(var{elem:n,groupElem:r,isValid:s}of Object.values(t))if(!s){var o=n||r,{top:a}=o.getBoundingClientRect();i=Math.min(i,a+e-32)}APP.plugins.lenis.scrollTo(i)}get isSubmitting(){return za(this,jp)}set isSubmitting(t){Ra(this,jp,t),this.$submitBtns.forEach((e=>{t?e.setAttribute("disabled","true"):e.removeAttribute("disabled")}))}},".js-file-uploader":class extends Da{constructor(t,e){super(t,e),s(this,"$input",void 0),s(this,"$template",void 0),s(this,"$clickable",void 0),s(this,"dataTransfer",void 0),s(this,"maxFilesize",void 0),s(this,"accept",void 0),s(this,"dropzone",void 0),nf(this,sf,{writable:!0,value:void 0}),nf(this,of,{writable:!0,value:void 0}),nf(this,af,{writable:!0,value:void 0}),Ra(this,sf,this.onAddFiles.bind(this)),Ra(this,of,this.onRemoveFile.bind(this)),Ra(this,af,this.onResetForm.bind(this)),this.$input=this.$element.querySelector('input[type="file"]'),this.$template=this.$element.querySelector(".js-file-uploader__template"),this.$clickable=this.$element.querySelector(".js-file-uploader__clickable"),this.dataTransfer=new DataTransfer,this.maxFilesize=+this.$input.getAttribute("data-max-filesize")||10,this.accept=this.$input.getAttribute("accept")||null}init(){var t=this.$template.innerHTML;this.dropzone=new Yp(this.$element,ef(ef({},rf),{},{previewTemplate:t,clickable:this.$clickable,acceptedFiles:this.accept})),this.dropzone.on("addedfiles",za(this,sf)),this.dropzone.on("removedfile",za(this,of))}onAddFiles(t){var[...e]=t;e.forEach((t=>{this.isValidFile(t)?(this.addFileToInput(t),this.dispatchChange()):this.dropzone.removeFile(t)}))}onRemoveFile(t){this.removeFileFromInput(t),this.dispatchChange()}onResetForm(){}isValidFile(t){return t.size>this.maxFilesize*Math.pow(1024,2)?(this.ctx.plugins.toasts.error("Файл слишком большой"),!1):!!t.accepted||(this.ctx.plugins.toasts.error("Недопустимый формат файла"),!1)}addFileToInput(t){this.dataTransfer.items.add(t),this.$input.files=this.dataTransfer.files}removeFileFromInput(t){var e=[...this.dataTransfer.items].findIndex((e=>e.getAsFile().name===t.name));this.dataTransfer.items.remove(e),this.$input.files=this.dataTransfer.files}dispatchChange(){var t=new Event("change",{bubbles:!0});this.$input.dispatchEvent(t)}},".js-popup":class extends Da{constructor(t,e){super(t,e),s(this,"id",void 0),s(this,"$popup",void 0),s(this,"$overlay",void 0),s(this,"$inner",void 0),s(this,"$closeButtons",void 0),s(this,"$openButtons",void 0),lf(this,cf,{writable:!0,value:void 0}),lf(this,hf,{writable:!0,value:void 0}),this.id=this.$element.id;var i=this.$element.content.cloneNode(!0);this.$popup=i.children[0],this.$overlay=this.$popup.querySelector(".js-popup__overlay"),this.$inner=this.$popup.querySelector(".js-popup__inner"),this.$closeButtons=this.$popup.querySelectorAll(".js-popup__close");var n=this.$element.getAttribute("data-open-button-selector");n&&(this.$openButtons=document.querySelectorAll(n)),Ra(this,cf,this.close.bind(this)),Ra(this,hf,this.open.bind(this)),this.$element.instance=this}init(){var t;this.$overlay.addEventListener("click",za(this,cf)),this.$closeButtons.forEach((t=>{t.addEventListener("click",za(this,cf))})),null===(t=this.$openButtons)||void 0===t||t.forEach((t=>{t.addEventListener("click",za(this,hf))}))}open(){var t=this;this.ctx.plugins.lenis.stop(),k.gsap.set(this.$overlay,{opacity:0,willChange:"opacity"}),k.gsap.set(this.$inner,{opacity:0,y:-50,willChange:"opacity"}),k.gsap.timeline().add(i((function*(){document.body.append(t.$popup),yield t.ctx.initModules((e=>t.$popup.contains(e)))}))).to(this.$overlay,{opacity:.6}).to(this.$inner,{opacity:1,y:0},"<+0.2")}close(){this.ctx.plugins.lenis.start(),k.gsap.timeline().to(this.$inner,{opacity:0,y:50}).to(this.$overlay,{opacity:0},"<+0.2").add((()=>this.$popup.remove()))}},textarea:class extends Da{constructor(t,e){super(t,e)}init(){df()(this.$element)}},"input[data-mask]":class extends Da{constructor(t,e){super(t,e),s(this,"mask",void 0),this.mask=this.$element.getAttribute("data-mask")}init(){Sf(this.$element,{mask:this.mask})}},".js-ege-filter":class extends Da{constructor(t,e){super(t,e),Gf(this,Zf,{writable:!0,value:[]}),s(this,"_onInput",((t,e)=>{var{target:i}=e,n=i.closest('input[type="number"]'),r=i.value.replace(/^0/g,"")||0;if(n){var s=+n.min||0,o=+n.max||100;n.value=r,s>r&&(n.value=s,r=s),r>o&&(n.value=o,r=o)}t.value=r})),Ra(this,Zf,t.querySelectorAll(".js-ege-filter-item"))}init(){za(this,Zf).forEach((t=>{var e=t.querySelector('input[type="number"]'),i=t.querySelector('input[type="range"]');i.addEventListener("input",this._onInput.bind(this,e)),e.addEventListener("input",this._onInput.bind(this,i))}))}},".js-dual-range":class extends Da{constructor(t,e){super(t,e),Wm(this,Gm,{writable:!0,value:null}),Wm(this,Zm,{writable:!0,value:null}),Wm(this,Ym,{writable:!0,value:[]}),s(this,"_onUpdate",(t=>{var[e,i]=t,[n,r]=za(this,Ym);n&&(n.value=e.substring(0,e.length-3)),r&&(r.value=i.substring(0,i.length-3))})),Ra(this,Gm,t.querySelector(".js-dual-range-slider")),Ra(this,Ym,t.querySelectorAll('input[type="number"]'))}init(){var{min:t=0,max:e=1e4}=this.$element.dataset;Ra(this,Zm,qm(za(this,Gm),{start:[+t,+e],connect:!0,step:1,range:{min:+t,max:+e}})),za(this,Zm).on("update",this._onUpdate),za(this,Ym).forEach(((t,e)=>{t.addEventListener("blur",this._onClick.bind(this,e))}))}destroy(){za(this,Zm).off("update",this._onUpdate)}_onClick(t,e){var{target:i}=e;if(i){var n=t?[null,i.value]:[i.value,null];za(this,Zm).set(n)}}},".js-accordion-more":class extends il{constructor(t,e){super(t,e),Xm(this,Km,{writable:!0,value:null}),Xm(this,Qm,{writable:!0,value:null}),Xm(this,Jm,{writable:!0,value:[]}),Ra(this,Km,t.querySelector(".js-accordion-title")),Ra(this,Jm,za(this,Km).querySelectorAll("span"));var[i,n]=za(this,Jm);k.gsap.set(i,{display:"block"})}destroy(){var t;super.destroy(),null===(t=za(this,Qm))||void 0===t||t.kill()}open(t){super.open(t);var[e,i]=za(this,Jm);Ra(this,Qm,k.gsap.timeline()),za(this,Qm).to(e,{display:"none",opacity:0,height:0,duration:.2}).to(za(this,Km),{duration:.2}).to(i,{display:"block",height:"100%",opacity:1},"<")}close(t){var e;super.close(t),null===(e=za(this,Qm))||void 0===e||e.reverse()}},".js-filter-popup-open":qd,".js-ege-form":class extends Da{constructor(t,e){super(t,e),Gf(this,Kf,{writable:!0,value:null}),s(this,"_onSubmit",(t=>{t.preventDefault();var e=new FormData(this.$element),i=new URLSearchParams(e).toString(),n="".concat(za(this,Kf),"?").concat(i);window.location.replace(n)})),Ra(this,Kf,t.action||"/")}init(){this.$element.addEventListener("submit",this._onSubmit)}destroy(){this.$element.removeEventListener("submit",this._onSubmit)}},".js-infographics-cards-slider":class extends Da{constructor(t,e){super(t,e),s(this,"tablet",null),tg(this,eg,{writable:!0,value:void 0}),Ra(this,eg,this.onResize.bind(this))}init(){this.onResize(),window.addEventListener("resize",za(this,eg))}destroy(){window.removeEventListener("resize",za(this,eg))}onResize(){var t=APP.plugins.responsive.tablet;this.tablet!==t&&(this.tablet=t,this.updateSwiper(this.tablet))}updateSwiper(t){var e;null===(e=this.swiper)||void 0===e||e.destroy(),t&&(this.swiper=new Bc(this.$element,{modules:[Uc],spaceBetween:0,slidesPerView:1,loop:!0,pagination:{el:".swiper-pagination",clickable:!0}}))}},".js-infographics-slider":class extends Da{constructor(t,e){super(t,e),OM(this,LM,{writable:!0,value:null})}init(){Ra(this,LM,new Bc(this.$element,{modules:[jc,Uc],navigation:{prevEl:".js-slider-prev",nextEl:".js-slider-next"},pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:8,slidesPerView:1,grabCursor:!0,loop:!0}))}destroy(){var t;null===(t=za(this,LM))||void 0===t||t.destroy()}},".js-infographics":class extends Da{constructor(t,e){super(t,e),s(this,"data",void 0),s(this,"options",void 0),PM(this,IM,{writable:!0,value:void 0}),PM(this,DM,{writable:!0,value:void 0}),Ra(this,DM,this.onResize.bind(this))}init(){var t=this.$element.getAttribute("data-dataset"),e=this.$element.getAttribute("data-options"),i=JSON.parse(t);this.options=JSON.parse(e),this.data=i.map((t=>({x:new Date(t.date),y:t.value}))),this.onResize(),window.addEventListener("resize",za(this,DM))}onResize(){var t;null===(t=za(this,IM))||void 0===t||t.destroy(),Ra(this,IM,new Ax(this.$element.getContext("2d"),function(t,e){return{type:"line",data:{datasets:[{data:t,borderWidth:1,tension:.2}]},options:TM(e),plugins:[kM]}}(this.data,this.options)))}destroy(){window.removeEventListener("resize",za(this,DM)),za(this,IM).destroy()}},".js-students-life-slider":WA,".js-find-more-slider":class extends Kc{constructor(t,e){super(t,e,{spaceBetween:32,slidesPerView:1,breakpoints:{1024:{slidesPerView:3}}})}},".js-sp-panel":IC,".js-news-slider":class extends Da{constructor(t,e){super(t,e),DC(this,OC,{writable:!0,value:null}),DC(this,LC,{writable:!0,value:null}),DC(this,zC,{writable:!0,value:null});var i=t.closest(".app-section");Ra(this,LC,i.querySelector(".js-slider-prev")),Ra(this,zC,i.querySelector(".js-slider-next"))}init(){Ra(this,OC,new Bc(this.$element,{modules:[jc],navigation:{prevEl:za(this,LC),nextEl:za(this,zC)},spaceBetween:64,slidesPerView:3,loop:!0,grabCursor:!0}))}destroy(){var t;null===(t=za(this,OC))||void 0===t||t.destroy()}},".js-share":HC,"#js-menu-sites":class extends Da{constructor(t,e){super(t,e),s(this,"$menuBtn",void 0),s(this,"$contentWrapper",void 0),s(this,"$header",void 0),s(this,"$closeBtn",void 0),s(this,"$overlay",void 0),s(this,"isHeaderContrast",void 0),s(this,"windowWidth",void 0),s(this,"mobileSelected",void 0),s(this,"tl",void 0),s(this,"state",void 0),qC(this,ZC,{writable:!0,value:void 0}),qC(this,YC,{writable:!0,value:void 0}),qC(this,XC,{writable:!0,value:void 0}),this.$menuBtn=document.getElementById("js-menu-sites-button"),this.$header=document.getElementById("js-header"),this.$closeBtn=document.getElementById("js-menu-sites-close"),this.$menuWrapper=this.$element.querySelector(".menu-sites__wrapper"),this.$contentWrapper=WC(".js-menu-sites__content-wrapper",this.$element),Ra(this,ZC,this.openMenu.bind(this)),Ra(this,YC,this.closeMenu.bind(this)),this.isHeaderContrast=this.$header.classList.contains("_contrast")}init(){window.SitesMenu=this,this.$menuBtn.addEventListener("click",(()=>{this.state?this.closeMenu():this.openMenu()})),this.$closeBtn.addEventListener("click",za(this,YC)),window.addEventListener("resize",za(this,XC)),document.addEventListener("click",(t=>{!0===this.state&&t.target.classList.contains("menu-sites__backdrop")&&t.target!==this.$menuBtn&&this.closeMenu()}))}destroy(){window.removeEventListener("resize",za(this,XC)),document.removeEventListener("click",(t=>{!0===this.state&&t.target.classList.contains("menu-sites__backdrop")&&t.target!==this.$menuBtn&&this.closeMenu()}))}openMenu(){var t=this;return i((function*(){var e,i;t.state=!0,document.documentElement.classList.add("_open-menu-sites"),window.scrollY&&(yield new Promise((e=>{t.ctx.plugins.lenis.scrollTo(0,{force:!0,onComplete:e,duration:.3})}))),null===(e=window)||void 0===e||null===(e=e.SearchPopup)||void 0===e||e.closeSearchPopup(),t.initTl(),null===(i=t.$overlay)||void 0===i||i.remove(),t.$overlay=document.createElement("div"),t.$overlay.addEventListener("click",za(t,YC)),Object.assign(t.$overlay.style,GC),document.body.prepend(t.$overlay),t.tl.set(t.$element,{autoAlpha:1}).set([t.$contentWrapper],{opacity:0,y:30}).set(t.$menuWrapper,{opacity:0}).to(t.$overlay,{opacity:1,duration:.35}).to(t.$menuWrapper,{autoAlpha:1,ease:"linear"},"<").to([t.$contentWrapper],{opacity:1,y:0}).set([t.$contentWrapper],{clearProps:"willChange"}),t.ctx.plugins.lenis.stop()}))()}closeMenu(){document.documentElement.classList.contains("_menu-opened")||this.ctx.plugins.lenis.start(),this.state=!1,document.documentElement.classList.remove("_open-menu-sites"),this.initTl(),this.tl.to([this.$element,this.$overlay],{autoAlpha:0}).add((()=>{this.$overlay.removeEventListener("click",za(this,YC)),this.$overlay.remove()}))}initTl(){var t;null===(t=this.tl)||void 0===t||t.kill(),this.tl=k.gsap.timeline({defaults:{duration:.25}})}},"#map":kC,".js-fade-slider":ek,".js-flip-card":ik,"[data-datepicker-filter]":nk,"a[href]":ok,".video-alumni":mk,".pagination-control":Mk,".person-card":class extends Da{constructor(t,e){super(t,e),s(this,"setWrapperHeight",(()=>{var t=Array.from(this.$element.parentElement.querySelectorAll(".person-card:not(._small)"));if(t.length){var e=t.reduce(((t,e)=>{var i=e.getBoundingClientRect().top,n=e.querySelector(".person-card__wrapper");return t[i]?(t[i]=[...t[i],{el:e,wrapperEl:n}],t):(t[i]=[{el:e,wrapperEl:n}],t)}),{});Object.values(e).forEach((t=>{if(1!==t.length){var e=Math.max(...t.map((t=>{var{wrapperEl:e}=t;return e.offsetHeight})));t.forEach((t=>{var{wrapperEl:i}=t;i.style.minHeight=e+"px"}))}else t.forEach((t=>{var{wrapperEl:e}=t;e.style.minHeight=""}))}))}}))}init(){this.$element.classList.contains("_small")||(this.setWrapperHeight(),window.addEventListener("resize",this.setWrapperHeight))}destroy(){window.removeEventListener("resize",this.setWrapperHeight)}},".app-grid, .app-grid-divider, .numbers-grid":{module:VD,condition:t=>Array.from(t.children).some((t=>t.matches(iO.join())))},".swiper-wrapper":{module:VD,condition:t=>!!t.querySelector(iO.join())},[[".infographics-slider",".infographics-cards-slider"].join()]:VD,".educational-filter":eO};var rO=function(t){return"function"==typeof t&&/^class\s/.test(Function.prototype.toString.call(t))},sO=wP(Object.getPrototypeOf,Object),oO=Function.prototype,aO=Object.prototype,lO=oO.toString,cO=aO.hasOwnProperty,hO=lO.call(Object);var uO=function(t){if(!yl(t)||"[object Object]"!=_l(t))return!1;var e=sO(t);if(null===e)return!0;var i=cO.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&lO.call(i)==hO};var dO=new class extends E{constructor(){super(),s(this,"isLoaded",!1),s(this,"_isReady",!1),s(this,"_isShown",!1),s(this,"activeModules",{}),s(this,"plugins",{}),document.addEventListener("DOMContentLoaded",(()=>{this.init()}),{passive:!0,once:!0}),this.onObserverResizeHandler=tO((()=>{this.emit("resize:debounce")}),500)}init(){var t=this;return i((function*(){t.resizeObserver=new ResizeObserver((()=>{t.onObserverResizeHandler(),t.emit("resize")})),t.resizeObserver.observe(document.documentElement),t.isLoaded=!0,t.emit("loaded"),yield t.initPlugins(),yield t.initModules(),Promise.all([__webpack_require__.e(155),__webpack_require__.e(169)]).then(__webpack_require__.bind(__webpack_require__,7169)),t.isReady=!0}))()}refresh(){var t=this;return i((function*(){t.destroyModules(),t.isReady=!1,t.isShown=!1,yield t.initModules(),t.isReady=!0,t.isShown=!0}))()}destroyModules(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t=>!0;Object.keys(this.activeModules).forEach(((e,i)=>{var n=this.activeModules[e];t(n)&&(n.instance.destroy(),delete this.activeModules[e])}))}initPlugins(){var t=this,e=Ia.length;return new Promise((n=>{Ia.forEach(function(){var r=i((function*(i,r){yield i(t),0==--e&&n({})}));return function(t,e){return r.apply(this,arguments)}}())}))}initModules(){var t=arguments,e=this;return i((function*(){var i=t.length>0&&void 0!==t[0]?t[0]:(t,e)=>!0,n=[];Object.keys(nO).forEach((t=>{var r=nO[t],s=uO(r)?r.module:r,o=uO(r)?r.condition:null,a=!!document.querySelector(t),l="#"===t[0];a&&document.querySelectorAll(t).forEach((r=>{var a;if(i(r,s)&&(!o||o(r,s)))if(rO(s)){var c=new s(r,e);a=l?t:Tl(t+"_"),e.activeModules[a]={selector:t,id:a,instance:c},r.setAttribute("data-module-id",a),n.push(c.init())}else n.push(s().then((i=>{var{default:n}=i,s=new n(r,e);return a=l?t:Tl(t+"_"),e.activeModules[a]={selector:t,id:a,instance:s},r.setAttribute("data-module-id",a),s.init()})))}))})),yield Promise.all(n)}))()}get isReady(){return this._isReady}set isReady(t){var e=this._isReady;this._isReady=t,t&&e!==t&&this.emit("ready")}get isShown(){return this._isShown}set isShown(t){var e=this._isShown;this._isShown=t,t&&e!==t&&this.emit("shown")}};class pO{constructor(){if(pO.instance)return pO.instance;pO.instance=this;var t,e,i,n,r,s,o=navigator.userAgent,a=!1;return t=o.indexOf("Chrome")>-1,e=o.indexOf("MSIE")>-1||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,i=o.indexOf("Edge")>-1,n=o.indexOf("Firefox")>-1,r=o.indexOf("Safari")>-1,s=o.toLowerCase().indexOf("op")>-1,(t&&r||i&&r)&&(r=!1),(t&&s||i&&t)&&(t=!1),this.check=o=>{var l=!a;return l&&(a=!0),t&&(l&&document.documentElement.classList.add("is-chrome"),"chrome"===o)?t:r&&(l&&document.documentElement.classList.add("is-safari"),"safari"===o)?r:n&&(l&&document.documentElement.classList.add("is-firefox"),"firefox"===o)?n:e&&(l&&document.documentElement.classList.add("is-ie"),"ie"===o)?e:s&&(l&&document.documentElement.classList.add("is-opera"),"opera"===o)?s:!(!i||(l&&document.documentElement.classList.add("is-edge"),"edge"!==o))&&i},this.check(),this}}new pO;window.APP=dO;var fO=t=>![...t.classList].includes("nice-select")&&!t.dataset.moduleId;dO.on("ready",(()=>{var t;dO.isShown=!0,document.querySelectorAll(".text-content table").forEach((t=>{var e=document.createElement("div"),i=!!t.classList.contains("_height-auto");e.setAttribute("class","table-scroll ".concat(i?"_height-auto":"")),i||!t.dataset.lenisPrevent&&t.setAttribute("data-lenis-prevent","true"),t.parentNode.insertBefore(e,t),e.appendChild(t),e.offsetHeight===t.scrollHeight&&t.removeAttribute("data-lenis-prevent","true")})),dO.plugins.htmx.on("htmx:afterOnLoad",(()=>{dO.initModules(fO)})),t=dO,document.querySelectorAll("a").forEach((e=>{var i=e.getAttribute("href");i&&i.includes("#")&&"#"!==i&&e.addEventListener("click",(i=>{t.plugins.lenis.scrollTo(e.getAttribute("href"),{offset:-20})}))}))}))}()})();Evidence return"[Axios v1.6.5] TransitionalSolution Upgrade to the latest version of the affected library.
-
-
-
Risk=Средний, Confidence=Высокий (5)
-
https://www.fa.ru (5)
-
CSP: Failure to Define Directive with No Fallback (1)
GET https://www.fa.ru/*/index.php
Alert tags Alert description The Content Security Policy fails to define one of the directives that has no fallback. Missing/excluding them is the same as allowing anything.
Other info The directive(s): form-action is/are among the directives that do not fallback to default-src.
Request Request line and header section (270 bytes)
GET https://www.fa.ru/*/index.php HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/robots.txtRequest body (0 bytes)
Response Status line and header section (612 bytes)
HTTP/1.1 404 Not Found Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:11:22 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 112334 Connection: keep-alive Keep-Alive: timeout=10 Vary: Accept-Encoding Cache-Control: private, max-age=60 X-Frame-Options: SAMEORIGIN Content-Security-Policy: frame-ancestors 'self'; P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA" Set-Cookie: PHPSESSID=Y6I8TCTj8svRPs08Y2kXQ0cLbGuIzuDd; expires=Tue, 16-Dec-2025 13:11:22 GMT; Max-Age=10800; path=/; domain=www.fa.ru; HttpOnly Vary: Accept-EncodingResponse body (112334 bytes)
<!DOCTYPE html> <html lang="ru" id="s1"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="Финансовый университет, поступление, образование, научная деятельность, международное сотрудничество, дополнительное образование, обучение, студенты, абитуриенты, карьера" /> <meta name="description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»" /> <link href="/bitrix/cache/css/s1/main/template_9e0403e4e76a8459f3aa93a1eab92994/template_9e0403e4e76a8459f3aa93a1eab92994_v1.css?1763707797327626" type="text/css" data-template-style="true" rel="stylesheet" /> <meta property="og:type" content="article"> <meta property="og:url" content="https://www.fa.ru/*/"> <meta property="og:description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»"> <meta property="og:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <title>404 Not Found</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><!--if IEmeta(http-equiv='X-UA-Compatible' content='IE=edge')--> <meta property="og:title" content="Финансовый университет при Правительстве РФ | 404 Not Found"/> <!--link(rel='shortcut icon' href='./favicon.png')--><!--link(rel='preload' href='/fonts/.woff2' as='font' crossorigin='' type='font/woff2')--> <!-- <link rel="stylesheet" href="--><!--/css/vendor.css">--> <!-- <link rel="stylesheet" href="--><!--/css/app.css">--> </head> <body hx-ext="multi-swap"> <div class="sp-panel js-sp-panel"> <div class="sp-panel__bg"></div> <div class="sp-panel__container"> <div class="container"> <div class="sp-panel__head"> <p class="sp-panel__title">Версия для слабовидящих</p><button itemprop="copy" class="ui-icon-button _secondary sp-panel__close js-sp-panel-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="sp-panel__content"> <div class="sp-panel__group _text"> <p class="sp-panel__label">Размер текста:</p> <div class="sp-panel__buttons"><button type="button" data-sp-text="normal">A</button><button type="button" data-sp-text="medium">A</button><button type="button" data-sp-text="large">A</button></div> </div> <div class="sp-panel__group _color"> <p class="sp-panel__label">Цветовая схема:</p> <div class="sp-panel__buttons"><button type="button" data-sp-theme="light" title="Обычная">A</button><button type="button" data-sp-theme="dark" title="Темная">A</button><button type="button" data-sp-theme="black" title="Белое на черном">A</button><button type="button" data-sp-theme="white" title="Черное на белом">A</button></div> </div> <div class="sp-panel__group _images"> <p class="sp-panel__label">Изображения:</p> <div><button class="ui-button _tertiary js-sp-panel-img-off" type="button">Отключить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button><button class="ui-button _tertiary js-sp-panel-img-on" type="button">Включить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> <div class="sp-panel__group _reset"><button class="ui-button _secondary js-sp-panel-img-reset">Сбросить настройки<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> </div> </div> </div> <div class="search-popup js-search-popup"> <div class="search-popup__owerlay"></div> <div class="search-popup__container"> <div class="container"> <div class="search-popup__head"> <h2 class="search-popup__title">Поиск по сайту</h2><button class="ui-icon-button _secondary js-search-popup-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="search-popup__search"> <form class="flex gap-16" action="/search/"> <div class="ui-field js-field"> <div class="ui-field__icon"><svg class="_icon-search-24"> <use href="/local/templates/main/sprite.svg#search-24"></use> </svg></div><input class="ui-field__input" type="text" placeholder="Введите ваш запрос" id="ui-field-1" name="q" inputmode="search" /><label class="ui-field__label" for="ui-field-1">Введите ваш запрос</label> </div><button class="ui-button _primary">Поиск<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button> </form> </div> <div class="search-popup__links"> <a href="/search/?q=Подразделения">Подразделения</a> <a href="/search/?q=Кафедры">Кафедры</a> <a href="/search/?q=Магистратура">Магистратура</a> <a href="/search/?q=Дополнительное образование">Дополнительное образование</a> <a href="/search/?q=Поступающим">Поступающим</a> </div> </div> </div> </div> <header class="header " id="js-header"> <div class="container"> <div class="header__row _top"> <div class="header__group"> <button class="header__link _contrast" id="js-menu-sites-button"><svg class="_icon-menu-grid-20"> <use href="/local/templates/main/sprite.svg#menu-grid-20"></use> </svg>Наши сайты</button> <a class="header__link _contrast hidden-sm" href="/university/press-center/">Пресс-центр</a> </div> <div class="flex gap-64 sm-gap-16"> <div class="header__group"> <div class="flex gap-24 sm-gap-16"> <button itemprop="copy" class="header__link hidden-sm js-sp-panel-trigger" type="button"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg><span>Версия для слабовидящих</span></button> </div> <div class="flex gap-24 sm-gap-16"> <a class="header__link _tooltip" href="https://ruz.fa.ru/"> <div class="header__tooltip">Расписание</div><svg class="_icon-calendar-20"> <use href="/local/templates/main/sprite.svg#calendar-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="http://www.library.fa.ru/"> <div class="header__tooltip">Библиотека</div><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="/university/services/"> <div class="header__tooltip">Сервисы</div><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <a class="header__link _tooltip" href="https://org.fa.ru/"> <div class="header__tooltip">Личный кабинет</div><svg class="_icon-user-20"> <use href="/local/templates/main/sprite.svg#user-20"></use> </svg></a> <button class="header__link _tooltip js-search-popup-toggle" type="button"> <div class="header__tooltip">Поиск</div><svg class="_icon-search-20"> <use href="/local/templates/main/sprite.svg#search-20"></use> </svg> </button> <a class="header__link _tooltip" href="https://biz.mail.ru/login/fa.ru"> <div class="header__tooltip">Почта</div><svg class="_icon-mail-20"> <use href="/local/templates/main/sprite.svg#mail-20"></use> </svg> </a> </div><!-- <div class="flex gap-24 sm-gap-16"><a class="header__link" href="#"><svg class="_icon-search-20">--> <!-- <use href="--><!--/sprite.svg#search-20"></use>--> <!-- </svg></a><a class="header__link hidden-sm" href="#"><svg class="_icon-eye-20">--> <!-- <use href="--><!--/sprite.svg#eye-20"></use>--> <!-- </svg></a></div>--> <div class="flex gap-16 hidden-md"> <a class="header__link" href="https://www.fa.ru">Ru</a> <a class="header__link" href="https://en.fa.ru/">En</a> </div> </div><label class="_contrast toggle-theme js-toggle-theme" for="js-toggle-theme"><span class="toggle-theme__light"><svg class="_icon-sun-20"><use href="/local/templates/main/sprite.svg#sun-20"></use></svg></span><span class="toggle-theme__switcher"><input id="js-toggle-theme" type="checkbox" hidden="hidden"/><span class="toggle-theme__flag"></span></span><span class="toggle-theme__dark"><svg class="_icon-moon-20"><use href="/local/templates/main/sprite.svg#moon-20"></use></svg></span></label> </div> </div> <div class="header__row _bottom js-menu__first-level"> <div class="header__row-inner"> <a class="header__logo" href="/"> <svg class="_icon-logo-colored"> <use href="/local/templates/main/sprite.svg#logo-colored"></use> </svg> </a> <div class="flex gap-48 items-center"> <div class="flex gap-40 hidden-md"> <a class="header__main-link js-menu__main-link" href="/university">Университет</a> <a class="header__main-link js-menu__main-link" href="/for-applicants/">Поступающим</a> <a class="header__main-link js-menu__main-link" href="/for-students/">Студентам</a> <a class="header__main-link js-menu__main-link" href="/dpo/">Допобразование</a> <a class="header__main-link js-menu__main-link" href="/graduate/">Выпускникам</a> <a class="header__main-link js-menu__main-link" href="/science/">Наука</a> </div><button class="burger-menu" id="js-burger-menu"><span class="burger-menu__icons"><span class="js-burger-open"><svg class="_icon-menu-24"><use href="/local/templates/main/sprite.svg#menu-24"></use></svg></span><span class="js-burger-close"><svg class="_icon-close-24"><use href="/local/templates/main/sprite.svg#close-24"></use></svg></span></span><span class="burger-menu__label">Меню</span></button> </div> </div> </div> </div> </header> <div class="menu" id="js-menu"> <div class="menu__backdrop js-menu__first-level"></div> <div class="menu__image"> <img src="/local/templates/main/images/example-image.jpg" alt="Фон меню" /> </div> <div class="menu-navbar hidden-from-md"> <div class="menu-navbar__icons"> <a class="menu-navbar__link" href="#"><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="menu-navbar__link" href="#"><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <button class="menu-navbar__link js-sp-panel-trigger"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg></button> <a class="menu-navbar__link" href="#">En</a> </div><a class="menu-navbar__link _media" href="#">Медиа</a> </div> <!-- Главное меню --> <div class="container menu__inner"> <div class="menu-tabs hidden-md" data-lenis-prevent="data-lenis-prevent"><button class="menu-tabs__item js-menu-tab__desktop">Университет</button><button class="menu-tabs__item js-menu-tab__desktop">Поступающим</button><button class="menu-tabs__item js-menu-tab__desktop">Студентам</button><button class="menu-tabs__item js-menu-tab__desktop">Выпускникам</button><button class="menu-tabs__item js-menu-tab__desktop">Дополнительное образование</button><button class="menu-tabs__item js-menu-tab__desktop">Наука</button><button class="menu-tabs__item js-menu-tab__desktop">Международная деятельность</button><button class="menu-tabs__item js-menu-tab__desktop">Работникам и соискателям</button></div> <div class="menu-tabs hidden-from-md js-menu__first-level" data-lenis-prevent="data-lenis-prevent"> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Университет</button> <a class="menu-tabs__icon" href="/university/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Поступающим</button> <a class="menu-tabs__icon" href="/for-applicants/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Студентам</button> <a class="menu-tabs__icon" href="/for-students/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Выпускникам</button> <a class="menu-tabs__icon" href="/graduate/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Дополнительное образование</button> <a class="menu-tabs__icon" href="/dpo/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Наука</button> <a class="menu-tabs__icon" href="/science/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Международная деятельность</button> <a class="menu-tabs__icon" href="/international-activity/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Работникам и соискателям</button> <a class="menu-tabs__icon" href="/employee/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> </div> <div class="menu__content-wrapper js-menu__content-wrapper" data-lenis-prevent="data-lenis-prevent"> <button class="ui-button _tertiary _contrast menu__mobile-back js-menu__mobile-back"><span class="ui-button__icon"><svg class="_icon-caret-left-16"><use href="/local/templates/main/sprite.svg#caret-left-16"></use></svg></span>Назад</button> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/university/"><span class="text-h3 text-contrast">Университет</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Университет</h4> <a class="menu__link" href="/university/basic-information/">Основные сведения</a> <a class="menu__link" href="/university/structure/rectorate/">Руководство</a> <a class="menu__link" href="/university/structure/">Организационная структура</a> <a class="menu__link" href="/university/rating/">Университет в рейтингах</a> <a class="menu__link" href="https://www.fa.ru/university/history/">История Финансового университета</a> <a class="menu__link" href="/university/structure/university/museum/">Музей Финансового университета</a> <a class="menu__link" href="/university/structure/university/usr/social-projects/">Социальные проекты</a> <a class="menu__link" href="/university/programm/">Программа развития</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/branches/">Филиалы</a> <a class="menu__link" href="/university/contacts/">Контакты</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/sveden/">Сведения об образовательной организации</a> <a class="menu__link" href="/university/uchenyy-sovet/">Ученый совет Финансового университета</a> <a class="menu__link" href="/university/psovet/">Попечительский совет</a> <a class="menu__link" href="/university/epb/">Единая правовая база</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/anticorruption/">Противодействие коррупции</a> <a class="menu__link" href="/university/antiterror/">Антитеррористическая и антиэкстремистская деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-applicants/"><span class="text-h3 text-contrast">Поступающим</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/bachelor/">Бакалавриат и специалитет</a> <a class="menu__link" href="/for-applicants/master/">Магистратура</a> <a class="menu__link" href="/for-applicants/postgraduate/">Аспирантура</a> <a class="menu__link" href="/science/doctoral/">Докторантура</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/second-degree/">Второе высшее образование</a> <a class="menu__link" href="/for-applicants/distance-education/">Дистанционное образование</a> <a class="menu__link" href="/for-applicants/transfers/">Переводы и восстановления</a> <a class="menu__link" href="/dpo/">Дополнительное образование</a> <a class="menu__link" href="/international-activity/">Обучение за рубежом</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-students/"><span class="text-h3 text-contrast">Студентам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Сервисы</h4> <a class="menu__link" href="https://org.fa.ru/">Личный кабинет студента</a> <a class="menu__link" href="https://online.fa.ru/">Открытая онлайн-академия</a> <a class="menu__link" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="http://www.library.fa.ru">Библиотека</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="https://en.fa.ru/for-students/">Иностранным студентам</a> <a class="menu__link" href="/for-students/oplata/">Оплата обучения и общежития</a> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="menu__link" href="/for-students/free/">Переход с платного обучения на бесплатное</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/graduate/"><span class="text-h3 text-contrast">Выпускникам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/alumni/">Ассоциация выпускников Финуниверситета</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/foundation/">Эндаумент-фонд</a> <a class="menu__link" href="/graduate/#block-28040">Сервисы для выпускников</a> <a class="menu__link" href="https://endowmentfa.ru/donate">Стать дарителем</a> <a class="menu__link" href="https://www.fa.ru/graduate/alumni-meeting-conference/">Конференция-встреча выпускников Финансового университета</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/mentoring/">Наставничество</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/PolPred/">Полномочный Представитель</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/dpo/"><span class="text-h3 text-contrast">Дополнительное образование</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Подразделения ДПО</h4> <a class="menu__link" href="/university/structure/dpo/vsgz/">Высшая школа государственных закупок</a> <a class="menu__link" href="/university/structure/dpo/vsl/">Высшая школа логистики</a> <a class="menu__link" href="/university/structure/dpo/vsmt/">Высшая школа менеджмента и технологий</a> <a class="menu__link" href="/university/structure/dpo/vsugmf/">Высшая школа управления государственными и муниципальными финансами</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/vsp/">Высшая школа предпринимательства</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Институт корпоративного обучения</a> <a class="menu__link" href="/university/structure/dpo/irpkk/">Институт развития профессиональных компетенций и квалификаций</a> <a class="menu__link" href="/university/structure/dpo/ifm/">Институт финансового менеджмента</a> <a class="menu__link" href="/university/structure/dpo/ifg/">Институт финансовой грамотности</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/ipks/">Институт повышения квалификации специалистов</a> <a class="menu__link" href="/university/structure/dpo/msb/">Международная школа бизнеса (Институт)</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/business-school/">Бизнес-школа Финуниверситета (Институт)</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/dpo/crdo/">Центр развития дополнительного образования</a> <a class="menu__link" href="/university/structure/dpo/podpo/">Центр «Проектный офис ДПО»</a> <a class="menu__link" href="/university/structure/educational-departments/dep/dapk/ciys/">Центр инновационных образовательных и языковых стратегий</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/ff/cnfo/">Центр непрерывного финансового образования Финансового факультета</a> <a class="menu__link" href="/university/structure/dpo/ce/">Центр компетенций "Цифровая экономика"</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/nna/">Кафедра налогов и налогового администрирования</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/meo/iymk/">Кафедра иностранных языков и межкультурной коммуникации</a> <a class="menu__link" href="/university/structure/dpo/rukovodstvodpo/">Руководство ДПО</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/science/"><span class="text-h3 text-contrast">Наука</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная деятельность</h4> <a class="menu__link" href="/science/basic-science/">Фундаментальная наука</a> <a class="menu__link" href="/science/applied-research/">Прикладные исследования</a> <a class="menu__link" href="/university/structure/science/rnj/#block-2642">Журналы Финуниверситета</a> <a class="menu__link" href="/university/structure/education/upo/clusters/">Научно-образовательные кластеры</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Научная инфраструктура</h4> <a class="menu__link" href="/science/research-departments/">Научно-исследовательские подразделения</a> <a class="menu__link" href="/university/structure/science/osni/">Дирекция по организационному сопровождению научных исследований</a> <a class="menu__link" href="/university/structure/science/uoonir/">Группа планирования и мониторинга научной деятельности</a> <a class="menu__link" href="for-students/student-science/nso/">Научное студенческое общество</a> <a class="menu__link" href="/for-students/student-science/council-young-scientists/">Совет молодых ученых</a> <a class="menu__link" href="/university/structure/science/rnj/">Редакция научных журналов</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная аттестация</h4> <a class="menu__link" href="/university/structure/science/uank/">Управление аттестации научных кадров</a> <a class="menu__link" href="/university/structure/science/uank/dsfu/">Диссертационные советы Финансового университета</a> <a class="menu__link" href="/university/structure/science/uank/pd/">Перечень документов для представления в диссертационный совет</a> <a class="menu__link" href="https://www.fa.ru/dissertations/autorefs/">Объявления о защите диссертаций</a> <a class="menu__link" href="https://www.fa.ru/science/nak/">Научно-аттестационная комиссия Финансового Университета</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Экспертно-аналитическая деятельность</h4> <a class="menu__link" href="https://www.fa.ru/science/expert-analytical-activities/">Экспертно-аналитическая деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/international-activity/"><span class="text-h3 text-contrast">Международная деятельность</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Студентам</h4> <a class="menu__link" href="/international-activity/included-education/">Включенное обучение</a> <a class="menu__link" href="/international-activity/two-dip/">Программы двух дипломов</a> <a class="menu__link" href="/international-activity/programs/">Краткосрочные программы</a> <a class="menu__link" href="/international-activity/grants/">Стипендии и гранты</a> <a class="menu__link" href="/international-activity/russiansummerschool/">Летняя школа русского языка и культуры в Финансовом университете</a> <a class="menu__link" href="/international-activity/exchange/">Программы обмена (для иностранных студентов)</a> <a class="menu__link" href="/international-activity/help/">Справки и транскрипт</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Выпускникам</h4> <a class="menu__link" href="/international-activity/european/">Приложение к диплому</a> <a class="menu__link" href="/international-activity/diplom/">Подтверждение диплома за рубежом</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Преподавателям</h4> <a class="menu__link" href="/international-activity/projects/">Международные проекты</a> <a class="menu__link" href="/international-activity/abroad/">Академическая мобильность работников и командирование за рубеж</a> <a class="menu__link" href="/international-activity/professor/">Программа «Приглашенный профессор»</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Партнерам</h4> <a class="menu__link" href="/international-activity/partnership/">Зарубежное партнерство</a> <a class="menu__link" href="https://www.fa.ru/international-activity/associations/">Международные ассоциации и сетевые университеты</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/employee/"><span class="text-h3 text-contrast">Работникам и соискателям</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/employee/vacancy/">Вакансии и конкурсы НПР</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Корпоративное обучение</a> <a class="menu__link" href="/employee/couching/">Наставничество</a> <a class="menu__link" href="/university/epb/82">Документы по управлению персоналом и работе с кадрами</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> <a class="menu__link" href="https://www.fa.ru/university/employee/">Наши работники</a> </div> <div class="menu__links"> </div> </div> <div class="menu__links-column"> <div class="menu__links"> </div> </div> </div> </div> </div> </div> <!-- /Главное меню --> </div> <!-- Наши сайты --> <div class="menu-sites" id="js-menu-sites"> <div class="menu-sites__backdrop js-menu-sites"></div> <div class="menu-sites__wrapper"> <div class="container"> <div class="menu-sites__inner js-menu-sites__content-wrapper"><button class="ui-icon-button _secondary menu-sites__button" id="js-menu-sites-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-20"> <use href="/local/templates/main/sprite.svg#close-20"></use> </svg></button> <div class="ui-tabs js-tabs"> <div class="ui-tabs__control js-tabs-control"> <button class="ui-tab" type="button" data-index="0"><span class="ui-tab__label">Филиалы</span></button> <button class="ui-tab" type="button" data-index="1"><span class="ui-tab__label">Колледжи Москвы</span></button> <button class="ui-tab" type="button" data-index="2"><span class="ui-tab__label">Ресурсы университета</span></button> <button class="ui-tab" type="button" data-index="3"><span class="ui-tab__label">Подразделения</span></button> <button class="ui-tab" type="button" data-index="4"><span class="ui-tab__label">Дополнительное образование</span></button> </div> <div class="ui-tabs__content js-tabs-content"> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://altai.fa.ru/" target="_blank"> <span class="ui-links__link">Алтайский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladik.fa.ru/" target="_blank"> <span class="ui-links__link">Владикавказский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladimir.fa.ru/" target="_blank"> <span class="ui-links__link">Владимирский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kaluga.fa.ru/" target="_blank"> <span class="ui-links__link">Калужский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnodar.fa.ru/" target="_blank"> <span class="ui-links__link">Краснодарский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kursk.fa.ru/" target="_blank"> <span class="ui-links__link">Курский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lipetsk.fa.ru/" target="_blank"> <span class="ui-links__link">Липецкий филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://novoross.fa.ru/" target="_blank"> <span class="ui-links__link">Новороссийский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://omsk.fa.ru/" target="_blank"> <span class="ui-links__link">Омский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://orel.fa.ru/" target="_blank"> <span class="ui-links__link">Орловский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://penza.fa.ru/" target="_blank"> <span class="ui-links__link">Пензенский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://spb.fa.ru/" target="_blank"> <span class="ui-links__link">Санкт-Петербургский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://smolensk.fa.ru/" target="_blank"> <span class="ui-links__link">Смоленский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://tula.fa.ru/" target="_blank"> <span class="ui-links__link">Тульский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://chelyabinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Уральский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://ufa.fa.ru/" target="_blank"> <span class="ui-links__link">Уфимский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://yaroslavl.fa.ru/" target="_blank"> <span class="ui-links__link">Ярославский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://blagov.fa.ru/" target="_blank"> <span class="ui-links__link">Благовещенский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://buzuluk.fa.ru/" target="_blank"> <span class="ui-links__link">Бузулукский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://zvenigorod.fa.ru/" target="_blank"> <span class="ui-links__link">Звенигородский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kanash.fa.ru/" target="_blank"> <span class="ui-links__link">Канашский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnoyarsk.fa.ru/" target="_blank"> <span class="ui-links__link">Красноярский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mahachkala.fa.ru/" target="_blank"> <span class="ui-links__link">Махачкалинский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://perm.fa.ru/" target="_blank"> <span class="ui-links__link">Пермский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://samara.fa.ru/" target="_blank"> <span class="ui-links__link">Самарский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://surgut.fa.ru/" target="_blank"> <span class="ui-links__link">Сургутский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://shadrinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Шадринский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kip.fa.ru" target="_blank"> <span class="ui-links__link">Колледж информатики и программирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mfc.fa.ru" target="_blank"> <span class="ui-links__link">Московский финансовый колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://anketa.fa.ru/" target="_blank"> <span class="ui-links__link">Личный кабинет поступающего / слушателя</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://podku.fa.ru/" target="_blank"> <span class="ui-links__link">Подготовительные курсы Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://org.fa.ru/app/kk/dpp/programs" target="_blank"> <span class="ui-links__link">Корпоративное обучение</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pay.fa.ru" target="_blank"> <span class="ui-links__link">Все ссылки на оплату, Москва и филиалы</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://forum.fa.ru/" target="_blank"> <span class="ui-links__link">Международный форум Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://edu.fa.ru/" target="_blank"> <span class="ui-links__link">Дополнительное образование</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://business.fa.ru/" target="_blank"> <span class="ui-links__link">Предпринимательский клуб Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pirsocenter.ru/foresight2025" target="_blank"> <span class="ui-links__link">Форсайт образования</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lesnoe.fa.ru/" target="_blank"> <span class="ui-links__link">Учебно-оздоровительный комплекс «Лесное озеро»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://career.fa.ru/" target="_blank"> <span class="ui-links__link">Центр карьеры</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://online.fa.ru" target="_blank"> <span class="ui-links__link">Открытая онлайн-академия</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsgz/" target="_blank"> <span class="ui-links__link">Высшая школа государственных закупок</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsl/" target="_blank"> <span class="ui-links__link">Высшая школа логистики</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsmt/" target="_blank"> <span class="ui-links__link">Высшая школа менеджмента и технологий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsugmf/" target="_blank"> <span class="ui-links__link">Высшая школа управления государственными и муниципальными финансами</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ipk/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации и профессиональной переподготовки работников</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/irpkk/" target="_blank"> <span class="ui-links__link">Институт развития профессиональных компетенций и квалификаций</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifm/" target="_blank"> <span class="ui-links__link">Институт финансового менеджмента</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifg/" target="_blank"> <span class="ui-links__link">Институт финансовой грамотности</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/msb/" target="_blank"> <span class="ui-links__link">Международная школа бизнеса (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/business-school/" target="_blank"> <span class="ui-links__link">Бизнес-школа Финуниверситета (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/vsp/" target="_blank"> <span class="ui-links__link">Высшая школа предпринимательства</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/ipks/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации специалистов</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/nna/" target="_blank"> <span class="ui-links__link">Кафедра налогов и налогового администрирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/educational-departments/dep/dapk/ciys/" target="_blank"> <span class="ui-links__link">Центр инновационных образовательных и языковых стратегий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/meo/iymk/" target="_blank"> <span class="ui-links__link">Кафедра иностранных языков и межкультурной коммуникации</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/vsu/gcp/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Государственно-частное партнерство»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/ff/izkifi/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Ипотечное жилищное кредитование и финансовые инструменты рынка недвижимости»</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /Наши сайты --> <main id="app"><div class="not-found"> <div class="container"> <div class="not-found__content"> <p class="not-found__404">404</p> <h1 class="not-found__title">Страница не найдена</h1> <p class="not-found__desc">К сожалению, такой страницы не существует. Попробуйте изменить запрос или перейти на главную страницу</p><a class="ui-button _primary _icon-arrow" href="/">Перейти на главную<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a> </div> </div> <div class="not-found__bg"> <img src="/local/templates/main/images/bg-404.png" alt="Картинка заднего фона" /></div> </div></main> <div class="filter-popup" id="date-filter-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-block-response.html" hx-trigger="submit delay:300ms" hx-target="#event-block"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-events-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-response.html" hx-trigger="submit delay:300ms" hx-target="#events"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use /local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-year-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать год</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter" data-year="data-year"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/project-block-response.html" hx-trigger="submit delay:300ms" hx-target="#project-block"> <div class="datepicker js-datepicker-filter _filter"><input name="year" placeholder="Выбрать год" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button _year"><input type="radio" checked="checked" name="filter" value="all" /><label>Все<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="research" /><label>Научные исследования<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="development" /><label>Разработки<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="container"> <div class="button-up"><button class="ui-button _tertiary" id="js-scroll-to-top-button">Наверх<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-16"><use href="/local/templates/main/sprite.svg#arrow-up-16"></use></svg></span></button></div> </div> <!-- Useful-links block --> <div class="useful-links js-useful-links"><button class="useful-links__trigger js-useful-links__trigger"><span class="container"><span class="useful-links__trigger-inner"><span class="useful-links__label">Полезные ссылки</span><span class="useful-links__icon"><svg class="_icon-caret-down-16"><use href="/local/templates/main/sprite.svg#caret-down-16"></use></svg></span></span></span></button> <div class="container"> <div class="useful-links__content js-useful-links__content"> <div class="useful-links__content-inner"> <a class="useful-links__link" target="_blank" href="https://edu.fa.ru/">Информационно-образовательный портал</a> <a class="useful-links__link" target="_blank" href="https://anketa.fa.ru/">Личный кабинет поступающего</a> <a class="useful-links__link" target="_blank" href="http://www.library.fa.ru/">Библиотечно-информационный комплекс</a> <a class="useful-links__link" target="_blank" href="https://pay.fa.ru/moscow/">Оплата обучения</a> <a class="useful-links__link" target="_blank" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="useful-links__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="useful-links__link" href="/university/contacts/">Официальный адрес электронной почты</a> <a class="useful-links__link" href="/university/structure/university/sitp/">ИТ-поддержка</a> <a class="useful-links__link" target="_blank" href="https://edu.gov.ru/">Министерство просвещения РФ</a> <a class="useful-links__link" target="_blank" href="https://minobrnauki.gov.ru/">Министерство науки и высшего образования РФ</a> </div> </div> </div> </div> <!-- End useful-links block --> <footer class="footer"> <div class="container"> <div class="app-grid _cols-1" style="--cols:1;--cols-md:1;--cols-sm:1;--gap:4rem;--gap-md:4rem;--gap-sm:2.4rem;"> <div class="footer__top-section flex justify-between items-center"> <div class="footer__logo"> <svg class="_icon-logo"> <use href="/local/templates/main/sprite.svg#logo"></use> </svg> </div> </div> <div class="footer__section"> <!-- footer address --> <div class="footer__address"><span class="text-body-small">Адрес университета</span><b class="text-body-bold">125167, Москва, пр-кт Ленинградский, д. 49/2</b> <p class="text-body-small">По вопросам, касающимся проведения съемок на территории Финансового университета, присылайте свой запрос в письменном виде в <a href="https://www.fa.ru/university/structure/university/uso/press-service/" style="color:#FFFFFF;">Пресс-службу</a> университета по электронной почте pressa@fa.ru</p> </div> <!-- End footer address --> <!-- footer menu block --> <div class="footer__links-grid hidden-sm"> <a class="footer__link text-button" href="/university/">Университет</a> <a class="footer__link text-button" href="/for-applicants/">Поступающим</a> <a class="footer__link text-button" href="/for-students/">Студентам</a> <a class="footer__link text-button" href="/graduate/">Выпускникам</a> <a class="footer__link text-button" href="/dpo/">Дополнительное образование</a> <a class="footer__link text-button" href="/science/">Наука</a> <a class="footer__link text-button" href="/employee">Работникам и соискателям</a> <a class="footer__link text-button" href="/international-activity/">Международная деятельность</a> <a class="footer__link text-button" href="/university/branches">Филиалы</a> <a class="footer__link text-button" href="/university/services/">Сервисы</a> <a class="footer__link text-button" href="/university/anticorruption/">Противодействие коррупции</a> <a class="footer__link text-button" href="/sveden/">Сведения об образовательной организации</a> <a class="footer__link text-button" target="_blank" href="https://org.fa.ru/">Личный кабинет</a> <a class="footer__link text-button" target="_blank" href="https://lesnoe.fa.ru">Учебно-оздоровительный комплекс «Лесное озеро»</a> <a class="footer__link text-button" href="/university/project/">Проектная деятельность</a> <a class="footer__link text-button" target="_blank" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="footer__link text-button" href="/university/campuscard/">Кампусная карта</a> <a class="footer__link text-button" href="/university/contacts/">Контакты</a> <a class="footer__link text-button" href="/university/structure/university/uso/adogokouo/">Анкета для опроса граждан о качестве оказания услуг организацией</a> <a class="footer__link text-button" target="_blank" href="https://endowmentfa.ru/donate">Стать дарителем</a> </div> <!-- End footer block --> </div> <div class="footer__section"> <!-- socials block --> <div class="footer__socials flex gap-8"> <a class="ui-icon-button _secondary _contrast" href="https://t.me/s/finuniverchan" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-tg-20"> <use href="/local/templates/main/sprite.svg#social-tg-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://vk.com/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-vk-20"> <use href="/local/templates/main/sprite.svg#social-vk-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://max.ru/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-max-20"> <use href="/local/templates/main/sprite.svg#social-max-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://www.youtube.com/channel/UChitH8STbXi2HyYTqXnHSnw" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-youtube-20"> <use href="/local/templates/main/sprite.svg#social-youtube-20"></use> </svg> </a> </div> <!-- socials block --> <!-- contacts block --> <div class="app-grid _cols-3" style="--cols:3;--cols-md:3;--cols-sm:1;--gap:3.2rem;--gap-md:3.2rem;--gap-sm:2.4rem;"> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная комиссия</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(495)249-52-49">+7(495)249-52-49</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:priemka@fa.ru">priemka@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Официальный адрес электронной почты</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:"></a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:academy@fa.ru">academy@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная ректора</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(499)943-95-80">+7(499)943-95-80</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:rector@fa.ru">rector@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Для справок по корреспонденции</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 499 943 98 55">+7 499 943 98 55</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:"></a></div> </div> </div> <!-- contacts block --> </div> </div> </div> </footer> <script src="/local/templates/main/js/app.js?1763707713" defer=""></script> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(98905690, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98905690" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(99165694, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/99165694" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(102224032, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/102224032" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103033693, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103033693" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241759, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241759" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241988, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241988" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103325236, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103325236" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript"> (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) })(window, document,'script','https://mc.yandex.ru/metrika/tag.js', 'ym'); ym(98069295, 'init', {webvisor:true, clickmap:true, accurateTrackBounce:true, trackLinks:true}); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98069295" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> </body> </html>Parameter Content-Security-PolicyEvidence frame-ancestors 'self';Solution Убедитесь, что ваш веб-сервер, сервер приложений, балансировщик нагрузки и т. д. правильно настроены для установки заголовка Content-Security-Policy.
-
CSP: style-src небезопасный встроенный (1)
GET https://www.fa.ru/*/index.php
Alert tags Alert description Политика безопасности контента (CSP) - это дополнительный уровень безопасности, который помогает обнаруживать и смягчать определенные типы атак.
Включая (но не ограничиваясь) межсайтовыми сценариями (XSS) и атаками путем внедрения данных.
Эти атаки используются для всего, от кражи данных до повреждения сайта
или распространения вредоносного ПО.
CSP предоставляет набор стандартных HTTP-заголовков,
которые позволяют владельцам веб-сайтов объявлять утвержденные источники контента,
которые браузерам следует разрешить загружать на эту страницу - охватываемые типы - это JavaScript, CSS, HTML-фреймы, шрифты, изображения и встраиваемые объекты, такие как Java-апплеты, ActiveX, аудио и видео файлы.
Other info style-src включает unsafe-inline.
Request Request line and header section (270 bytes)
GET https://www.fa.ru/*/index.php HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/robots.txtRequest body (0 bytes)
Response Status line and header section (612 bytes)
HTTP/1.1 404 Not Found Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:11:22 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 112334 Connection: keep-alive Keep-Alive: timeout=10 Vary: Accept-Encoding Cache-Control: private, max-age=60 X-Frame-Options: SAMEORIGIN Content-Security-Policy: frame-ancestors 'self'; P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA" Set-Cookie: PHPSESSID=Y6I8TCTj8svRPs08Y2kXQ0cLbGuIzuDd; expires=Tue, 16-Dec-2025 13:11:22 GMT; Max-Age=10800; path=/; domain=www.fa.ru; HttpOnly Vary: Accept-EncodingResponse body (112334 bytes)
<!DOCTYPE html> <html lang="ru" id="s1"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="Финансовый университет, поступление, образование, научная деятельность, международное сотрудничество, дополнительное образование, обучение, студенты, абитуриенты, карьера" /> <meta name="description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»" /> <link href="/bitrix/cache/css/s1/main/template_9e0403e4e76a8459f3aa93a1eab92994/template_9e0403e4e76a8459f3aa93a1eab92994_v1.css?1763707797327626" type="text/css" data-template-style="true" rel="stylesheet" /> <meta property="og:type" content="article"> <meta property="og:url" content="https://www.fa.ru/*/"> <meta property="og:description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»"> <meta property="og:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <title>404 Not Found</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><!--if IEmeta(http-equiv='X-UA-Compatible' content='IE=edge')--> <meta property="og:title" content="Финансовый университет при Правительстве РФ | 404 Not Found"/> <!--link(rel='shortcut icon' href='./favicon.png')--><!--link(rel='preload' href='/fonts/.woff2' as='font' crossorigin='' type='font/woff2')--> <!-- <link rel="stylesheet" href="--><!--/css/vendor.css">--> <!-- <link rel="stylesheet" href="--><!--/css/app.css">--> </head> <body hx-ext="multi-swap"> <div class="sp-panel js-sp-panel"> <div class="sp-panel__bg"></div> <div class="sp-panel__container"> <div class="container"> <div class="sp-panel__head"> <p class="sp-panel__title">Версия для слабовидящих</p><button itemprop="copy" class="ui-icon-button _secondary sp-panel__close js-sp-panel-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="sp-panel__content"> <div class="sp-panel__group _text"> <p class="sp-panel__label">Размер текста:</p> <div class="sp-panel__buttons"><button type="button" data-sp-text="normal">A</button><button type="button" data-sp-text="medium">A</button><button type="button" data-sp-text="large">A</button></div> </div> <div class="sp-panel__group _color"> <p class="sp-panel__label">Цветовая схема:</p> <div class="sp-panel__buttons"><button type="button" data-sp-theme="light" title="Обычная">A</button><button type="button" data-sp-theme="dark" title="Темная">A</button><button type="button" data-sp-theme="black" title="Белое на черном">A</button><button type="button" data-sp-theme="white" title="Черное на белом">A</button></div> </div> <div class="sp-panel__group _images"> <p class="sp-panel__label">Изображения:</p> <div><button class="ui-button _tertiary js-sp-panel-img-off" type="button">Отключить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button><button class="ui-button _tertiary js-sp-panel-img-on" type="button">Включить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> <div class="sp-panel__group _reset"><button class="ui-button _secondary js-sp-panel-img-reset">Сбросить настройки<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> </div> </div> </div> <div class="search-popup js-search-popup"> <div class="search-popup__owerlay"></div> <div class="search-popup__container"> <div class="container"> <div class="search-popup__head"> <h2 class="search-popup__title">Поиск по сайту</h2><button class="ui-icon-button _secondary js-search-popup-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="search-popup__search"> <form class="flex gap-16" action="/search/"> <div class="ui-field js-field"> <div class="ui-field__icon"><svg class="_icon-search-24"> <use href="/local/templates/main/sprite.svg#search-24"></use> </svg></div><input class="ui-field__input" type="text" placeholder="Введите ваш запрос" id="ui-field-1" name="q" inputmode="search" /><label class="ui-field__label" for="ui-field-1">Введите ваш запрос</label> </div><button class="ui-button _primary">Поиск<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button> </form> </div> <div class="search-popup__links"> <a href="/search/?q=Подразделения">Подразделения</a> <a href="/search/?q=Кафедры">Кафедры</a> <a href="/search/?q=Магистратура">Магистратура</a> <a href="/search/?q=Дополнительное образование">Дополнительное образование</a> <a href="/search/?q=Поступающим">Поступающим</a> </div> </div> </div> </div> <header class="header " id="js-header"> <div class="container"> <div class="header__row _top"> <div class="header__group"> <button class="header__link _contrast" id="js-menu-sites-button"><svg class="_icon-menu-grid-20"> <use href="/local/templates/main/sprite.svg#menu-grid-20"></use> </svg>Наши сайты</button> <a class="header__link _contrast hidden-sm" href="/university/press-center/">Пресс-центр</a> </div> <div class="flex gap-64 sm-gap-16"> <div class="header__group"> <div class="flex gap-24 sm-gap-16"> <button itemprop="copy" class="header__link hidden-sm js-sp-panel-trigger" type="button"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg><span>Версия для слабовидящих</span></button> </div> <div class="flex gap-24 sm-gap-16"> <a class="header__link _tooltip" href="https://ruz.fa.ru/"> <div class="header__tooltip">Расписание</div><svg class="_icon-calendar-20"> <use href="/local/templates/main/sprite.svg#calendar-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="http://www.library.fa.ru/"> <div class="header__tooltip">Библиотека</div><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="/university/services/"> <div class="header__tooltip">Сервисы</div><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <a class="header__link _tooltip" href="https://org.fa.ru/"> <div class="header__tooltip">Личный кабинет</div><svg class="_icon-user-20"> <use href="/local/templates/main/sprite.svg#user-20"></use> </svg></a> <button class="header__link _tooltip js-search-popup-toggle" type="button"> <div class="header__tooltip">Поиск</div><svg class="_icon-search-20"> <use href="/local/templates/main/sprite.svg#search-20"></use> </svg> </button> <a class="header__link _tooltip" href="https://biz.mail.ru/login/fa.ru"> <div class="header__tooltip">Почта</div><svg class="_icon-mail-20"> <use href="/local/templates/main/sprite.svg#mail-20"></use> </svg> </a> </div><!-- <div class="flex gap-24 sm-gap-16"><a class="header__link" href="#"><svg class="_icon-search-20">--> <!-- <use href="--><!--/sprite.svg#search-20"></use>--> <!-- </svg></a><a class="header__link hidden-sm" href="#"><svg class="_icon-eye-20">--> <!-- <use href="--><!--/sprite.svg#eye-20"></use>--> <!-- </svg></a></div>--> <div class="flex gap-16 hidden-md"> <a class="header__link" href="https://www.fa.ru">Ru</a> <a class="header__link" href="https://en.fa.ru/">En</a> </div> </div><label class="_contrast toggle-theme js-toggle-theme" for="js-toggle-theme"><span class="toggle-theme__light"><svg class="_icon-sun-20"><use href="/local/templates/main/sprite.svg#sun-20"></use></svg></span><span class="toggle-theme__switcher"><input id="js-toggle-theme" type="checkbox" hidden="hidden"/><span class="toggle-theme__flag"></span></span><span class="toggle-theme__dark"><svg class="_icon-moon-20"><use href="/local/templates/main/sprite.svg#moon-20"></use></svg></span></label> </div> </div> <div class="header__row _bottom js-menu__first-level"> <div class="header__row-inner"> <a class="header__logo" href="/"> <svg class="_icon-logo-colored"> <use href="/local/templates/main/sprite.svg#logo-colored"></use> </svg> </a> <div class="flex gap-48 items-center"> <div class="flex gap-40 hidden-md"> <a class="header__main-link js-menu__main-link" href="/university">Университет</a> <a class="header__main-link js-menu__main-link" href="/for-applicants/">Поступающим</a> <a class="header__main-link js-menu__main-link" href="/for-students/">Студентам</a> <a class="header__main-link js-menu__main-link" href="/dpo/">Допобразование</a> <a class="header__main-link js-menu__main-link" href="/graduate/">Выпускникам</a> <a class="header__main-link js-menu__main-link" href="/science/">Наука</a> </div><button class="burger-menu" id="js-burger-menu"><span class="burger-menu__icons"><span class="js-burger-open"><svg class="_icon-menu-24"><use href="/local/templates/main/sprite.svg#menu-24"></use></svg></span><span class="js-burger-close"><svg class="_icon-close-24"><use href="/local/templates/main/sprite.svg#close-24"></use></svg></span></span><span class="burger-menu__label">Меню</span></button> </div> </div> </div> </div> </header> <div class="menu" id="js-menu"> <div class="menu__backdrop js-menu__first-level"></div> <div class="menu__image"> <img src="/local/templates/main/images/example-image.jpg" alt="Фон меню" /> </div> <div class="menu-navbar hidden-from-md"> <div class="menu-navbar__icons"> <a class="menu-navbar__link" href="#"><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="menu-navbar__link" href="#"><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <button class="menu-navbar__link js-sp-panel-trigger"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg></button> <a class="menu-navbar__link" href="#">En</a> </div><a class="menu-navbar__link _media" href="#">Медиа</a> </div> <!-- Главное меню --> <div class="container menu__inner"> <div class="menu-tabs hidden-md" data-lenis-prevent="data-lenis-prevent"><button class="menu-tabs__item js-menu-tab__desktop">Университет</button><button class="menu-tabs__item js-menu-tab__desktop">Поступающим</button><button class="menu-tabs__item js-menu-tab__desktop">Студентам</button><button class="menu-tabs__item js-menu-tab__desktop">Выпускникам</button><button class="menu-tabs__item js-menu-tab__desktop">Дополнительное образование</button><button class="menu-tabs__item js-menu-tab__desktop">Наука</button><button class="menu-tabs__item js-menu-tab__desktop">Международная деятельность</button><button class="menu-tabs__item js-menu-tab__desktop">Работникам и соискателям</button></div> <div class="menu-tabs hidden-from-md js-menu__first-level" data-lenis-prevent="data-lenis-prevent"> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Университет</button> <a class="menu-tabs__icon" href="/university/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Поступающим</button> <a class="menu-tabs__icon" href="/for-applicants/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Студентам</button> <a class="menu-tabs__icon" href="/for-students/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Выпускникам</button> <a class="menu-tabs__icon" href="/graduate/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Дополнительное образование</button> <a class="menu-tabs__icon" href="/dpo/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Наука</button> <a class="menu-tabs__icon" href="/science/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Международная деятельность</button> <a class="menu-tabs__icon" href="/international-activity/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Работникам и соискателям</button> <a class="menu-tabs__icon" href="/employee/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> </div> <div class="menu__content-wrapper js-menu__content-wrapper" data-lenis-prevent="data-lenis-prevent"> <button class="ui-button _tertiary _contrast menu__mobile-back js-menu__mobile-back"><span class="ui-button__icon"><svg class="_icon-caret-left-16"><use href="/local/templates/main/sprite.svg#caret-left-16"></use></svg></span>Назад</button> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/university/"><span class="text-h3 text-contrast">Университет</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Университет</h4> <a class="menu__link" href="/university/basic-information/">Основные сведения</a> <a class="menu__link" href="/university/structure/rectorate/">Руководство</a> <a class="menu__link" href="/university/structure/">Организационная структура</a> <a class="menu__link" href="/university/rating/">Университет в рейтингах</a> <a class="menu__link" href="https://www.fa.ru/university/history/">История Финансового университета</a> <a class="menu__link" href="/university/structure/university/museum/">Музей Финансового университета</a> <a class="menu__link" href="/university/structure/university/usr/social-projects/">Социальные проекты</a> <a class="menu__link" href="/university/programm/">Программа развития</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/branches/">Филиалы</a> <a class="menu__link" href="/university/contacts/">Контакты</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/sveden/">Сведения об образовательной организации</a> <a class="menu__link" href="/university/uchenyy-sovet/">Ученый совет Финансового университета</a> <a class="menu__link" href="/university/psovet/">Попечительский совет</a> <a class="menu__link" href="/university/epb/">Единая правовая база</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/anticorruption/">Противодействие коррупции</a> <a class="menu__link" href="/university/antiterror/">Антитеррористическая и антиэкстремистская деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-applicants/"><span class="text-h3 text-contrast">Поступающим</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/bachelor/">Бакалавриат и специалитет</a> <a class="menu__link" href="/for-applicants/master/">Магистратура</a> <a class="menu__link" href="/for-applicants/postgraduate/">Аспирантура</a> <a class="menu__link" href="/science/doctoral/">Докторантура</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/second-degree/">Второе высшее образование</a> <a class="menu__link" href="/for-applicants/distance-education/">Дистанционное образование</a> <a class="menu__link" href="/for-applicants/transfers/">Переводы и восстановления</a> <a class="menu__link" href="/dpo/">Дополнительное образование</a> <a class="menu__link" href="/international-activity/">Обучение за рубежом</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-students/"><span class="text-h3 text-contrast">Студентам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Сервисы</h4> <a class="menu__link" href="https://org.fa.ru/">Личный кабинет студента</a> <a class="menu__link" href="https://online.fa.ru/">Открытая онлайн-академия</a> <a class="menu__link" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="http://www.library.fa.ru">Библиотека</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="https://en.fa.ru/for-students/">Иностранным студентам</a> <a class="menu__link" href="/for-students/oplata/">Оплата обучения и общежития</a> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="menu__link" href="/for-students/free/">Переход с платного обучения на бесплатное</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/graduate/"><span class="text-h3 text-contrast">Выпускникам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/alumni/">Ассоциация выпускников Финуниверситета</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/foundation/">Эндаумент-фонд</a> <a class="menu__link" href="/graduate/#block-28040">Сервисы для выпускников</a> <a class="menu__link" href="https://endowmentfa.ru/donate">Стать дарителем</a> <a class="menu__link" href="https://www.fa.ru/graduate/alumni-meeting-conference/">Конференция-встреча выпускников Финансового университета</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/mentoring/">Наставничество</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/PolPred/">Полномочный Представитель</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/dpo/"><span class="text-h3 text-contrast">Дополнительное образование</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Подразделения ДПО</h4> <a class="menu__link" href="/university/structure/dpo/vsgz/">Высшая школа государственных закупок</a> <a class="menu__link" href="/university/structure/dpo/vsl/">Высшая школа логистики</a> <a class="menu__link" href="/university/structure/dpo/vsmt/">Высшая школа менеджмента и технологий</a> <a class="menu__link" href="/university/structure/dpo/vsugmf/">Высшая школа управления государственными и муниципальными финансами</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/vsp/">Высшая школа предпринимательства</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Институт корпоративного обучения</a> <a class="menu__link" href="/university/structure/dpo/irpkk/">Институт развития профессиональных компетенций и квалификаций</a> <a class="menu__link" href="/university/structure/dpo/ifm/">Институт финансового менеджмента</a> <a class="menu__link" href="/university/structure/dpo/ifg/">Институт финансовой грамотности</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/ipks/">Институт повышения квалификации специалистов</a> <a class="menu__link" href="/university/structure/dpo/msb/">Международная школа бизнеса (Институт)</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/business-school/">Бизнес-школа Финуниверситета (Институт)</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/dpo/crdo/">Центр развития дополнительного образования</a> <a class="menu__link" href="/university/structure/dpo/podpo/">Центр «Проектный офис ДПО»</a> <a class="menu__link" href="/university/structure/educational-departments/dep/dapk/ciys/">Центр инновационных образовательных и языковых стратегий</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/ff/cnfo/">Центр непрерывного финансового образования Финансового факультета</a> <a class="menu__link" href="/university/structure/dpo/ce/">Центр компетенций "Цифровая экономика"</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/nna/">Кафедра налогов и налогового администрирования</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/meo/iymk/">Кафедра иностранных языков и межкультурной коммуникации</a> <a class="menu__link" href="/university/structure/dpo/rukovodstvodpo/">Руководство ДПО</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/science/"><span class="text-h3 text-contrast">Наука</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная деятельность</h4> <a class="menu__link" href="/science/basic-science/">Фундаментальная наука</a> <a class="menu__link" href="/science/applied-research/">Прикладные исследования</a> <a class="menu__link" href="/university/structure/science/rnj/#block-2642">Журналы Финуниверситета</a> <a class="menu__link" href="/university/structure/education/upo/clusters/">Научно-образовательные кластеры</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Научная инфраструктура</h4> <a class="menu__link" href="/science/research-departments/">Научно-исследовательские подразделения</a> <a class="menu__link" href="/university/structure/science/osni/">Дирекция по организационному сопровождению научных исследований</a> <a class="menu__link" href="/university/structure/science/uoonir/">Группа планирования и мониторинга научной деятельности</a> <a class="menu__link" href="for-students/student-science/nso/">Научное студенческое общество</a> <a class="menu__link" href="/for-students/student-science/council-young-scientists/">Совет молодых ученых</a> <a class="menu__link" href="/university/structure/science/rnj/">Редакция научных журналов</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная аттестация</h4> <a class="menu__link" href="/university/structure/science/uank/">Управление аттестации научных кадров</a> <a class="menu__link" href="/university/structure/science/uank/dsfu/">Диссертационные советы Финансового университета</a> <a class="menu__link" href="/university/structure/science/uank/pd/">Перечень документов для представления в диссертационный совет</a> <a class="menu__link" href="https://www.fa.ru/dissertations/autorefs/">Объявления о защите диссертаций</a> <a class="menu__link" href="https://www.fa.ru/science/nak/">Научно-аттестационная комиссия Финансового Университета</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Экспертно-аналитическая деятельность</h4> <a class="menu__link" href="https://www.fa.ru/science/expert-analytical-activities/">Экспертно-аналитическая деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/international-activity/"><span class="text-h3 text-contrast">Международная деятельность</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Студентам</h4> <a class="menu__link" href="/international-activity/included-education/">Включенное обучение</a> <a class="menu__link" href="/international-activity/two-dip/">Программы двух дипломов</a> <a class="menu__link" href="/international-activity/programs/">Краткосрочные программы</a> <a class="menu__link" href="/international-activity/grants/">Стипендии и гранты</a> <a class="menu__link" href="/international-activity/russiansummerschool/">Летняя школа русского языка и культуры в Финансовом университете</a> <a class="menu__link" href="/international-activity/exchange/">Программы обмена (для иностранных студентов)</a> <a class="menu__link" href="/international-activity/help/">Справки и транскрипт</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Выпускникам</h4> <a class="menu__link" href="/international-activity/european/">Приложение к диплому</a> <a class="menu__link" href="/international-activity/diplom/">Подтверждение диплома за рубежом</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Преподавателям</h4> <a class="menu__link" href="/international-activity/projects/">Международные проекты</a> <a class="menu__link" href="/international-activity/abroad/">Академическая мобильность работников и командирование за рубеж</a> <a class="menu__link" href="/international-activity/professor/">Программа «Приглашенный профессор»</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Партнерам</h4> <a class="menu__link" href="/international-activity/partnership/">Зарубежное партнерство</a> <a class="menu__link" href="https://www.fa.ru/international-activity/associations/">Международные ассоциации и сетевые университеты</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/employee/"><span class="text-h3 text-contrast">Работникам и соискателям</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/employee/vacancy/">Вакансии и конкурсы НПР</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Корпоративное обучение</a> <a class="menu__link" href="/employee/couching/">Наставничество</a> <a class="menu__link" href="/university/epb/82">Документы по управлению персоналом и работе с кадрами</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> <a class="menu__link" href="https://www.fa.ru/university/employee/">Наши работники</a> </div> <div class="menu__links"> </div> </div> <div class="menu__links-column"> <div class="menu__links"> </div> </div> </div> </div> </div> </div> <!-- /Главное меню --> </div> <!-- Наши сайты --> <div class="menu-sites" id="js-menu-sites"> <div class="menu-sites__backdrop js-menu-sites"></div> <div class="menu-sites__wrapper"> <div class="container"> <div class="menu-sites__inner js-menu-sites__content-wrapper"><button class="ui-icon-button _secondary menu-sites__button" id="js-menu-sites-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-20"> <use href="/local/templates/main/sprite.svg#close-20"></use> </svg></button> <div class="ui-tabs js-tabs"> <div class="ui-tabs__control js-tabs-control"> <button class="ui-tab" type="button" data-index="0"><span class="ui-tab__label">Филиалы</span></button> <button class="ui-tab" type="button" data-index="1"><span class="ui-tab__label">Колледжи Москвы</span></button> <button class="ui-tab" type="button" data-index="2"><span class="ui-tab__label">Ресурсы университета</span></button> <button class="ui-tab" type="button" data-index="3"><span class="ui-tab__label">Подразделения</span></button> <button class="ui-tab" type="button" data-index="4"><span class="ui-tab__label">Дополнительное образование</span></button> </div> <div class="ui-tabs__content js-tabs-content"> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://altai.fa.ru/" target="_blank"> <span class="ui-links__link">Алтайский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladik.fa.ru/" target="_blank"> <span class="ui-links__link">Владикавказский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladimir.fa.ru/" target="_blank"> <span class="ui-links__link">Владимирский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kaluga.fa.ru/" target="_blank"> <span class="ui-links__link">Калужский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnodar.fa.ru/" target="_blank"> <span class="ui-links__link">Краснодарский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kursk.fa.ru/" target="_blank"> <span class="ui-links__link">Курский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lipetsk.fa.ru/" target="_blank"> <span class="ui-links__link">Липецкий филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://novoross.fa.ru/" target="_blank"> <span class="ui-links__link">Новороссийский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://omsk.fa.ru/" target="_blank"> <span class="ui-links__link">Омский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://orel.fa.ru/" target="_blank"> <span class="ui-links__link">Орловский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://penza.fa.ru/" target="_blank"> <span class="ui-links__link">Пензенский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://spb.fa.ru/" target="_blank"> <span class="ui-links__link">Санкт-Петербургский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://smolensk.fa.ru/" target="_blank"> <span class="ui-links__link">Смоленский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://tula.fa.ru/" target="_blank"> <span class="ui-links__link">Тульский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://chelyabinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Уральский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://ufa.fa.ru/" target="_blank"> <span class="ui-links__link">Уфимский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://yaroslavl.fa.ru/" target="_blank"> <span class="ui-links__link">Ярославский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://blagov.fa.ru/" target="_blank"> <span class="ui-links__link">Благовещенский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://buzuluk.fa.ru/" target="_blank"> <span class="ui-links__link">Бузулукский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://zvenigorod.fa.ru/" target="_blank"> <span class="ui-links__link">Звенигородский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kanash.fa.ru/" target="_blank"> <span class="ui-links__link">Канашский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnoyarsk.fa.ru/" target="_blank"> <span class="ui-links__link">Красноярский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mahachkala.fa.ru/" target="_blank"> <span class="ui-links__link">Махачкалинский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://perm.fa.ru/" target="_blank"> <span class="ui-links__link">Пермский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://samara.fa.ru/" target="_blank"> <span class="ui-links__link">Самарский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://surgut.fa.ru/" target="_blank"> <span class="ui-links__link">Сургутский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://shadrinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Шадринский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kip.fa.ru" target="_blank"> <span class="ui-links__link">Колледж информатики и программирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mfc.fa.ru" target="_blank"> <span class="ui-links__link">Московский финансовый колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://anketa.fa.ru/" target="_blank"> <span class="ui-links__link">Личный кабинет поступающего / слушателя</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://podku.fa.ru/" target="_blank"> <span class="ui-links__link">Подготовительные курсы Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://org.fa.ru/app/kk/dpp/programs" target="_blank"> <span class="ui-links__link">Корпоративное обучение</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pay.fa.ru" target="_blank"> <span class="ui-links__link">Все ссылки на оплату, Москва и филиалы</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://forum.fa.ru/" target="_blank"> <span class="ui-links__link">Международный форум Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://edu.fa.ru/" target="_blank"> <span class="ui-links__link">Дополнительное образование</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://business.fa.ru/" target="_blank"> <span class="ui-links__link">Предпринимательский клуб Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pirsocenter.ru/foresight2025" target="_blank"> <span class="ui-links__link">Форсайт образования</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lesnoe.fa.ru/" target="_blank"> <span class="ui-links__link">Учебно-оздоровительный комплекс «Лесное озеро»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://career.fa.ru/" target="_blank"> <span class="ui-links__link">Центр карьеры</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://online.fa.ru" target="_blank"> <span class="ui-links__link">Открытая онлайн-академия</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsgz/" target="_blank"> <span class="ui-links__link">Высшая школа государственных закупок</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsl/" target="_blank"> <span class="ui-links__link">Высшая школа логистики</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsmt/" target="_blank"> <span class="ui-links__link">Высшая школа менеджмента и технологий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsugmf/" target="_blank"> <span class="ui-links__link">Высшая школа управления государственными и муниципальными финансами</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ipk/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации и профессиональной переподготовки работников</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/irpkk/" target="_blank"> <span class="ui-links__link">Институт развития профессиональных компетенций и квалификаций</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifm/" target="_blank"> <span class="ui-links__link">Институт финансового менеджмента</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifg/" target="_blank"> <span class="ui-links__link">Институт финансовой грамотности</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/msb/" target="_blank"> <span class="ui-links__link">Международная школа бизнеса (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/business-school/" target="_blank"> <span class="ui-links__link">Бизнес-школа Финуниверситета (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/vsp/" target="_blank"> <span class="ui-links__link">Высшая школа предпринимательства</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/ipks/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации специалистов</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/nna/" target="_blank"> <span class="ui-links__link">Кафедра налогов и налогового администрирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/educational-departments/dep/dapk/ciys/" target="_blank"> <span class="ui-links__link">Центр инновационных образовательных и языковых стратегий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/meo/iymk/" target="_blank"> <span class="ui-links__link">Кафедра иностранных языков и межкультурной коммуникации</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/vsu/gcp/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Государственно-частное партнерство»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/ff/izkifi/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Ипотечное жилищное кредитование и финансовые инструменты рынка недвижимости»</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /Наши сайты --> <main id="app"><div class="not-found"> <div class="container"> <div class="not-found__content"> <p class="not-found__404">404</p> <h1 class="not-found__title">Страница не найдена</h1> <p class="not-found__desc">К сожалению, такой страницы не существует. Попробуйте изменить запрос или перейти на главную страницу</p><a class="ui-button _primary _icon-arrow" href="/">Перейти на главную<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a> </div> </div> <div class="not-found__bg"> <img src="/local/templates/main/images/bg-404.png" alt="Картинка заднего фона" /></div> </div></main> <div class="filter-popup" id="date-filter-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-block-response.html" hx-trigger="submit delay:300ms" hx-target="#event-block"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-events-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-response.html" hx-trigger="submit delay:300ms" hx-target="#events"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use /local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-year-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать год</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter" data-year="data-year"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/project-block-response.html" hx-trigger="submit delay:300ms" hx-target="#project-block"> <div class="datepicker js-datepicker-filter _filter"><input name="year" placeholder="Выбрать год" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button _year"><input type="radio" checked="checked" name="filter" value="all" /><label>Все<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="research" /><label>Научные исследования<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="development" /><label>Разработки<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="container"> <div class="button-up"><button class="ui-button _tertiary" id="js-scroll-to-top-button">Наверх<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-16"><use href="/local/templates/main/sprite.svg#arrow-up-16"></use></svg></span></button></div> </div> <!-- Useful-links block --> <div class="useful-links js-useful-links"><button class="useful-links__trigger js-useful-links__trigger"><span class="container"><span class="useful-links__trigger-inner"><span class="useful-links__label">Полезные ссылки</span><span class="useful-links__icon"><svg class="_icon-caret-down-16"><use href="/local/templates/main/sprite.svg#caret-down-16"></use></svg></span></span></span></button> <div class="container"> <div class="useful-links__content js-useful-links__content"> <div class="useful-links__content-inner"> <a class="useful-links__link" target="_blank" href="https://edu.fa.ru/">Информационно-образовательный портал</a> <a class="useful-links__link" target="_blank" href="https://anketa.fa.ru/">Личный кабинет поступающего</a> <a class="useful-links__link" target="_blank" href="http://www.library.fa.ru/">Библиотечно-информационный комплекс</a> <a class="useful-links__link" target="_blank" href="https://pay.fa.ru/moscow/">Оплата обучения</a> <a class="useful-links__link" target="_blank" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="useful-links__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="useful-links__link" href="/university/contacts/">Официальный адрес электронной почты</a> <a class="useful-links__link" href="/university/structure/university/sitp/">ИТ-поддержка</a> <a class="useful-links__link" target="_blank" href="https://edu.gov.ru/">Министерство просвещения РФ</a> <a class="useful-links__link" target="_blank" href="https://minobrnauki.gov.ru/">Министерство науки и высшего образования РФ</a> </div> </div> </div> </div> <!-- End useful-links block --> <footer class="footer"> <div class="container"> <div class="app-grid _cols-1" style="--cols:1;--cols-md:1;--cols-sm:1;--gap:4rem;--gap-md:4rem;--gap-sm:2.4rem;"> <div class="footer__top-section flex justify-between items-center"> <div class="footer__logo"> <svg class="_icon-logo"> <use href="/local/templates/main/sprite.svg#logo"></use> </svg> </div> </div> <div class="footer__section"> <!-- footer address --> <div class="footer__address"><span class="text-body-small">Адрес университета</span><b class="text-body-bold">125167, Москва, пр-кт Ленинградский, д. 49/2</b> <p class="text-body-small">По вопросам, касающимся проведения съемок на территории Финансового университета, присылайте свой запрос в письменном виде в <a href="https://www.fa.ru/university/structure/university/uso/press-service/" style="color:#FFFFFF;">Пресс-службу</a> университета по электронной почте pressa@fa.ru</p> </div> <!-- End footer address --> <!-- footer menu block --> <div class="footer__links-grid hidden-sm"> <a class="footer__link text-button" href="/university/">Университет</a> <a class="footer__link text-button" href="/for-applicants/">Поступающим</a> <a class="footer__link text-button" href="/for-students/">Студентам</a> <a class="footer__link text-button" href="/graduate/">Выпускникам</a> <a class="footer__link text-button" href="/dpo/">Дополнительное образование</a> <a class="footer__link text-button" href="/science/">Наука</a> <a class="footer__link text-button" href="/employee">Работникам и соискателям</a> <a class="footer__link text-button" href="/international-activity/">Международная деятельность</a> <a class="footer__link text-button" href="/university/branches">Филиалы</a> <a class="footer__link text-button" href="/university/services/">Сервисы</a> <a class="footer__link text-button" href="/university/anticorruption/">Противодействие коррупции</a> <a class="footer__link text-button" href="/sveden/">Сведения об образовательной организации</a> <a class="footer__link text-button" target="_blank" href="https://org.fa.ru/">Личный кабинет</a> <a class="footer__link text-button" target="_blank" href="https://lesnoe.fa.ru">Учебно-оздоровительный комплекс «Лесное озеро»</a> <a class="footer__link text-button" href="/university/project/">Проектная деятельность</a> <a class="footer__link text-button" target="_blank" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="footer__link text-button" href="/university/campuscard/">Кампусная карта</a> <a class="footer__link text-button" href="/university/contacts/">Контакты</a> <a class="footer__link text-button" href="/university/structure/university/uso/adogokouo/">Анкета для опроса граждан о качестве оказания услуг организацией</a> <a class="footer__link text-button" target="_blank" href="https://endowmentfa.ru/donate">Стать дарителем</a> </div> <!-- End footer block --> </div> <div class="footer__section"> <!-- socials block --> <div class="footer__socials flex gap-8"> <a class="ui-icon-button _secondary _contrast" href="https://t.me/s/finuniverchan" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-tg-20"> <use href="/local/templates/main/sprite.svg#social-tg-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://vk.com/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-vk-20"> <use href="/local/templates/main/sprite.svg#social-vk-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://max.ru/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-max-20"> <use href="/local/templates/main/sprite.svg#social-max-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://www.youtube.com/channel/UChitH8STbXi2HyYTqXnHSnw" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-youtube-20"> <use href="/local/templates/main/sprite.svg#social-youtube-20"></use> </svg> </a> </div> <!-- socials block --> <!-- contacts block --> <div class="app-grid _cols-3" style="--cols:3;--cols-md:3;--cols-sm:1;--gap:3.2rem;--gap-md:3.2rem;--gap-sm:2.4rem;"> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная комиссия</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(495)249-52-49">+7(495)249-52-49</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:priemka@fa.ru">priemka@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Официальный адрес электронной почты</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:"></a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:academy@fa.ru">academy@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная ректора</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(499)943-95-80">+7(499)943-95-80</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:rector@fa.ru">rector@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Для справок по корреспонденции</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 499 943 98 55">+7 499 943 98 55</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:"></a></div> </div> </div> <!-- contacts block --> </div> </div> </div> </footer> <script src="/local/templates/main/js/app.js?1763707713" defer=""></script> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(98905690, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98905690" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(99165694, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/99165694" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(102224032, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/102224032" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103033693, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103033693" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241759, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241759" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241988, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241988" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103325236, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103325236" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript"> (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) })(window, document,'script','https://mc.yandex.ru/metrika/tag.js', 'ym'); ym(98069295, 'init', {webvisor:true, clickmap:true, accurateTrackBounce:true, trackLinks:true}); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98069295" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> </body> </html>Parameter Content-Security-PolicyEvidence frame-ancestors 'self';Solution Убедитесь, что ваш веб-сервер, сервер приложений, балансировщик нагрузки и т. д. правильно настроены для установки заголовка Content-Security-Policy.
-
CSP: Директива подстановочного знака (1)
GET https://www.fa.ru/*/index.php
Alert tags Alert description Политика безопасности контента (CSP) - это дополнительный уровень безопасности, который помогает обнаруживать и смягчать определенные типы атак.
Включая (но не ограничиваясь) межсайтовыми сценариями (XSS) и атаками путем внедрения данных.
Эти атаки используются для всего, от кражи данных до повреждения сайта
или распространения вредоносного ПО.
CSP предоставляет набор стандартных HTTP-заголовков,
которые позволяют владельцам веб-сайтов объявлять утвержденные источники контента,
которые браузерам следует разрешить загружать на эту страницу - охватываемые типы - это JavaScript, CSS, HTML-фреймы, шрифты, изображения и встраиваемые объекты, такие как Java-апплеты, ActiveX, аудио и видео файлы.
Other info The following directives either allow wildcard sources (or ancestors), are not defined, or are overly broadly defined:
script-src, style-src, img-src, connect-src, frame-src, font-src, media-src, object-src, manifest-src, worker-src
Request Request line and header section (270 bytes)
GET https://www.fa.ru/*/index.php HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/robots.txtRequest body (0 bytes)
Response Status line and header section (612 bytes)
HTTP/1.1 404 Not Found Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:11:22 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 112334 Connection: keep-alive Keep-Alive: timeout=10 Vary: Accept-Encoding Cache-Control: private, max-age=60 X-Frame-Options: SAMEORIGIN Content-Security-Policy: frame-ancestors 'self'; P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA" Set-Cookie: PHPSESSID=Y6I8TCTj8svRPs08Y2kXQ0cLbGuIzuDd; expires=Tue, 16-Dec-2025 13:11:22 GMT; Max-Age=10800; path=/; domain=www.fa.ru; HttpOnly Vary: Accept-EncodingResponse body (112334 bytes)
<!DOCTYPE html> <html lang="ru" id="s1"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="Финансовый университет, поступление, образование, научная деятельность, международное сотрудничество, дополнительное образование, обучение, студенты, абитуриенты, карьера" /> <meta name="description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»" /> <link href="/bitrix/cache/css/s1/main/template_9e0403e4e76a8459f3aa93a1eab92994/template_9e0403e4e76a8459f3aa93a1eab92994_v1.css?1763707797327626" type="text/css" data-template-style="true" rel="stylesheet" /> <meta property="og:type" content="article"> <meta property="og:url" content="https://www.fa.ru/*/"> <meta property="og:description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»"> <meta property="og:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <title>404 Not Found</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><!--if IEmeta(http-equiv='X-UA-Compatible' content='IE=edge')--> <meta property="og:title" content="Финансовый университет при Правительстве РФ | 404 Not Found"/> <!--link(rel='shortcut icon' href='./favicon.png')--><!--link(rel='preload' href='/fonts/.woff2' as='font' crossorigin='' type='font/woff2')--> <!-- <link rel="stylesheet" href="--><!--/css/vendor.css">--> <!-- <link rel="stylesheet" href="--><!--/css/app.css">--> </head> <body hx-ext="multi-swap"> <div class="sp-panel js-sp-panel"> <div class="sp-panel__bg"></div> <div class="sp-panel__container"> <div class="container"> <div class="sp-panel__head"> <p class="sp-panel__title">Версия для слабовидящих</p><button itemprop="copy" class="ui-icon-button _secondary sp-panel__close js-sp-panel-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="sp-panel__content"> <div class="sp-panel__group _text"> <p class="sp-panel__label">Размер текста:</p> <div class="sp-panel__buttons"><button type="button" data-sp-text="normal">A</button><button type="button" data-sp-text="medium">A</button><button type="button" data-sp-text="large">A</button></div> </div> <div class="sp-panel__group _color"> <p class="sp-panel__label">Цветовая схема:</p> <div class="sp-panel__buttons"><button type="button" data-sp-theme="light" title="Обычная">A</button><button type="button" data-sp-theme="dark" title="Темная">A</button><button type="button" data-sp-theme="black" title="Белое на черном">A</button><button type="button" data-sp-theme="white" title="Черное на белом">A</button></div> </div> <div class="sp-panel__group _images"> <p class="sp-panel__label">Изображения:</p> <div><button class="ui-button _tertiary js-sp-panel-img-off" type="button">Отключить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button><button class="ui-button _tertiary js-sp-panel-img-on" type="button">Включить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> <div class="sp-panel__group _reset"><button class="ui-button _secondary js-sp-panel-img-reset">Сбросить настройки<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> </div> </div> </div> <div class="search-popup js-search-popup"> <div class="search-popup__owerlay"></div> <div class="search-popup__container"> <div class="container"> <div class="search-popup__head"> <h2 class="search-popup__title">Поиск по сайту</h2><button class="ui-icon-button _secondary js-search-popup-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="search-popup__search"> <form class="flex gap-16" action="/search/"> <div class="ui-field js-field"> <div class="ui-field__icon"><svg class="_icon-search-24"> <use href="/local/templates/main/sprite.svg#search-24"></use> </svg></div><input class="ui-field__input" type="text" placeholder="Введите ваш запрос" id="ui-field-1" name="q" inputmode="search" /><label class="ui-field__label" for="ui-field-1">Введите ваш запрос</label> </div><button class="ui-button _primary">Поиск<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button> </form> </div> <div class="search-popup__links"> <a href="/search/?q=Подразделения">Подразделения</a> <a href="/search/?q=Кафедры">Кафедры</a> <a href="/search/?q=Магистратура">Магистратура</a> <a href="/search/?q=Дополнительное образование">Дополнительное образование</a> <a href="/search/?q=Поступающим">Поступающим</a> </div> </div> </div> </div> <header class="header " id="js-header"> <div class="container"> <div class="header__row _top"> <div class="header__group"> <button class="header__link _contrast" id="js-menu-sites-button"><svg class="_icon-menu-grid-20"> <use href="/local/templates/main/sprite.svg#menu-grid-20"></use> </svg>Наши сайты</button> <a class="header__link _contrast hidden-sm" href="/university/press-center/">Пресс-центр</a> </div> <div class="flex gap-64 sm-gap-16"> <div class="header__group"> <div class="flex gap-24 sm-gap-16"> <button itemprop="copy" class="header__link hidden-sm js-sp-panel-trigger" type="button"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg><span>Версия для слабовидящих</span></button> </div> <div class="flex gap-24 sm-gap-16"> <a class="header__link _tooltip" href="https://ruz.fa.ru/"> <div class="header__tooltip">Расписание</div><svg class="_icon-calendar-20"> <use href="/local/templates/main/sprite.svg#calendar-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="http://www.library.fa.ru/"> <div class="header__tooltip">Библиотека</div><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="/university/services/"> <div class="header__tooltip">Сервисы</div><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <a class="header__link _tooltip" href="https://org.fa.ru/"> <div class="header__tooltip">Личный кабинет</div><svg class="_icon-user-20"> <use href="/local/templates/main/sprite.svg#user-20"></use> </svg></a> <button class="header__link _tooltip js-search-popup-toggle" type="button"> <div class="header__tooltip">Поиск</div><svg class="_icon-search-20"> <use href="/local/templates/main/sprite.svg#search-20"></use> </svg> </button> <a class="header__link _tooltip" href="https://biz.mail.ru/login/fa.ru"> <div class="header__tooltip">Почта</div><svg class="_icon-mail-20"> <use href="/local/templates/main/sprite.svg#mail-20"></use> </svg> </a> </div><!-- <div class="flex gap-24 sm-gap-16"><a class="header__link" href="#"><svg class="_icon-search-20">--> <!-- <use href="--><!--/sprite.svg#search-20"></use>--> <!-- </svg></a><a class="header__link hidden-sm" href="#"><svg class="_icon-eye-20">--> <!-- <use href="--><!--/sprite.svg#eye-20"></use>--> <!-- </svg></a></div>--> <div class="flex gap-16 hidden-md"> <a class="header__link" href="https://www.fa.ru">Ru</a> <a class="header__link" href="https://en.fa.ru/">En</a> </div> </div><label class="_contrast toggle-theme js-toggle-theme" for="js-toggle-theme"><span class="toggle-theme__light"><svg class="_icon-sun-20"><use href="/local/templates/main/sprite.svg#sun-20"></use></svg></span><span class="toggle-theme__switcher"><input id="js-toggle-theme" type="checkbox" hidden="hidden"/><span class="toggle-theme__flag"></span></span><span class="toggle-theme__dark"><svg class="_icon-moon-20"><use href="/local/templates/main/sprite.svg#moon-20"></use></svg></span></label> </div> </div> <div class="header__row _bottom js-menu__first-level"> <div class="header__row-inner"> <a class="header__logo" href="/"> <svg class="_icon-logo-colored"> <use href="/local/templates/main/sprite.svg#logo-colored"></use> </svg> </a> <div class="flex gap-48 items-center"> <div class="flex gap-40 hidden-md"> <a class="header__main-link js-menu__main-link" href="/university">Университет</a> <a class="header__main-link js-menu__main-link" href="/for-applicants/">Поступающим</a> <a class="header__main-link js-menu__main-link" href="/for-students/">Студентам</a> <a class="header__main-link js-menu__main-link" href="/dpo/">Допобразование</a> <a class="header__main-link js-menu__main-link" href="/graduate/">Выпускникам</a> <a class="header__main-link js-menu__main-link" href="/science/">Наука</a> </div><button class="burger-menu" id="js-burger-menu"><span class="burger-menu__icons"><span class="js-burger-open"><svg class="_icon-menu-24"><use href="/local/templates/main/sprite.svg#menu-24"></use></svg></span><span class="js-burger-close"><svg class="_icon-close-24"><use href="/local/templates/main/sprite.svg#close-24"></use></svg></span></span><span class="burger-menu__label">Меню</span></button> </div> </div> </div> </div> </header> <div class="menu" id="js-menu"> <div class="menu__backdrop js-menu__first-level"></div> <div class="menu__image"> <img src="/local/templates/main/images/example-image.jpg" alt="Фон меню" /> </div> <div class="menu-navbar hidden-from-md"> <div class="menu-navbar__icons"> <a class="menu-navbar__link" href="#"><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="menu-navbar__link" href="#"><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <button class="menu-navbar__link js-sp-panel-trigger"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg></button> <a class="menu-navbar__link" href="#">En</a> </div><a class="menu-navbar__link _media" href="#">Медиа</a> </div> <!-- Главное меню --> <div class="container menu__inner"> <div class="menu-tabs hidden-md" data-lenis-prevent="data-lenis-prevent"><button class="menu-tabs__item js-menu-tab__desktop">Университет</button><button class="menu-tabs__item js-menu-tab__desktop">Поступающим</button><button class="menu-tabs__item js-menu-tab__desktop">Студентам</button><button class="menu-tabs__item js-menu-tab__desktop">Выпускникам</button><button class="menu-tabs__item js-menu-tab__desktop">Дополнительное образование</button><button class="menu-tabs__item js-menu-tab__desktop">Наука</button><button class="menu-tabs__item js-menu-tab__desktop">Международная деятельность</button><button class="menu-tabs__item js-menu-tab__desktop">Работникам и соискателям</button></div> <div class="menu-tabs hidden-from-md js-menu__first-level" data-lenis-prevent="data-lenis-prevent"> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Университет</button> <a class="menu-tabs__icon" href="/university/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Поступающим</button> <a class="menu-tabs__icon" href="/for-applicants/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Студентам</button> <a class="menu-tabs__icon" href="/for-students/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Выпускникам</button> <a class="menu-tabs__icon" href="/graduate/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Дополнительное образование</button> <a class="menu-tabs__icon" href="/dpo/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Наука</button> <a class="menu-tabs__icon" href="/science/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Международная деятельность</button> <a class="menu-tabs__icon" href="/international-activity/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Работникам и соискателям</button> <a class="menu-tabs__icon" href="/employee/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> </div> <div class="menu__content-wrapper js-menu__content-wrapper" data-lenis-prevent="data-lenis-prevent"> <button class="ui-button _tertiary _contrast menu__mobile-back js-menu__mobile-back"><span class="ui-button__icon"><svg class="_icon-caret-left-16"><use href="/local/templates/main/sprite.svg#caret-left-16"></use></svg></span>Назад</button> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/university/"><span class="text-h3 text-contrast">Университет</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Университет</h4> <a class="menu__link" href="/university/basic-information/">Основные сведения</a> <a class="menu__link" href="/university/structure/rectorate/">Руководство</a> <a class="menu__link" href="/university/structure/">Организационная структура</a> <a class="menu__link" href="/university/rating/">Университет в рейтингах</a> <a class="menu__link" href="https://www.fa.ru/university/history/">История Финансового университета</a> <a class="menu__link" href="/university/structure/university/museum/">Музей Финансового университета</a> <a class="menu__link" href="/university/structure/university/usr/social-projects/">Социальные проекты</a> <a class="menu__link" href="/university/programm/">Программа развития</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/branches/">Филиалы</a> <a class="menu__link" href="/university/contacts/">Контакты</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/sveden/">Сведения об образовательной организации</a> <a class="menu__link" href="/university/uchenyy-sovet/">Ученый совет Финансового университета</a> <a class="menu__link" href="/university/psovet/">Попечительский совет</a> <a class="menu__link" href="/university/epb/">Единая правовая база</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/anticorruption/">Противодействие коррупции</a> <a class="menu__link" href="/university/antiterror/">Антитеррористическая и антиэкстремистская деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-applicants/"><span class="text-h3 text-contrast">Поступающим</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/bachelor/">Бакалавриат и специалитет</a> <a class="menu__link" href="/for-applicants/master/">Магистратура</a> <a class="menu__link" href="/for-applicants/postgraduate/">Аспирантура</a> <a class="menu__link" href="/science/doctoral/">Докторантура</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/second-degree/">Второе высшее образование</a> <a class="menu__link" href="/for-applicants/distance-education/">Дистанционное образование</a> <a class="menu__link" href="/for-applicants/transfers/">Переводы и восстановления</a> <a class="menu__link" href="/dpo/">Дополнительное образование</a> <a class="menu__link" href="/international-activity/">Обучение за рубежом</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-students/"><span class="text-h3 text-contrast">Студентам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Сервисы</h4> <a class="menu__link" href="https://org.fa.ru/">Личный кабинет студента</a> <a class="menu__link" href="https://online.fa.ru/">Открытая онлайн-академия</a> <a class="menu__link" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="http://www.library.fa.ru">Библиотека</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="https://en.fa.ru/for-students/">Иностранным студентам</a> <a class="menu__link" href="/for-students/oplata/">Оплата обучения и общежития</a> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="menu__link" href="/for-students/free/">Переход с платного обучения на бесплатное</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/graduate/"><span class="text-h3 text-contrast">Выпускникам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/alumni/">Ассоциация выпускников Финуниверситета</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/foundation/">Эндаумент-фонд</a> <a class="menu__link" href="/graduate/#block-28040">Сервисы для выпускников</a> <a class="menu__link" href="https://endowmentfa.ru/donate">Стать дарителем</a> <a class="menu__link" href="https://www.fa.ru/graduate/alumni-meeting-conference/">Конференция-встреча выпускников Финансового университета</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/mentoring/">Наставничество</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/PolPred/">Полномочный Представитель</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/dpo/"><span class="text-h3 text-contrast">Дополнительное образование</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Подразделения ДПО</h4> <a class="menu__link" href="/university/structure/dpo/vsgz/">Высшая школа государственных закупок</a> <a class="menu__link" href="/university/structure/dpo/vsl/">Высшая школа логистики</a> <a class="menu__link" href="/university/structure/dpo/vsmt/">Высшая школа менеджмента и технологий</a> <a class="menu__link" href="/university/structure/dpo/vsugmf/">Высшая школа управления государственными и муниципальными финансами</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/vsp/">Высшая школа предпринимательства</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Институт корпоративного обучения</a> <a class="menu__link" href="/university/structure/dpo/irpkk/">Институт развития профессиональных компетенций и квалификаций</a> <a class="menu__link" href="/university/structure/dpo/ifm/">Институт финансового менеджмента</a> <a class="menu__link" href="/university/structure/dpo/ifg/">Институт финансовой грамотности</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/ipks/">Институт повышения квалификации специалистов</a> <a class="menu__link" href="/university/structure/dpo/msb/">Международная школа бизнеса (Институт)</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/business-school/">Бизнес-школа Финуниверситета (Институт)</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/dpo/crdo/">Центр развития дополнительного образования</a> <a class="menu__link" href="/university/structure/dpo/podpo/">Центр «Проектный офис ДПО»</a> <a class="menu__link" href="/university/structure/educational-departments/dep/dapk/ciys/">Центр инновационных образовательных и языковых стратегий</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/ff/cnfo/">Центр непрерывного финансового образования Финансового факультета</a> <a class="menu__link" href="/university/structure/dpo/ce/">Центр компетенций "Цифровая экономика"</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/nna/">Кафедра налогов и налогового администрирования</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/meo/iymk/">Кафедра иностранных языков и межкультурной коммуникации</a> <a class="menu__link" href="/university/structure/dpo/rukovodstvodpo/">Руководство ДПО</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/science/"><span class="text-h3 text-contrast">Наука</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная деятельность</h4> <a class="menu__link" href="/science/basic-science/">Фундаментальная наука</a> <a class="menu__link" href="/science/applied-research/">Прикладные исследования</a> <a class="menu__link" href="/university/structure/science/rnj/#block-2642">Журналы Финуниверситета</a> <a class="menu__link" href="/university/structure/education/upo/clusters/">Научно-образовательные кластеры</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Научная инфраструктура</h4> <a class="menu__link" href="/science/research-departments/">Научно-исследовательские подразделения</a> <a class="menu__link" href="/university/structure/science/osni/">Дирекция по организационному сопровождению научных исследований</a> <a class="menu__link" href="/university/structure/science/uoonir/">Группа планирования и мониторинга научной деятельности</a> <a class="menu__link" href="for-students/student-science/nso/">Научное студенческое общество</a> <a class="menu__link" href="/for-students/student-science/council-young-scientists/">Совет молодых ученых</a> <a class="menu__link" href="/university/structure/science/rnj/">Редакция научных журналов</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная аттестация</h4> <a class="menu__link" href="/university/structure/science/uank/">Управление аттестации научных кадров</a> <a class="menu__link" href="/university/structure/science/uank/dsfu/">Диссертационные советы Финансового университета</a> <a class="menu__link" href="/university/structure/science/uank/pd/">Перечень документов для представления в диссертационный совет</a> <a class="menu__link" href="https://www.fa.ru/dissertations/autorefs/">Объявления о защите диссертаций</a> <a class="menu__link" href="https://www.fa.ru/science/nak/">Научно-аттестационная комиссия Финансового Университета</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Экспертно-аналитическая деятельность</h4> <a class="menu__link" href="https://www.fa.ru/science/expert-analytical-activities/">Экспертно-аналитическая деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/international-activity/"><span class="text-h3 text-contrast">Международная деятельность</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Студентам</h4> <a class="menu__link" href="/international-activity/included-education/">Включенное обучение</a> <a class="menu__link" href="/international-activity/two-dip/">Программы двух дипломов</a> <a class="menu__link" href="/international-activity/programs/">Краткосрочные программы</a> <a class="menu__link" href="/international-activity/grants/">Стипендии и гранты</a> <a class="menu__link" href="/international-activity/russiansummerschool/">Летняя школа русского языка и культуры в Финансовом университете</a> <a class="menu__link" href="/international-activity/exchange/">Программы обмена (для иностранных студентов)</a> <a class="menu__link" href="/international-activity/help/">Справки и транскрипт</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Выпускникам</h4> <a class="menu__link" href="/international-activity/european/">Приложение к диплому</a> <a class="menu__link" href="/international-activity/diplom/">Подтверждение диплома за рубежом</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Преподавателям</h4> <a class="menu__link" href="/international-activity/projects/">Международные проекты</a> <a class="menu__link" href="/international-activity/abroad/">Академическая мобильность работников и командирование за рубеж</a> <a class="menu__link" href="/international-activity/professor/">Программа «Приглашенный профессор»</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Партнерам</h4> <a class="menu__link" href="/international-activity/partnership/">Зарубежное партнерство</a> <a class="menu__link" href="https://www.fa.ru/international-activity/associations/">Международные ассоциации и сетевые университеты</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/employee/"><span class="text-h3 text-contrast">Работникам и соискателям</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/employee/vacancy/">Вакансии и конкурсы НПР</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Корпоративное обучение</a> <a class="menu__link" href="/employee/couching/">Наставничество</a> <a class="menu__link" href="/university/epb/82">Документы по управлению персоналом и работе с кадрами</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> <a class="menu__link" href="https://www.fa.ru/university/employee/">Наши работники</a> </div> <div class="menu__links"> </div> </div> <div class="menu__links-column"> <div class="menu__links"> </div> </div> </div> </div> </div> </div> <!-- /Главное меню --> </div> <!-- Наши сайты --> <div class="menu-sites" id="js-menu-sites"> <div class="menu-sites__backdrop js-menu-sites"></div> <div class="menu-sites__wrapper"> <div class="container"> <div class="menu-sites__inner js-menu-sites__content-wrapper"><button class="ui-icon-button _secondary menu-sites__button" id="js-menu-sites-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-20"> <use href="/local/templates/main/sprite.svg#close-20"></use> </svg></button> <div class="ui-tabs js-tabs"> <div class="ui-tabs__control js-tabs-control"> <button class="ui-tab" type="button" data-index="0"><span class="ui-tab__label">Филиалы</span></button> <button class="ui-tab" type="button" data-index="1"><span class="ui-tab__label">Колледжи Москвы</span></button> <button class="ui-tab" type="button" data-index="2"><span class="ui-tab__label">Ресурсы университета</span></button> <button class="ui-tab" type="button" data-index="3"><span class="ui-tab__label">Подразделения</span></button> <button class="ui-tab" type="button" data-index="4"><span class="ui-tab__label">Дополнительное образование</span></button> </div> <div class="ui-tabs__content js-tabs-content"> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://altai.fa.ru/" target="_blank"> <span class="ui-links__link">Алтайский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladik.fa.ru/" target="_blank"> <span class="ui-links__link">Владикавказский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladimir.fa.ru/" target="_blank"> <span class="ui-links__link">Владимирский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kaluga.fa.ru/" target="_blank"> <span class="ui-links__link">Калужский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnodar.fa.ru/" target="_blank"> <span class="ui-links__link">Краснодарский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kursk.fa.ru/" target="_blank"> <span class="ui-links__link">Курский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lipetsk.fa.ru/" target="_blank"> <span class="ui-links__link">Липецкий филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://novoross.fa.ru/" target="_blank"> <span class="ui-links__link">Новороссийский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://omsk.fa.ru/" target="_blank"> <span class="ui-links__link">Омский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://orel.fa.ru/" target="_blank"> <span class="ui-links__link">Орловский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://penza.fa.ru/" target="_blank"> <span class="ui-links__link">Пензенский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://spb.fa.ru/" target="_blank"> <span class="ui-links__link">Санкт-Петербургский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://smolensk.fa.ru/" target="_blank"> <span class="ui-links__link">Смоленский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://tula.fa.ru/" target="_blank"> <span class="ui-links__link">Тульский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://chelyabinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Уральский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://ufa.fa.ru/" target="_blank"> <span class="ui-links__link">Уфимский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://yaroslavl.fa.ru/" target="_blank"> <span class="ui-links__link">Ярославский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://blagov.fa.ru/" target="_blank"> <span class="ui-links__link">Благовещенский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://buzuluk.fa.ru/" target="_blank"> <span class="ui-links__link">Бузулукский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://zvenigorod.fa.ru/" target="_blank"> <span class="ui-links__link">Звенигородский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kanash.fa.ru/" target="_blank"> <span class="ui-links__link">Канашский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnoyarsk.fa.ru/" target="_blank"> <span class="ui-links__link">Красноярский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mahachkala.fa.ru/" target="_blank"> <span class="ui-links__link">Махачкалинский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://perm.fa.ru/" target="_blank"> <span class="ui-links__link">Пермский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://samara.fa.ru/" target="_blank"> <span class="ui-links__link">Самарский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://surgut.fa.ru/" target="_blank"> <span class="ui-links__link">Сургутский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://shadrinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Шадринский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kip.fa.ru" target="_blank"> <span class="ui-links__link">Колледж информатики и программирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mfc.fa.ru" target="_blank"> <span class="ui-links__link">Московский финансовый колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://anketa.fa.ru/" target="_blank"> <span class="ui-links__link">Личный кабинет поступающего / слушателя</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://podku.fa.ru/" target="_blank"> <span class="ui-links__link">Подготовительные курсы Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://org.fa.ru/app/kk/dpp/programs" target="_blank"> <span class="ui-links__link">Корпоративное обучение</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pay.fa.ru" target="_blank"> <span class="ui-links__link">Все ссылки на оплату, Москва и филиалы</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://forum.fa.ru/" target="_blank"> <span class="ui-links__link">Международный форум Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://edu.fa.ru/" target="_blank"> <span class="ui-links__link">Дополнительное образование</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://business.fa.ru/" target="_blank"> <span class="ui-links__link">Предпринимательский клуб Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pirsocenter.ru/foresight2025" target="_blank"> <span class="ui-links__link">Форсайт образования</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lesnoe.fa.ru/" target="_blank"> <span class="ui-links__link">Учебно-оздоровительный комплекс «Лесное озеро»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://career.fa.ru/" target="_blank"> <span class="ui-links__link">Центр карьеры</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://online.fa.ru" target="_blank"> <span class="ui-links__link">Открытая онлайн-академия</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsgz/" target="_blank"> <span class="ui-links__link">Высшая школа государственных закупок</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsl/" target="_blank"> <span class="ui-links__link">Высшая школа логистики</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsmt/" target="_blank"> <span class="ui-links__link">Высшая школа менеджмента и технологий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsugmf/" target="_blank"> <span class="ui-links__link">Высшая школа управления государственными и муниципальными финансами</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ipk/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации и профессиональной переподготовки работников</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/irpkk/" target="_blank"> <span class="ui-links__link">Институт развития профессиональных компетенций и квалификаций</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifm/" target="_blank"> <span class="ui-links__link">Институт финансового менеджмента</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifg/" target="_blank"> <span class="ui-links__link">Институт финансовой грамотности</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/msb/" target="_blank"> <span class="ui-links__link">Международная школа бизнеса (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/business-school/" target="_blank"> <span class="ui-links__link">Бизнес-школа Финуниверситета (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/vsp/" target="_blank"> <span class="ui-links__link">Высшая школа предпринимательства</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/ipks/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации специалистов</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/nna/" target="_blank"> <span class="ui-links__link">Кафедра налогов и налогового администрирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/educational-departments/dep/dapk/ciys/" target="_blank"> <span class="ui-links__link">Центр инновационных образовательных и языковых стратегий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/meo/iymk/" target="_blank"> <span class="ui-links__link">Кафедра иностранных языков и межкультурной коммуникации</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/vsu/gcp/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Государственно-частное партнерство»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/ff/izkifi/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Ипотечное жилищное кредитование и финансовые инструменты рынка недвижимости»</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /Наши сайты --> <main id="app"><div class="not-found"> <div class="container"> <div class="not-found__content"> <p class="not-found__404">404</p> <h1 class="not-found__title">Страница не найдена</h1> <p class="not-found__desc">К сожалению, такой страницы не существует. Попробуйте изменить запрос или перейти на главную страницу</p><a class="ui-button _primary _icon-arrow" href="/">Перейти на главную<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a> </div> </div> <div class="not-found__bg"> <img src="/local/templates/main/images/bg-404.png" alt="Картинка заднего фона" /></div> </div></main> <div class="filter-popup" id="date-filter-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-block-response.html" hx-trigger="submit delay:300ms" hx-target="#event-block"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-events-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-response.html" hx-trigger="submit delay:300ms" hx-target="#events"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use /local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-year-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать год</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter" data-year="data-year"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/project-block-response.html" hx-trigger="submit delay:300ms" hx-target="#project-block"> <div class="datepicker js-datepicker-filter _filter"><input name="year" placeholder="Выбрать год" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button _year"><input type="radio" checked="checked" name="filter" value="all" /><label>Все<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="research" /><label>Научные исследования<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="development" /><label>Разработки<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="container"> <div class="button-up"><button class="ui-button _tertiary" id="js-scroll-to-top-button">Наверх<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-16"><use href="/local/templates/main/sprite.svg#arrow-up-16"></use></svg></span></button></div> </div> <!-- Useful-links block --> <div class="useful-links js-useful-links"><button class="useful-links__trigger js-useful-links__trigger"><span class="container"><span class="useful-links__trigger-inner"><span class="useful-links__label">Полезные ссылки</span><span class="useful-links__icon"><svg class="_icon-caret-down-16"><use href="/local/templates/main/sprite.svg#caret-down-16"></use></svg></span></span></span></button> <div class="container"> <div class="useful-links__content js-useful-links__content"> <div class="useful-links__content-inner"> <a class="useful-links__link" target="_blank" href="https://edu.fa.ru/">Информационно-образовательный портал</a> <a class="useful-links__link" target="_blank" href="https://anketa.fa.ru/">Личный кабинет поступающего</a> <a class="useful-links__link" target="_blank" href="http://www.library.fa.ru/">Библиотечно-информационный комплекс</a> <a class="useful-links__link" target="_blank" href="https://pay.fa.ru/moscow/">Оплата обучения</a> <a class="useful-links__link" target="_blank" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="useful-links__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="useful-links__link" href="/university/contacts/">Официальный адрес электронной почты</a> <a class="useful-links__link" href="/university/structure/university/sitp/">ИТ-поддержка</a> <a class="useful-links__link" target="_blank" href="https://edu.gov.ru/">Министерство просвещения РФ</a> <a class="useful-links__link" target="_blank" href="https://minobrnauki.gov.ru/">Министерство науки и высшего образования РФ</a> </div> </div> </div> </div> <!-- End useful-links block --> <footer class="footer"> <div class="container"> <div class="app-grid _cols-1" style="--cols:1;--cols-md:1;--cols-sm:1;--gap:4rem;--gap-md:4rem;--gap-sm:2.4rem;"> <div class="footer__top-section flex justify-between items-center"> <div class="footer__logo"> <svg class="_icon-logo"> <use href="/local/templates/main/sprite.svg#logo"></use> </svg> </div> </div> <div class="footer__section"> <!-- footer address --> <div class="footer__address"><span class="text-body-small">Адрес университета</span><b class="text-body-bold">125167, Москва, пр-кт Ленинградский, д. 49/2</b> <p class="text-body-small">По вопросам, касающимся проведения съемок на территории Финансового университета, присылайте свой запрос в письменном виде в <a href="https://www.fa.ru/university/structure/university/uso/press-service/" style="color:#FFFFFF;">Пресс-службу</a> университета по электронной почте pressa@fa.ru</p> </div> <!-- End footer address --> <!-- footer menu block --> <div class="footer__links-grid hidden-sm"> <a class="footer__link text-button" href="/university/">Университет</a> <a class="footer__link text-button" href="/for-applicants/">Поступающим</a> <a class="footer__link text-button" href="/for-students/">Студентам</a> <a class="footer__link text-button" href="/graduate/">Выпускникам</a> <a class="footer__link text-button" href="/dpo/">Дополнительное образование</a> <a class="footer__link text-button" href="/science/">Наука</a> <a class="footer__link text-button" href="/employee">Работникам и соискателям</a> <a class="footer__link text-button" href="/international-activity/">Международная деятельность</a> <a class="footer__link text-button" href="/university/branches">Филиалы</a> <a class="footer__link text-button" href="/university/services/">Сервисы</a> <a class="footer__link text-button" href="/university/anticorruption/">Противодействие коррупции</a> <a class="footer__link text-button" href="/sveden/">Сведения об образовательной организации</a> <a class="footer__link text-button" target="_blank" href="https://org.fa.ru/">Личный кабинет</a> <a class="footer__link text-button" target="_blank" href="https://lesnoe.fa.ru">Учебно-оздоровительный комплекс «Лесное озеро»</a> <a class="footer__link text-button" href="/university/project/">Проектная деятельность</a> <a class="footer__link text-button" target="_blank" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="footer__link text-button" href="/university/campuscard/">Кампусная карта</a> <a class="footer__link text-button" href="/university/contacts/">Контакты</a> <a class="footer__link text-button" href="/university/structure/university/uso/adogokouo/">Анкета для опроса граждан о качестве оказания услуг организацией</a> <a class="footer__link text-button" target="_blank" href="https://endowmentfa.ru/donate">Стать дарителем</a> </div> <!-- End footer block --> </div> <div class="footer__section"> <!-- socials block --> <div class="footer__socials flex gap-8"> <a class="ui-icon-button _secondary _contrast" href="https://t.me/s/finuniverchan" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-tg-20"> <use href="/local/templates/main/sprite.svg#social-tg-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://vk.com/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-vk-20"> <use href="/local/templates/main/sprite.svg#social-vk-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://max.ru/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-max-20"> <use href="/local/templates/main/sprite.svg#social-max-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://www.youtube.com/channel/UChitH8STbXi2HyYTqXnHSnw" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-youtube-20"> <use href="/local/templates/main/sprite.svg#social-youtube-20"></use> </svg> </a> </div> <!-- socials block --> <!-- contacts block --> <div class="app-grid _cols-3" style="--cols:3;--cols-md:3;--cols-sm:1;--gap:3.2rem;--gap-md:3.2rem;--gap-sm:2.4rem;"> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная комиссия</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(495)249-52-49">+7(495)249-52-49</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:priemka@fa.ru">priemka@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Официальный адрес электронной почты</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:"></a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:academy@fa.ru">academy@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная ректора</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(499)943-95-80">+7(499)943-95-80</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:rector@fa.ru">rector@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Для справок по корреспонденции</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 499 943 98 55">+7 499 943 98 55</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:"></a></div> </div> </div> <!-- contacts block --> </div> </div> </div> </footer> <script src="/local/templates/main/js/app.js?1763707713" defer=""></script> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(98905690, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98905690" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(99165694, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/99165694" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(102224032, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/102224032" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103033693, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103033693" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241759, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241759" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241988, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241988" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103325236, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103325236" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript"> (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) })(window, document,'script','https://mc.yandex.ru/metrika/tag.js', 'ym'); ym(98069295, 'init', {webvisor:true, clickmap:true, accurateTrackBounce:true, trackLinks:true}); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98069295" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> </body> </html>Parameter Content-Security-PolicyEvidence frame-ancestors 'self';Solution Убедитесь, что ваш веб-сервер, сервер приложений, балансировщик нагрузки и т. д. правильно настроены для установки заголовка Content-Security-Policy.
-
CSP: скрипт-SRC небезопасный встроенный (1)
GET https://www.fa.ru/*/index.php
Alert tags Alert description Политика безопасности контента (CSP) - это дополнительный уровень безопасности, который помогает обнаруживать и смягчать определенные типы атак.
Включая (но не ограничиваясь) межсайтовыми сценариями (XSS) и атаками путем внедрения данных.
Эти атаки используются для всего, от кражи данных до повреждения сайта
или распространения вредоносного ПО.
CSP предоставляет набор стандартных HTTP-заголовков,
которые позволяют владельцам веб-сайтов объявлять утвержденные источники контента,
которые браузерам следует разрешить загружать на эту страницу - охватываемые типы - это JavaScript, CSS, HTML-фреймы, шрифты, изображения и встраиваемые объекты, такие как Java-апплеты, ActiveX, аудио и видео файлы.
Other info script-src включает unsafe-inline.
Request Request line and header section (270 bytes)
GET https://www.fa.ru/*/index.php HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/robots.txtRequest body (0 bytes)
Response Status line and header section (612 bytes)
HTTP/1.1 404 Not Found Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:11:22 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 112334 Connection: keep-alive Keep-Alive: timeout=10 Vary: Accept-Encoding Cache-Control: private, max-age=60 X-Frame-Options: SAMEORIGIN Content-Security-Policy: frame-ancestors 'self'; P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA" Set-Cookie: PHPSESSID=Y6I8TCTj8svRPs08Y2kXQ0cLbGuIzuDd; expires=Tue, 16-Dec-2025 13:11:22 GMT; Max-Age=10800; path=/; domain=www.fa.ru; HttpOnly Vary: Accept-EncodingResponse body (112334 bytes)
<!DOCTYPE html> <html lang="ru" id="s1"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="Финансовый университет, поступление, образование, научная деятельность, международное сотрудничество, дополнительное образование, обучение, студенты, абитуриенты, карьера" /> <meta name="description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»" /> <link href="/bitrix/cache/css/s1/main/template_9e0403e4e76a8459f3aa93a1eab92994/template_9e0403e4e76a8459f3aa93a1eab92994_v1.css?1763707797327626" type="text/css" data-template-style="true" rel="stylesheet" /> <meta property="og:type" content="article"> <meta property="og:url" content="https://www.fa.ru/*/"> <meta property="og:description" content="«Один из старейших российских вузов, готовящих экономистов, финансистов, юристов по финансовому праву, математиков, ИТ-специалистов, социологов и политологов»"> <meta property="og:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="https://www.fa.ru/upload/constructor/d77/2flx4xl2dbuxwslirbfnuykwy1216qq8/share_1200kh630.jpg"> <title>404 Not Found</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><!--if IEmeta(http-equiv='X-UA-Compatible' content='IE=edge')--> <meta property="og:title" content="Финансовый университет при Правительстве РФ | 404 Not Found"/> <!--link(rel='shortcut icon' href='./favicon.png')--><!--link(rel='preload' href='/fonts/.woff2' as='font' crossorigin='' type='font/woff2')--> <!-- <link rel="stylesheet" href="--><!--/css/vendor.css">--> <!-- <link rel="stylesheet" href="--><!--/css/app.css">--> </head> <body hx-ext="multi-swap"> <div class="sp-panel js-sp-panel"> <div class="sp-panel__bg"></div> <div class="sp-panel__container"> <div class="container"> <div class="sp-panel__head"> <p class="sp-panel__title">Версия для слабовидящих</p><button itemprop="copy" class="ui-icon-button _secondary sp-panel__close js-sp-panel-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="sp-panel__content"> <div class="sp-panel__group _text"> <p class="sp-panel__label">Размер текста:</p> <div class="sp-panel__buttons"><button type="button" data-sp-text="normal">A</button><button type="button" data-sp-text="medium">A</button><button type="button" data-sp-text="large">A</button></div> </div> <div class="sp-panel__group _color"> <p class="sp-panel__label">Цветовая схема:</p> <div class="sp-panel__buttons"><button type="button" data-sp-theme="light" title="Обычная">A</button><button type="button" data-sp-theme="dark" title="Темная">A</button><button type="button" data-sp-theme="black" title="Белое на черном">A</button><button type="button" data-sp-theme="white" title="Черное на белом">A</button></div> </div> <div class="sp-panel__group _images"> <p class="sp-panel__label">Изображения:</p> <div><button class="ui-button _tertiary js-sp-panel-img-off" type="button">Отключить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button><button class="ui-button _tertiary js-sp-panel-img-on" type="button">Включить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> <div class="sp-panel__group _reset"><button class="ui-button _secondary js-sp-panel-img-reset">Сбросить настройки<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button></div> </div> </div> </div> </div> <div class="search-popup js-search-popup"> <div class="search-popup__owerlay"></div> <div class="search-popup__container"> <div class="container"> <div class="search-popup__head"> <h2 class="search-popup__title">Поиск по сайту</h2><button class="ui-icon-button _secondary js-search-popup-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="search-popup__search"> <form class="flex gap-16" action="/search/"> <div class="ui-field js-field"> <div class="ui-field__icon"><svg class="_icon-search-24"> <use href="/local/templates/main/sprite.svg#search-24"></use> </svg></div><input class="ui-field__input" type="text" placeholder="Введите ваш запрос" id="ui-field-1" name="q" inputmode="search" /><label class="ui-field__label" for="ui-field-1">Введите ваш запрос</label> </div><button class="ui-button _primary">Поиск<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span></button> </form> </div> <div class="search-popup__links"> <a href="/search/?q=Подразделения">Подразделения</a> <a href="/search/?q=Кафедры">Кафедры</a> <a href="/search/?q=Магистратура">Магистратура</a> <a href="/search/?q=Дополнительное образование">Дополнительное образование</a> <a href="/search/?q=Поступающим">Поступающим</a> </div> </div> </div> </div> <header class="header " id="js-header"> <div class="container"> <div class="header__row _top"> <div class="header__group"> <button class="header__link _contrast" id="js-menu-sites-button"><svg class="_icon-menu-grid-20"> <use href="/local/templates/main/sprite.svg#menu-grid-20"></use> </svg>Наши сайты</button> <a class="header__link _contrast hidden-sm" href="/university/press-center/">Пресс-центр</a> </div> <div class="flex gap-64 sm-gap-16"> <div class="header__group"> <div class="flex gap-24 sm-gap-16"> <button itemprop="copy" class="header__link hidden-sm js-sp-panel-trigger" type="button"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg><span>Версия для слабовидящих</span></button> </div> <div class="flex gap-24 sm-gap-16"> <a class="header__link _tooltip" href="https://ruz.fa.ru/"> <div class="header__tooltip">Расписание</div><svg class="_icon-calendar-20"> <use href="/local/templates/main/sprite.svg#calendar-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="http://www.library.fa.ru/"> <div class="header__tooltip">Библиотека</div><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="header__link _tooltip hidden-sm" href="/university/services/"> <div class="header__tooltip">Сервисы</div><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <a class="header__link _tooltip" href="https://org.fa.ru/"> <div class="header__tooltip">Личный кабинет</div><svg class="_icon-user-20"> <use href="/local/templates/main/sprite.svg#user-20"></use> </svg></a> <button class="header__link _tooltip js-search-popup-toggle" type="button"> <div class="header__tooltip">Поиск</div><svg class="_icon-search-20"> <use href="/local/templates/main/sprite.svg#search-20"></use> </svg> </button> <a class="header__link _tooltip" href="https://biz.mail.ru/login/fa.ru"> <div class="header__tooltip">Почта</div><svg class="_icon-mail-20"> <use href="/local/templates/main/sprite.svg#mail-20"></use> </svg> </a> </div><!-- <div class="flex gap-24 sm-gap-16"><a class="header__link" href="#"><svg class="_icon-search-20">--> <!-- <use href="--><!--/sprite.svg#search-20"></use>--> <!-- </svg></a><a class="header__link hidden-sm" href="#"><svg class="_icon-eye-20">--> <!-- <use href="--><!--/sprite.svg#eye-20"></use>--> <!-- </svg></a></div>--> <div class="flex gap-16 hidden-md"> <a class="header__link" href="https://www.fa.ru">Ru</a> <a class="header__link" href="https://en.fa.ru/">En</a> </div> </div><label class="_contrast toggle-theme js-toggle-theme" for="js-toggle-theme"><span class="toggle-theme__light"><svg class="_icon-sun-20"><use href="/local/templates/main/sprite.svg#sun-20"></use></svg></span><span class="toggle-theme__switcher"><input id="js-toggle-theme" type="checkbox" hidden="hidden"/><span class="toggle-theme__flag"></span></span><span class="toggle-theme__dark"><svg class="_icon-moon-20"><use href="/local/templates/main/sprite.svg#moon-20"></use></svg></span></label> </div> </div> <div class="header__row _bottom js-menu__first-level"> <div class="header__row-inner"> <a class="header__logo" href="/"> <svg class="_icon-logo-colored"> <use href="/local/templates/main/sprite.svg#logo-colored"></use> </svg> </a> <div class="flex gap-48 items-center"> <div class="flex gap-40 hidden-md"> <a class="header__main-link js-menu__main-link" href="/university">Университет</a> <a class="header__main-link js-menu__main-link" href="/for-applicants/">Поступающим</a> <a class="header__main-link js-menu__main-link" href="/for-students/">Студентам</a> <a class="header__main-link js-menu__main-link" href="/dpo/">Допобразование</a> <a class="header__main-link js-menu__main-link" href="/graduate/">Выпускникам</a> <a class="header__main-link js-menu__main-link" href="/science/">Наука</a> </div><button class="burger-menu" id="js-burger-menu"><span class="burger-menu__icons"><span class="js-burger-open"><svg class="_icon-menu-24"><use href="/local/templates/main/sprite.svg#menu-24"></use></svg></span><span class="js-burger-close"><svg class="_icon-close-24"><use href="/local/templates/main/sprite.svg#close-24"></use></svg></span></span><span class="burger-menu__label">Меню</span></button> </div> </div> </div> </div> </header> <div class="menu" id="js-menu"> <div class="menu__backdrop js-menu__first-level"></div> <div class="menu__image"> <img src="/local/templates/main/images/example-image.jpg" alt="Фон меню" /> </div> <div class="menu-navbar hidden-from-md"> <div class="menu-navbar__icons"> <a class="menu-navbar__link" href="#"><svg class="_icon-book-open-20"> <use href="/local/templates/main/sprite.svg#book-open-20"></use> </svg></a> <a class="menu-navbar__link" href="#"><svg class="_icon-chat-20"> <use href="/local/templates/main/sprite.svg#chat-20"></use> </svg></a> <button class="menu-navbar__link js-sp-panel-trigger"><svg class="_icon-eye-20"> <use href="/local/templates/main/sprite.svg#eye-20"></use> </svg></button> <a class="menu-navbar__link" href="#">En</a> </div><a class="menu-navbar__link _media" href="#">Медиа</a> </div> <!-- Главное меню --> <div class="container menu__inner"> <div class="menu-tabs hidden-md" data-lenis-prevent="data-lenis-prevent"><button class="menu-tabs__item js-menu-tab__desktop">Университет</button><button class="menu-tabs__item js-menu-tab__desktop">Поступающим</button><button class="menu-tabs__item js-menu-tab__desktop">Студентам</button><button class="menu-tabs__item js-menu-tab__desktop">Выпускникам</button><button class="menu-tabs__item js-menu-tab__desktop">Дополнительное образование</button><button class="menu-tabs__item js-menu-tab__desktop">Наука</button><button class="menu-tabs__item js-menu-tab__desktop">Международная деятельность</button><button class="menu-tabs__item js-menu-tab__desktop">Работникам и соискателям</button></div> <div class="menu-tabs hidden-from-md js-menu__first-level" data-lenis-prevent="data-lenis-prevent"> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Университет</button> <a class="menu-tabs__icon" href="/university/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Поступающим</button> <a class="menu-tabs__icon" href="/for-applicants/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Студентам</button> <a class="menu-tabs__icon" href="/for-students/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Выпускникам</button> <a class="menu-tabs__icon" href="/graduate/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Дополнительное образование</button> <a class="menu-tabs__icon" href="/dpo/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Наука</button> <a class="menu-tabs__icon" href="/science/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Международная деятельность</button> <a class="menu-tabs__icon" href="/international-activity/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> <div class="menu-tabs__item"> <button class="js-menu-tab__mobile" type="button">Работникам и соискателям</button> <a class="menu-tabs__icon" href="/employee/"><svg class="_icon-caret-right-16"> <use href="/local/templates/main/sprite.svg#caret-right-16"></use> </svg></a> </div> </div> <div class="menu__content-wrapper js-menu__content-wrapper" data-lenis-prevent="data-lenis-prevent"> <button class="ui-button _tertiary _contrast menu__mobile-back js-menu__mobile-back"><span class="ui-button__icon"><svg class="_icon-caret-left-16"><use href="/local/templates/main/sprite.svg#caret-left-16"></use></svg></span>Назад</button> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/university/"><span class="text-h3 text-contrast">Университет</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Университет</h4> <a class="menu__link" href="/university/basic-information/">Основные сведения</a> <a class="menu__link" href="/university/structure/rectorate/">Руководство</a> <a class="menu__link" href="/university/structure/">Организационная структура</a> <a class="menu__link" href="/university/rating/">Университет в рейтингах</a> <a class="menu__link" href="https://www.fa.ru/university/history/">История Финансового университета</a> <a class="menu__link" href="/university/structure/university/museum/">Музей Финансового университета</a> <a class="menu__link" href="/university/structure/university/usr/social-projects/">Социальные проекты</a> <a class="menu__link" href="/university/programm/">Программа развития</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/branches/">Филиалы</a> <a class="menu__link" href="/university/contacts/">Контакты</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/sveden/">Сведения об образовательной организации</a> <a class="menu__link" href="/university/uchenyy-sovet/">Ученый совет Финансового университета</a> <a class="menu__link" href="/university/psovet/">Попечительский совет</a> <a class="menu__link" href="/university/epb/">Единая правовая база</a> </div> <div class="menu__links"> <a class="menu__link" href="/university/anticorruption/">Противодействие коррупции</a> <a class="menu__link" href="/university/antiterror/">Антитеррористическая и антиэкстремистская деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-applicants/"><span class="text-h3 text-contrast">Поступающим</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/bachelor/">Бакалавриат и специалитет</a> <a class="menu__link" href="/for-applicants/master/">Магистратура</a> <a class="menu__link" href="/for-applicants/postgraduate/">Аспирантура</a> <a class="menu__link" href="/science/doctoral/">Докторантура</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/for-applicants/second-degree/">Второе высшее образование</a> <a class="menu__link" href="/for-applicants/distance-education/">Дистанционное образование</a> <a class="menu__link" href="/for-applicants/transfers/">Переводы и восстановления</a> <a class="menu__link" href="/dpo/">Дополнительное образование</a> <a class="menu__link" href="/international-activity/">Обучение за рубежом</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/for-students/"><span class="text-h3 text-contrast">Студентам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Сервисы</h4> <a class="menu__link" href="https://org.fa.ru/">Личный кабинет студента</a> <a class="menu__link" href="https://online.fa.ru/">Открытая онлайн-академия</a> <a class="menu__link" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="http://www.library.fa.ru">Библиотека</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="https://en.fa.ru/for-students/">Иностранным студентам</a> <a class="menu__link" href="/for-students/oplata/">Оплата обучения и общежития</a> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="menu__link" href="/for-students/free/">Переход с платного обучения на бесплатное</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/graduate/"><span class="text-h3 text-contrast">Выпускникам</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/alumni/">Ассоциация выпускников Финуниверситета</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/foundation/">Эндаумент-фонд</a> <a class="menu__link" href="/graduate/#block-28040">Сервисы для выпускников</a> <a class="menu__link" href="https://endowmentfa.ru/donate">Стать дарителем</a> <a class="menu__link" href="https://www.fa.ru/graduate/alumni-meeting-conference/">Конференция-встреча выпускников Финансового университета</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/graduate/mentoring/">Наставничество</a> <a class="menu__link" href="/university/structure/education/dir-career/gprsvip/PolPred/">Полномочный Представитель</a> <a class="menu__link" href="https://www.fa.ru/employment/">Трудоустройство</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/dpo/"><span class="text-h3 text-contrast">Дополнительное образование</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Подразделения ДПО</h4> <a class="menu__link" href="/university/structure/dpo/vsgz/">Высшая школа государственных закупок</a> <a class="menu__link" href="/university/structure/dpo/vsl/">Высшая школа логистики</a> <a class="menu__link" href="/university/structure/dpo/vsmt/">Высшая школа менеджмента и технологий</a> <a class="menu__link" href="/university/structure/dpo/vsugmf/">Высшая школа управления государственными и муниципальными финансами</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/vsp/">Высшая школа предпринимательства</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Институт корпоративного обучения</a> <a class="menu__link" href="/university/structure/dpo/irpkk/">Институт развития профессиональных компетенций и квалификаций</a> <a class="menu__link" href="/university/structure/dpo/ifm/">Институт финансового менеджмента</a> <a class="menu__link" href="/university/structure/dpo/ifg/">Институт финансовой грамотности</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/ipks/">Институт повышения квалификации специалистов</a> <a class="menu__link" href="/university/structure/dpo/msb/">Международная школа бизнеса (Институт)</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/eib/business-school/">Бизнес-школа Финуниверситета (Институт)</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/university/structure/education/cdpo/">Центр студенческого ДПО «StudUp»</a> <a class="menu__link" href="/university/structure/dpo/crdo/">Центр развития дополнительного образования</a> <a class="menu__link" href="/university/structure/dpo/podpo/">Центр «Проектный офис ДПО»</a> <a class="menu__link" href="/university/structure/educational-departments/dep/dapk/ciys/">Центр инновационных образовательных и языковых стратегий</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/ff/cnfo/">Центр непрерывного финансового образования Финансового факультета</a> <a class="menu__link" href="/university/structure/dpo/ce/">Центр компетенций "Цифровая экономика"</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/naba/nna/">Кафедра налогов и налогового администрирования</a> <a class="menu__link" href="/university/structure/scientific-educational-departments/meo/iymk/">Кафедра иностранных языков и межкультурной коммуникации</a> <a class="menu__link" href="/university/structure/dpo/rukovodstvodpo/">Руководство ДПО</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/science/"><span class="text-h3 text-contrast">Наука</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная деятельность</h4> <a class="menu__link" href="/science/basic-science/">Фундаментальная наука</a> <a class="menu__link" href="/science/applied-research/">Прикладные исследования</a> <a class="menu__link" href="/university/structure/science/rnj/#block-2642">Журналы Финуниверситета</a> <a class="menu__link" href="/university/structure/education/upo/clusters/">Научно-образовательные кластеры</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Научная инфраструктура</h4> <a class="menu__link" href="/science/research-departments/">Научно-исследовательские подразделения</a> <a class="menu__link" href="/university/structure/science/osni/">Дирекция по организационному сопровождению научных исследований</a> <a class="menu__link" href="/university/structure/science/uoonir/">Группа планирования и мониторинга научной деятельности</a> <a class="menu__link" href="for-students/student-science/nso/">Научное студенческое общество</a> <a class="menu__link" href="/for-students/student-science/council-young-scientists/">Совет молодых ученых</a> <a class="menu__link" href="/university/structure/science/rnj/">Редакция научных журналов</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Научная аттестация</h4> <a class="menu__link" href="/university/structure/science/uank/">Управление аттестации научных кадров</a> <a class="menu__link" href="/university/structure/science/uank/dsfu/">Диссертационные советы Финансового университета</a> <a class="menu__link" href="/university/structure/science/uank/pd/">Перечень документов для представления в диссертационный совет</a> <a class="menu__link" href="https://www.fa.ru/dissertations/autorefs/">Объявления о защите диссертаций</a> <a class="menu__link" href="https://www.fa.ru/science/nak/">Научно-аттестационная комиссия Финансового Университета</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Экспертно-аналитическая деятельность</h4> <a class="menu__link" href="https://www.fa.ru/science/expert-analytical-activities/">Экспертно-аналитическая деятельность</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/international-activity/"><span class="text-h3 text-contrast">Международная деятельность</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Студентам</h4> <a class="menu__link" href="/international-activity/included-education/">Включенное обучение</a> <a class="menu__link" href="/international-activity/two-dip/">Программы двух дипломов</a> <a class="menu__link" href="/international-activity/programs/">Краткосрочные программы</a> <a class="menu__link" href="/international-activity/grants/">Стипендии и гранты</a> <a class="menu__link" href="/international-activity/russiansummerschool/">Летняя школа русского языка и культуры в Финансовом университете</a> <a class="menu__link" href="/international-activity/exchange/">Программы обмена (для иностранных студентов)</a> <a class="menu__link" href="/international-activity/help/">Справки и транскрипт</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Выпускникам</h4> <a class="menu__link" href="/international-activity/european/">Приложение к диплому</a> <a class="menu__link" href="/international-activity/diplom/">Подтверждение диплома за рубежом</a> </div> </div> <div class="menu__links-column"> <div class="menu__links"> <h4 class="menu__links-title">Преподавателям</h4> <a class="menu__link" href="/international-activity/projects/">Международные проекты</a> <a class="menu__link" href="/international-activity/abroad/">Академическая мобильность работников и командирование за рубеж</a> <a class="menu__link" href="/international-activity/professor/">Программа «Приглашенный профессор»</a> </div> <div class="menu__links"> <h4 class="menu__links-title">Партнерам</h4> <a class="menu__link" href="/international-activity/partnership/">Зарубежное партнерство</a> <a class="menu__link" href="https://www.fa.ru/international-activity/associations/">Международные ассоциации и сетевые университеты</a> </div> </div> </div> </div> <div class="menu__content js-menu__content"> <div class="menu__main-link"><a class="ui-button _tertiary" href="/employee/"><span class="text-h3 text-contrast">Работникам и соискателям</span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a></div> <div class="menu__links-wrapper"> <div class="menu__links-column"> <div class="menu__links"> <a class="menu__link" href="/employee/vacancy/">Вакансии и конкурсы НПР</a> <a class="menu__link" href="/university/structure/dpo/ipk/">Корпоративное обучение</a> <a class="menu__link" href="/employee/couching/">Наставничество</a> <a class="menu__link" href="/university/epb/82">Документы по управлению персоналом и работе с кадрами</a> <a class="menu__link" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="menu__link" href="https://www.fa.ru/university/project/">Проектная деятельность</a> <a class="menu__link" href="https://www.fa.ru/university/employee/">Наши работники</a> </div> <div class="menu__links"> </div> </div> <div class="menu__links-column"> <div class="menu__links"> </div> </div> </div> </div> </div> </div> <!-- /Главное меню --> </div> <!-- Наши сайты --> <div class="menu-sites" id="js-menu-sites"> <div class="menu-sites__backdrop js-menu-sites"></div> <div class="menu-sites__wrapper"> <div class="container"> <div class="menu-sites__inner js-menu-sites__content-wrapper"><button class="ui-icon-button _secondary menu-sites__button" id="js-menu-sites-close"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-close-20"> <use href="/local/templates/main/sprite.svg#close-20"></use> </svg></button> <div class="ui-tabs js-tabs"> <div class="ui-tabs__control js-tabs-control"> <button class="ui-tab" type="button" data-index="0"><span class="ui-tab__label">Филиалы</span></button> <button class="ui-tab" type="button" data-index="1"><span class="ui-tab__label">Колледжи Москвы</span></button> <button class="ui-tab" type="button" data-index="2"><span class="ui-tab__label">Ресурсы университета</span></button> <button class="ui-tab" type="button" data-index="3"><span class="ui-tab__label">Подразделения</span></button> <button class="ui-tab" type="button" data-index="4"><span class="ui-tab__label">Дополнительное образование</span></button> </div> <div class="ui-tabs__content js-tabs-content"> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://altai.fa.ru/" target="_blank"> <span class="ui-links__link">Алтайский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladik.fa.ru/" target="_blank"> <span class="ui-links__link">Владикавказский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://vladimir.fa.ru/" target="_blank"> <span class="ui-links__link">Владимирский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kaluga.fa.ru/" target="_blank"> <span class="ui-links__link">Калужский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnodar.fa.ru/" target="_blank"> <span class="ui-links__link">Краснодарский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kursk.fa.ru/" target="_blank"> <span class="ui-links__link">Курский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lipetsk.fa.ru/" target="_blank"> <span class="ui-links__link">Липецкий филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://novoross.fa.ru/" target="_blank"> <span class="ui-links__link">Новороссийский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://omsk.fa.ru/" target="_blank"> <span class="ui-links__link">Омский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://orel.fa.ru/" target="_blank"> <span class="ui-links__link">Орловский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://penza.fa.ru/" target="_blank"> <span class="ui-links__link">Пензенский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://spb.fa.ru/" target="_blank"> <span class="ui-links__link">Санкт-Петербургский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://smolensk.fa.ru/" target="_blank"> <span class="ui-links__link">Смоленский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://tula.fa.ru/" target="_blank"> <span class="ui-links__link">Тульский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://chelyabinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Уральский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://ufa.fa.ru/" target="_blank"> <span class="ui-links__link">Уфимский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://yaroslavl.fa.ru/" target="_blank"> <span class="ui-links__link">Ярославский филиал</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://blagov.fa.ru/" target="_blank"> <span class="ui-links__link">Благовещенский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://buzuluk.fa.ru/" target="_blank"> <span class="ui-links__link">Бузулукский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://zvenigorod.fa.ru/" target="_blank"> <span class="ui-links__link">Звенигородский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kanash.fa.ru/" target="_blank"> <span class="ui-links__link">Канашский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://krasnoyarsk.fa.ru/" target="_blank"> <span class="ui-links__link">Красноярский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mahachkala.fa.ru/" target="_blank"> <span class="ui-links__link">Махачкалинский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://perm.fa.ru/" target="_blank"> <span class="ui-links__link">Пермский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://samara.fa.ru/" target="_blank"> <span class="ui-links__link">Самарский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://surgut.fa.ru/" target="_blank"> <span class="ui-links__link">Сургутский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://shadrinsk.fa.ru/" target="_blank"> <span class="ui-links__link">Шадринский финансово-экономический колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://kip.fa.ru" target="_blank"> <span class="ui-links__link">Колледж информатики и программирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://mfc.fa.ru" target="_blank"> <span class="ui-links__link">Московский финансовый колледж</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://anketa.fa.ru/" target="_blank"> <span class="ui-links__link">Личный кабинет поступающего / слушателя</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://podku.fa.ru/" target="_blank"> <span class="ui-links__link">Подготовительные курсы Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://org.fa.ru/app/kk/dpp/programs" target="_blank"> <span class="ui-links__link">Корпоративное обучение</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pay.fa.ru" target="_blank"> <span class="ui-links__link">Все ссылки на оплату, Москва и филиалы</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://forum.fa.ru/" target="_blank"> <span class="ui-links__link">Международный форум Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://edu.fa.ru/" target="_blank"> <span class="ui-links__link">Дополнительное образование</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://business.fa.ru/" target="_blank"> <span class="ui-links__link">Предпринимательский клуб Финансового университета</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://pirsocenter.ru/foresight2025" target="_blank"> <span class="ui-links__link">Форсайт образования</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://lesnoe.fa.ru/" target="_blank"> <span class="ui-links__link">Учебно-оздоровительный комплекс «Лесное озеро»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://career.fa.ru/" target="_blank"> <span class="ui-links__link">Центр карьеры</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="https://online.fa.ru" target="_blank"> <span class="ui-links__link">Открытая онлайн-академия</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> <div class="menu-sites__links" data-lenis-prevent="data-lenis-prevent"> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsgz/" target="_blank"> <span class="ui-links__link">Высшая школа государственных закупок</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsl/" target="_blank"> <span class="ui-links__link">Высшая школа логистики</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsmt/" target="_blank"> <span class="ui-links__link">Высшая школа менеджмента и технологий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/vsugmf/" target="_blank"> <span class="ui-links__link">Высшая школа управления государственными и муниципальными финансами</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ipk/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации и профессиональной переподготовки работников</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/irpkk/" target="_blank"> <span class="ui-links__link">Институт развития профессиональных компетенций и квалификаций</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifm/" target="_blank"> <span class="ui-links__link">Институт финансового менеджмента</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/ifg/" target="_blank"> <span class="ui-links__link">Институт финансовой грамотности</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/dpo/msb/" target="_blank"> <span class="ui-links__link">Международная школа бизнеса (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/business-school/" target="_blank"> <span class="ui-links__link">Бизнес-школа Финуниверситета (Институт)</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/eib/vsp/" target="_blank"> <span class="ui-links__link">Высшая школа предпринимательства</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/ipks/" target="_blank"> <span class="ui-links__link">Институт повышения квалификации специалистов</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/naba/nna/" target="_blank"> <span class="ui-links__link">Кафедра налогов и налогового администрирования</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/educational-departments/dep/dapk/ciys/" target="_blank"> <span class="ui-links__link">Центр инновационных образовательных и языковых стратегий</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/meo/iymk/" target="_blank"> <span class="ui-links__link">Кафедра иностранных языков и межкультурной коммуникации</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/vsu/gcp/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Государственно-частное партнерство»</span></a><span class="ui-links__link-span"></span></div> </div> </div> <div class="ui-links"> <div class="ui-links__wrapper"> <div class="ui-links__tel"><a href="/university/structure/scientific-educational-departments/ff/izkifi/" target="_blank"> <span class="ui-links__link">Базовая кафедра «Ипотечное жилищное кредитование и финансовые инструменты рынка недвижимости»</span></a><span class="ui-links__link-span"></span></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /Наши сайты --> <main id="app"><div class="not-found"> <div class="container"> <div class="not-found__content"> <p class="not-found__404">404</p> <h1 class="not-found__title">Страница не найдена</h1> <p class="not-found__desc">К сожалению, такой страницы не существует. Попробуйте изменить запрос или перейти на главную страницу</p><a class="ui-button _primary _icon-arrow" href="/">Перейти на главную<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></a> </div> </div> <div class="not-found__bg"> <img src="/local/templates/main/images/bg-404.png" alt="Картинка заднего фона" /></div> </div></main> <div class="filter-popup" id="date-filter-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-block-response.html" hx-trigger="submit delay:300ms" hx-target="#event-block"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-events-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать дату</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/events-response.html" hx-trigger="submit delay:300ms" hx-target="#events"> <div class="datepicker js-datepicker-filter _filter"><input placeholder="Выбрать дату" /><input name="date-from" type="hidden" /><input name="date-to" type="hidden" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="today" /><label>Сегодня<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="tomorrow" /><label>Завтра<svg class="_icon-close-24"> <use /local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="На этой неделе" /><label>На этой неделе<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button"><input type="radio" name="filter" value="month" /><label>В этом месяце<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="filter-popup" id="date-filter-year-popup" data-lenis-prevent="data-lenis-prevent"> <div class="filter-popup__head"> <h4>Выбрать год</h4><button class="filter-popup__close js-filter-close" type="button"><svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></button> </div> <div class="date-filter js-date-filter-mobile _filter" data-year="data-year"> <div class="date-filter__wrapper"> <form class="date-filter__form" hx-get="/response/project-block-response.html" hx-trigger="submit delay:300ms" hx-target="#project-block"> <div class="datepicker js-datepicker-filter _filter"><input name="year" placeholder="Выбрать год" /> <div class="datepicker__icon"><svg class="_icon-caret-down-24"> <use href="/local/templates/main/sprite.svg#caret-down-24"></use> </svg></div> </div> <div class="date-filter__form-wrapper"> <div class="date-filter__button js-date-filter-button _year"><input type="radio" checked="checked" name="filter" value="all" /><label>Все<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="research" /><label>Научные исследования<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> <div class="date-filter__button js-date-filter-button _year"><input type="radio" name="filter" value="development" /><label>Разработки<svg class="_icon-close-24"> <use href="/local/templates/main/sprite.svg#close-24"></use> </svg></label></div> </div> <div class="date-filter__foot"><button class="ui-button _tertiary js-filter-refresh" type="reset">Сбросить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-refresh-24"><use href="/local/templates/main/sprite.svg#refresh-24"></use></svg></span></button><button class="ui-button _primary _icon-arrow js-filter-apply">Применить<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-right-16"><use href="/local/templates/main/sprite.svg#arrow-up-right-16"></use></svg></span></button></div> </form> </div> </div> </div> <div class="container"> <div class="button-up"><button class="ui-button _tertiary" id="js-scroll-to-top-button">Наверх<span class="ui-button__circle-wrapper"><span class="ui-button__circle"></span></span><span class="ui-button__icon"><svg class="_icon-arrow-up-16"><use href="/local/templates/main/sprite.svg#arrow-up-16"></use></svg></span></button></div> </div> <!-- Useful-links block --> <div class="useful-links js-useful-links"><button class="useful-links__trigger js-useful-links__trigger"><span class="container"><span class="useful-links__trigger-inner"><span class="useful-links__label">Полезные ссылки</span><span class="useful-links__icon"><svg class="_icon-caret-down-16"><use href="/local/templates/main/sprite.svg#caret-down-16"></use></svg></span></span></span></button> <div class="container"> <div class="useful-links__content js-useful-links__content"> <div class="useful-links__content-inner"> <a class="useful-links__link" target="_blank" href="https://edu.fa.ru/">Информационно-образовательный портал</a> <a class="useful-links__link" target="_blank" href="https://anketa.fa.ru/">Личный кабинет поступающего</a> <a class="useful-links__link" target="_blank" href="http://www.library.fa.ru/">Библиотечно-информационный комплекс</a> <a class="useful-links__link" target="_blank" href="https://pay.fa.ru/moscow/">Оплата обучения</a> <a class="useful-links__link" target="_blank" href="https://ruz.fa.ru/">Расписание занятий</a> <a class="useful-links__link" href="/university/structure/education/sso/">Студенческий офис</a> <a class="useful-links__link" href="/university/contacts/">Официальный адрес электронной почты</a> <a class="useful-links__link" href="/university/structure/university/sitp/">ИТ-поддержка</a> <a class="useful-links__link" target="_blank" href="https://edu.gov.ru/">Министерство просвещения РФ</a> <a class="useful-links__link" target="_blank" href="https://minobrnauki.gov.ru/">Министерство науки и высшего образования РФ</a> </div> </div> </div> </div> <!-- End useful-links block --> <footer class="footer"> <div class="container"> <div class="app-grid _cols-1" style="--cols:1;--cols-md:1;--cols-sm:1;--gap:4rem;--gap-md:4rem;--gap-sm:2.4rem;"> <div class="footer__top-section flex justify-between items-center"> <div class="footer__logo"> <svg class="_icon-logo"> <use href="/local/templates/main/sprite.svg#logo"></use> </svg> </div> </div> <div class="footer__section"> <!-- footer address --> <div class="footer__address"><span class="text-body-small">Адрес университета</span><b class="text-body-bold">125167, Москва, пр-кт Ленинградский, д. 49/2</b> <p class="text-body-small">По вопросам, касающимся проведения съемок на территории Финансового университета, присылайте свой запрос в письменном виде в <a href="https://www.fa.ru/university/structure/university/uso/press-service/" style="color:#FFFFFF;">Пресс-службу</a> университета по электронной почте pressa@fa.ru</p> </div> <!-- End footer address --> <!-- footer menu block --> <div class="footer__links-grid hidden-sm"> <a class="footer__link text-button" href="/university/">Университет</a> <a class="footer__link text-button" href="/for-applicants/">Поступающим</a> <a class="footer__link text-button" href="/for-students/">Студентам</a> <a class="footer__link text-button" href="/graduate/">Выпускникам</a> <a class="footer__link text-button" href="/dpo/">Дополнительное образование</a> <a class="footer__link text-button" href="/science/">Наука</a> <a class="footer__link text-button" href="/employee">Работникам и соискателям</a> <a class="footer__link text-button" href="/international-activity/">Международная деятельность</a> <a class="footer__link text-button" href="/university/branches">Филиалы</a> <a class="footer__link text-button" href="/university/services/">Сервисы</a> <a class="footer__link text-button" href="/university/anticorruption/">Противодействие коррупции</a> <a class="footer__link text-button" href="/sveden/">Сведения об образовательной организации</a> <a class="footer__link text-button" target="_blank" href="https://org.fa.ru/">Личный кабинет</a> <a class="footer__link text-button" target="_blank" href="https://lesnoe.fa.ru">Учебно-оздоровительный комплекс «Лесное озеро»</a> <a class="footer__link text-button" href="/university/project/">Проектная деятельность</a> <a class="footer__link text-button" target="_blank" href="https://www.fa.ru/university/structure/university/usr/psy/">Психологическая служба</a> <a class="footer__link text-button" href="/university/campuscard/">Кампусная карта</a> <a class="footer__link text-button" href="/university/contacts/">Контакты</a> <a class="footer__link text-button" href="/university/structure/university/uso/adogokouo/">Анкета для опроса граждан о качестве оказания услуг организацией</a> <a class="footer__link text-button" target="_blank" href="https://endowmentfa.ru/donate">Стать дарителем</a> </div> <!-- End footer block --> </div> <div class="footer__section"> <!-- socials block --> <div class="footer__socials flex gap-8"> <a class="ui-icon-button _secondary _contrast" href="https://t.me/s/finuniverchan" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-tg-20"> <use href="/local/templates/main/sprite.svg#social-tg-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://vk.com/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-vk-20"> <use href="/local/templates/main/sprite.svg#social-vk-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://max.ru/finuniversity" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-max-20"> <use href="/local/templates/main/sprite.svg#social-max-20"></use> </svg> </a> <a class="ui-icon-button _secondary _contrast" href="https://www.youtube.com/channel/UChitH8STbXi2HyYTqXnHSnw" target="_blank"><span class="ui-icon-button__circle-wrapper"><span class="ui-icon-button__circle"></span></span><svg class="_icon-social-youtube-20"> <use href="/local/templates/main/sprite.svg#social-youtube-20"></use> </svg> </a> </div> <!-- socials block --> <!-- contacts block --> <div class="app-grid _cols-3" style="--cols:3;--cols-md:3;--cols-sm:1;--gap:3.2rem;--gap-md:3.2rem;--gap-sm:2.4rem;"> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная комиссия</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(495)249-52-49">+7(495)249-52-49</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:priemka@fa.ru">priemka@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Официальный адрес электронной почты</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:"></a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:academy@fa.ru">academy@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Приёмная ректора</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7(499)943-95-80">+7(499)943-95-80</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:rector@fa.ru">rector@fa.ru</a></div> </div> <div class="ui-links _contrast"><span class="ui-links__label">Для справок по корреспонденции</span> <div class="ui-links__wrapper"><a class="ui-links__link" href="tel:+7 499 943 98 55">+7 499 943 98 55</a></div> <div class="ui-links__wrapper"><a class="ui-links__link" href="mailto:"></a></div> </div> </div> <!-- contacts block --> </div> </div> </div> </footer> <script src="/local/templates/main/js/app.js?1763707713" defer=""></script> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(98905690, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98905690" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(99165694, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/99165694" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(102224032, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/102224032" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103033693, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103033693" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241759, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241759" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103241988, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103241988" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(103325236, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/103325236" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <!-- Yandex.Metrika counter --> <script type="text/javascript"> (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) })(window, document,'script','https://mc.yandex.ru/metrika/tag.js', 'ym'); ym(98069295, 'init', {webvisor:true, clickmap:true, accurateTrackBounce:true, trackLinks:true}); </script> <noscript><div><img src="https://mc.yandex.ru/watch/98069295" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> </body> </html>Parameter Content-Security-PolicyEvidence frame-ancestors 'self';Solution Убедитесь, что ваш веб-сервер, сервер приложений, балансировщик нагрузки и т. д. правильно настроены для установки заголовка Content-Security-Policy.
-
Заголовок Content Security Policy (CSP) не задан (1)
GET https://www.fa.ru/bitrix/
Alert tags Alert description Политика безопасности содержимого (CSP) — это дополнительный уровень безопасности, который помогает обнаруживать и смягчать определенные типы атак, включая межсайтовые сценарии (XSS) и атаки с внедрением данных. Эти атаки используются для всего: от кражи данных до порчи сайта или распространения вредоносных программ. CSP предоставляет набор стандартных HTTP-заголовков, которые позволяют владельцам веб-сайтов объявлять утвержденные источники контента, которые браузеры должны разрешить загружать на эту страницу. Охватываемые типы включают JavaScript, CSS, HTML-фреймы, шрифты, изображения и встраиваемые объекты, такие как апплеты Java. ActiveX, аудио и видео файлы.
Request Request line and header section (266 bytes)
GET https://www.fa.ru/bitrix/ HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/robots.txtRequest body (0 bytes)
Response Status line and header section (312 bytes)
HTTP/1.1 200 OK Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:11:22 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 83 Connection: keep-alive Keep-Alive: timeout=10 Cache-Control: max-age=60 Cache-Control: private, max-age=60 Expires: Tue, 16 Dec 2025 10:12:22 GMT Vary: Accept-EncodingResponse body (83 bytes)
<head> <meta http-equiv="REFRESH" content="0;URL=/bitrix/admin/index.php"> </head>Solution Ensure that your web server, application server, load balancer, etc. is configured to set the Content-Security-Policy header.
-
-
-
Risk=Средний, Confidence=Средний (2)
-
https://www.fa.ru (2)
-
Возможные IP-адреса, найденные в Viewstate (1)
GET https://www.fa.ru/upload/iblock/23b/jx1xgc4thigck3nrcv9ukx19u0bz7wk6/rid2019_23.docx
Alert tags Alert description В поле состояния просмотра были обнаружены следующие потенциальные IP-адреса:
Other info [14.0.0.0]
Request Request line and header section (386 bytes)
GET https://www.fa.ru/upload/iblock/23b/jx1xgc4thigck3nrcv9ukx19u0bz7wk6/rid2019_23.docx HTTP/1.1 host: www.fa.ru user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 pragma: no-cache cache-control: no-cache referer: https://www.fa.ru/science/rnd/rid/474 Cookie: PHPSESSID=uxWGVfxtAM5K5tsxYVEwHfiMVsHMo8fTRequest body (0 bytes)
Response Status line and header section (465 bytes)
HTTP/1.1 200 OK Server: nginx/1.19.3 Date: Tue, 16 Dec 2025 10:15:24 GMT Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document Content-Length: 2523423 Connection: keep-alive Keep-Alive: timeout=10 ETag: "672115f6-26811f" Last-Modified: Tue, 29 Oct 2024 17:05:58 GMT Expires: Thu, 15 Jan 2026 10:15:23 GMT Accept-Ranges: bytes X-Frame-Options: SAMEORIGIN Cache-Control: max-age=2592000 X-Content-Type-Options: nosniffResponse body (2523423 bytes)
PK ! ���Ȣ [Content_Types].xml �(� ̕MO�@��&��f��.hb��x��$b�u�Naq��;�{�-6� UA�f��}�mg�WK��WQ9��^�e X�re'{�u.XQ�\hg!c+��jp|��<Ą�6fl��/9�r F��y�T)\0�k�p/䋘 ?�vϹt�bK6��@!���%�\��<LXr]7�YS�4� |�&���4�{��@��W�"묩RRV=q�|<��- ee{�v����N ���x/5��9ϝ����7��BIh���NB�t�F�M�e�G��!��y6�+3����8�i�4�N���_3Tτ��1:��?�u+Dĕ�xx�ڷ=I� k�V����y+HA�#1�px�ƺi�C���v�lvERg��M~0���/���7�I$���f�!�nv�-�t6���R� �� PK ! �U~� � _rels/.rels �(� ��MK1���!̽;�*"��^D�Md�C2��������(�.Ե�3y��3C֛��+�4xW��(A������yX܂JB���Wp����b��#InJ����*�E�b�=[J���M�%���a �B�,o0�f@=a��� n�����o�A��;�N�<��v��"��e�Ө�b�R���1�REF7Z�n���hYȐjy��#1'�<犦��7 �����9m�.�����3�Y� �� PK ! [rR� � word/_rels/document.xml.rels �(� �VMo�0�W�X�^X�Q�P���Csh�R�Ke``]���a�����h�D V�,�~����f<su�|�m��)��%Y�,T�d����o>��A*Kʕ���`�������)�Kf�Z��Q�I���CSlAP���R)-(ڣ�Ö �!���$��d�,��L��)m�M��[b��b|QE'@�+)B&ln��0%JF�(���$|�C��Ibk#i�d3 BGuY��d�v4��tw��*m��{-)e:�\�K.�j�A%~ ~�'4dbذcl�h�it���HP(1ͻ�<�A~���͉� t)�����s^������.4YE'w�W��R�Ӷd�έm0�[���Ņ�x�6&r����6fz����\M�]�^e�P���)������?I�f����hE{w�\��#�,�h����i�������}o��Ɇ��d);����~b���I*4}-�.�����իR�Eu�*���@��� ����t�+�0�� �� PK ! �Wnw� �� word/document.xml�]yoG���� ��`M��C;���lz��F�]` �(J�b$%YY,`��d;�7ƛ��\XdgFv�X�-�'h~��$�ޫ�M�u�!)z&bwuwuջ�_����//�5��Z�S���f�YqF�5��b��|n�7�sF�t+��J�k���l�:3�<�������E���Vkv��ٙ�lU�ͬt�����Nu��V�̮իm��-ug��ڜ��T���6���,J"��^������Js�ҙ��U/�m�]ل��Bu��Riwk��:�CW��Ysf�����y�Z..y�JN��sk���z� ��*��B�Q�nA��T㝛Yo7�y��)��<k � �h�y/{���Ao�k����Y��B���6��T�1�k��͖�O J�+Q�y��Y��`-^�$��V>�� �w-Y�ԛы�D�q%�p�}����xs���H56[���ފj���W��a]h�Q���w�ט7V*-P���+�M�]Yh@����O �%3���.x�[�ۂ�|�Ү��xnFWEYwg�J�"u�����t,����fD�UD�-�E�Xh��Zaa��TYot�o�+�V\l��T��F�qn� ��֞���6��.{�nn�t�u`ۛ��ZGx��)��U�X�J��ɾR��S�U�ᵃ���]���fP���ces�qsa��~z�G/6��������w�Ի�{���'���>����;�^�=���7��������wz��[Xa� ��z��n�*����x*��?ėv٫��eQuD��y*��U� 2�(^B� ��J��?��'$V���> ��p�����˟����^})���e��%-)i�c����E��UװS�&i��*Y���2:���b�"�3��(V��/�ɹdG��N�R���ծuj���y�{����7���W��g�-�o��%������-���7t����Ot��KHH��L��R��� ]�IT��s�:~hc�9��o�����#�"�o�q��y&ӾȬ�������;���;pN��} |������@6�p�[.�9�J���_��=��~ �������v��5Wv��5]�N~x�H@��7�!ak�&�+��d ����Z(ķ���6�/Ь?�ނ{Ci�6��,ͧ��� ��7@Ew��{��9�}�ݒc�Rʆl+���tQ�dI�C�Z�%-��5�N� ڽhL[�U�S��V�]��D���h�;<�R]� ������N��$i����6'�gmC@��g������k��?���Ǻ6�ּ(����>=���b�w( ��@�G�����u�}���$ޞ/L�v!�Bq�}`a8��hF�ۻ>�z��%y>�n+�= �]��K!/�Pv!$&���~�~ w�]���5���`��5� '��U�>!{~K�!G�� ��>����;� AG�䣡�j�r�s(w�l�Q���.�����FE�US���~G0i)��)�6~�Z����hz��,� ½��N�r���M�]��l�/���c�A�� �B��!�5Y�� ��G�O��h��>�:���&��X�-���'�i �ٟ1��;d;��$_<*L�=��薁/6�C�$Gы�V��������?�#�7�[�Z�tEa5B��A��9��t�Z`(+�]/���筆�S�t�R�����S��5*�,��x��5Lu �^�~eW�!���+;�x�⭾Ю/��2�B�������bM2 5�d��/%�)WI2l��6D��d��T�!�����U���� QI1d�.6#����g��,���Ⱦx�<�oL���f�)]UӶ��<���CGwjn�cӻ����#D�.���z�Qoք�z��&i ��ѫ�rr�RW�+���&��AMLv���:aTױ@X� �1��}�)Z��T��Y�, k/ܵ�T�v]v/j���"2#��� ɦ�lQ�/��}�����m�a |�� l>�5_}m�B��Z�W�m� P=�J^�����S9B�K�jz�J��\+vZЋ�x�q���T�V��v�U����z��_��|+l�����:Y<R����l-W�������b�m�����F�U�7�u<�� �hE@�^�t����fQ-�.8��T�pEK5 ��*�,ɑ��§A��;(�F�U�7s/�R*r�`#I5(��&αN`[;�v�[]��%��� E��#�?�u��T�/-����!\"u��/eD`�'�����g�&3��-*/Լ5����heZ�n n��a �C��� d��i�6d�B#w�h�2Di�JCK�!�d��ZB����Z���C�I����?��C0���L<�ɓݮP���e,�(�!|��<@�T�L�RR���8VY�1��!5A��"�r2�h*�K�h�f��<Ѷ��>���g�������_�8�1�C�9ʘ���)��q ��>���7�� ������.����!��P��rj�)[UT]�TWSs����2y63�X�+�\L%~�zb��]����P�0��z�G5eǵDdgb��4ʚ�t3�{�����c������䭂g��>��*�@鵷02��H��"ۢ�0�I�����I��Rs9(�5o���:�r ��1�eJ�ȓ �ח�� bt��Tpy6��"Qn;�B�N��hP"o�i��z.��E�dh4�A%�r5)�(EMsԲ{�1hռ8��'��m�Ԟݖe���Y�p?��В�.{,�:�OF�E�.m��(O(E� �JM^��[4m%;��}⚼B����-�G��_�����u�4p�=>y �e�.�)��䁪��LŐY���<P$|f�܌���G�����9�?����iw��h��@����!��d�$�H�s �K[���9�4,9�H�2 ҰI�SpDI��<�B�:�M���}&��V�Q������, �Ws�((������ZRղ�늙S2|�</1�Kpu3���>zm�� �R�:\(>�?���.����"�'��}�gF�=#2g%���h���C!cn������b�l`�>%�X�\G��2J���R^�h�rQף Ù�1=5�LΘ��(+x��T�D�W�Eiq�������wi6R��@�E[*ڲ��JW����jS�1R��eI�(Xr�����Ά�����ތ2�EQ���5S�K�f'#T? �3��5k�����r�n�*����AѪ%�bI��=EK���E9�UC18𥊢���5�d���y�� ������#�CGL���L�+�����e"����.�J0%�J����5� ��8e�Aۓ@a�K����Qm����m���7dEL$ @��� 'm33Ѿ��E�(k��r�[V4G��?���� ��B�d���2B���l#��+Izׅg?��p� L�g�m��>?�b��~�η<i?��.N:��B�l��T�����7��QxY�۸gV������6�����#�h8fYF�u:�Q6�tS2���M�5F��'�Q��;㨧iQMfIf����d�F��C����H�]no�[k�z���*���ѐR��j���D�\�)'������Q2M9��VIv[ł!���ULP��p`��H�#�)Q9�U-:���}��KVɢ�!�`닓��D/�Mk#ٽN�-�R9���M=�r]R,��;R�-�e�J�я�PU�_�UIT5b��a%���__�b��B[��qLUU-C �дIO�� U�bj�:dNL����� G�)ˀ_���Pw��pS�I�U���}%��FfG �h�e�=q�e�r-xݕ�V�lR�� #��eD��o��~��X�4�ף��G��t[�]7�C�dU�t���7f�?tE��0芋MR�&�zmc�]���Q@+M�4���:bͱD.$d0���`&�L�`�?c���Ҟݖ �Q䂜�?� ���=�Ъ,�J�T�t4���ȂV�ZE[K%���S,ɤ]&�b殁�G�"���7c��' ��%״i��ڮ�86�ǟ�vt���t�d� J���:P�X�T�Ig��:�v�m�n"~�~��R����Zo��������9�3;�//��L!���Ā���'��8�D�F��X�Ϛ����6Wj��N��d-��`L�v��.���7�2��T�ʱ�c`T��毽�`������Z��UھᨈU�'��^�h& �X��Z��U)��Ӕ����*��v?� �1������{+ۖ��$41PmG-3oB�4�����}oG:��U�����5�Y�������\uD�1��9�̾�"�����ϒ&���� �ox�2 ��#����@��??~��j��sXI� �ѧD�: �b�%��g�t� �����oAO��ѱQ}xm�<e˃&�TJgxI�e�Ji�nvLpaY1SN˲kR��r���s3�,4*�Uj�7E�-�������}}���T9 V���!��<�j�H�!~�+b���1J/�D��HS�a�d�-��������G�N��0 "M�u�8?"�$��c�'��]�uSƯ�$��趨��%�/��%+e��Sm�jX���"�[�$��ގ�.�loǃ�1q5n&l� ��Z����!Ӷ*�n�z�TO(s���a��eZR�|�����<�9���J�Q�)V��D0�����lE{��l1��1bZ�� W��lJZ9���.�Ͳf�$}$�,�m4E` ��w��IGUԏ���fvdR�uGv�r:�1�柦 岉�)%��کX��k���Q������M3H��F19c{�<�V"eی������)^�ZWz!��CL�0�?M�����֟��b���2�9K�n��6ֶ�����?I��D#�ڳۚdL� �V K �ʦe�}j����F�he!�ػ� %���NAP��H��D����X���<˲.���MA���ߒbh�����,����@g��} t� �2m���¯�V����饓;��W�����$��wuC�,�7kR�NM6�_9ς�Ӕz�↩��r��_�����ؿ�'���G��Ή��S�$�1p������� ���]^�}����E��*f��3R��R�)��I�'c�L�6۲�|�o 4*8�ΔX�4jFISKz*h� �/�sm�{�Ly�?�#'��Ym�wq��e�t ����U�b���������H�$z�I�I6A�`���1+�K"��ɺ$C��c�rQu3W�'����q��|#���dU5�d������:��DSU(�<�V��:����~�V���������~�3�� ����?����[��|Ew�^��E'@q-K��>�u�<$�L��F95PI�RYT$�?���V6#K�*�1������� ���ɮ"P�#ߍN^_oK橇��"\Y��;�W�^C�}�;��Ȍ��H5vs`��mP�����1H�L�+�E�7t�kJ>Ʊ�l�:_� �Ǵ-T}���p����!�q ҿ�$� ��]���=� �LȨI�y�w�� �r�`���P����G+������u&���_*�^ Js�@��c���y�;�HzQ .fp�kҵ=ē�=��&����o�Y ��>E��ٟ�y/�%X �=�XU�^� �f�c��� [(OTK؎�H��Oi�:~��2����'��6N��)s;�q�fx3_�N9���)1h�c�� ��иG$/XS��'�¥����wxO [�ͅ ���cjqD!��3�Y�^���^�����""!�/ �4r{6��d�LI�ҙv�-+��сV,�$��h����7B\���U{���[GE��3lUR?��u�u�qZ(�=v�"���*fzu�!�u�}y@���Szf�s��Q`Q��eOi z�^/v%� >O��Y���� �-��h>�qT����`3> ñ}���5�*5�� ��� �z���B �Y,$ � �V�9�U1Je�r�р�0S+����.0G��)f��Ɍ'���]��Ic/3�)�S>3��ϲ�~CJ�@�FloA����l=�>��y�]�cSt��5��HW̦(�iZ2[#?R6�|?O�*r1REP��hQ�y|d�b�`1�HO�1�~B�&�j> ���i��p���[��V)�����7.��Od�wL*"G����U��1�C�Dܛ�*�6�s�v'�X���A�FY�$-�n��E���k�r���}���+�R�l�>ѭ,t�opS����f����ޢ[YЋw�K�T�`��Q��@�!N^!���ݳ}�J���eq�e��a���@aBY��������g����V�S�K(e`�1�� .��~���|/#���K��C�Ԓ![��g�p*sǗ����.H��qc��S<��iC g��On����L҂Au�.>��p&a�#a�Cn�����@ ��_��!߄�L[H��� djH�� ��q �v���Β�<b��i�mr��b���<%�,���:f�)0GX�).�O{J����O��',�}@����C�,E�h��/����_��5.w`߃��܈����[���|�O��5u,���("��p��2CMŐ�'դ�? ����t5���e䥢.%'�Q|�g�hI�%7Z12U�C�� x�����F�!o#�z7�= �cA-s�{^3eI��,���� >�w�{�"+��P�2و�8��* �(�Պ�?�+.�_������ ����7�P�r��C�� �ū�<� ~����Q'����il�c)<�ZZ"�=� �(d{�':/� ^��Be�, ��N 4ze���0�R���<��:��(����w�_Ҽ9�(�5͢I�r�����ON\�BTq�dU�Lڕ8�������d~p�Yg� E�?��@��:`��8��2�f����'��ʓ� l��#� MlT�;�y�[/N)��hi���ɏo��578e�P-�3��ɐ2�#CQ �aԂ.�q2ܢ!�e�ḋ�{�:�<��� ��y�����C��"<d㎓e��`��t��n�L �y�Q&��p��49��C�ާ���'I�w����{�9�L�=���a�yD�,)�FۿƱ\U�b�{2c��~�Y� �e҉J�/(m��Lu�OY� d7�輲��)j{��a�}#nr��O�@el;�`�چ�9C3H#�2[�N�GX�>F/��A!��� �S�� �U�OA��N�8)�Ǟ�1�D��E��K��9kn���~�m)��u�q�di�435���n����� h>X�q 7� �?��d�.���!O�O��U|���S�53�O�=��'��8�<ԧ�b��Mq��F0}����I+�[���4��.�Ȋ�[L^H�e.&���� ���A2�D�@��ґ3d��A�±I4�!�E�y�~��<C�ݥ2�I�]{)���hGB� �-��Ŕ��*�K�5+?ȇ���[������ �@�cl8��l��Ǧ�yJE�%���:��qh�����>I�A8�9��s��P<��TD�(J��%�h)�%ɢ�ގ�QtK�/�F��J�e����5;,�z��5�uj���P�s�� ښ@-QU�"���؊M�u-��8�M��[k��|O�k�x+����15z ���֢�,8��-٩U�9gi�p��y����z�N�۪^ �.̤]���u �!оX�VWXN.�#.x�[t ���՚���/ �� PK ! ����( �( word/media/image3.jpg���� JFIF ` ` �� ZExif MM * J Q Q �Q � �� ���� C $.' ",#(7),01444'9=82<.342�� C 2!!22222222222222222222222222222222222222222222222222�� �"
-
-
ZAP